All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cfi_flash: Make all flash access functions weak
Date: Mon, 17 Nov 2008 10:49:33 +0100	[thread overview]
Message-ID: <200811171049.33323.sr@denx.de> (raw)
In-Reply-To: <20081117104016.7f9a1b9a@hskinnemo-gx745.norway.atmel.com>

On Monday 17 November 2008, Haavard Skinnemoen wrote:
> Stefan Roese <sr@denx.de> wrote:
> > I could do it this way, sure. But how about this version:
> >
> > static void __flash_write8(u8 value, void *addr)
> > {
> > 	__raw_writeb(value, addr);
> > }
> > ...
> >
> > #ifdef CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
> > void flash_write8(u8 value, void *addr)__attribute__((weak,
> > alias("__flash_write8"))); ...
> > #else
> > #define flash_read8	__flash_read8
> > ...
> > #endif
> >
> > We would still have the original accessor functions this way. And the
> > resulting source code looks a little "better" to me (less #ifdef's).
>
> Hmm...1 #ifdef vs. 1 #ifdef...I'd say that's pretty much the same ;-)

Yes right. I first thought you wanted to override the functions on a 
per-function basis:

#ifndef flash_write8
# define flash_write8(value, addr)     __raw_writeb(value, addr)
#endif
#ifndef flash_write16
# define flash_write16(value, addr)     __raw_writew(value, addr)
#endif
...

> But sure, your way works too.

OK, I'll submit a new patch version later today.

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

      reply	other threads:[~2008-11-17  9:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-12 12:31 [U-Boot] [PATCH] cfi_flash: Make all flash access functions weak Stefan Roese
2008-11-13  8:18 ` Haavard Skinnemoen
2008-11-17  8:45   ` Stefan Roese
2008-11-17  8:54     ` Stefan Roese
2008-11-17  9:01     ` Haavard Skinnemoen
2008-11-17  9:34       ` Stefan Roese
2008-11-17  9:40         ` Haavard Skinnemoen
2008-11-17  9:49           ` Stefan Roese [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200811171049.33323.sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.