public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/7] i2c: Use __weak instead of __attribute__((weak, alias))
Date: Tue, 13 Nov 2012 14:48:17 +0100	[thread overview]
Message-ID: <201211131448.17776.marex@denx.de> (raw)
In-Reply-To: <20121113071613.49B3C2002E1@gemini.denx.de>

Dear Wolfgang Denk,

> Dear Marek Vasut,
> 
> In message <1352766871-892-1-git-send-email-marex@denx.de> you wrote:
> > Use __weak from linux/compiler.h instead of __attribute__((weak, alias))
> > to define overridable function. This patch is intended as a cleanup patch
> > to bring some consistency into the code.
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Heiko Schocher <hs@denx.de>
> > ---
> > 
> >  common/cmd_i2c.c |   16 +++++++---------
> >  1 file changed, 7 insertions(+), 9 deletions(-)
> 
> The actual definition of __weak is in include/linux/compiler-gcc.h and
> looks like this:
> 
> 	#define __weak	__attribute__((weak))
> 
> which means you omit the ", alias" part of the existing code.
> 
> Are you 100% sure that this has no impacts on the behaviour?

Yes

> In my understanding, "weak" and "weak, alias" are not exactly the
> same...

Can you please elaborate? The point of this alias here is to call __def_i2c_*() 
in case the overriding function isn't defined. Otherwise call the overriding 
function. The __def_i2c_*() is never called directly.

> Best regards,
> 
> Wolfgang Denk

Best regards,
Marek Vasut

      reply	other threads:[~2012-11-13 13:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-13  0:34 [U-Boot] [PATCH 1/7] i2c: Use __weak instead of __attribute__((weak, alias)) Marek Vasut
2012-11-13  0:34 ` [U-Boot] [PATCH 2/7] i2c: Staticize local functions in mxc i2c driver Marek Vasut
2012-11-13  0:34 ` [U-Boot] [PATCH 3/7] i2c: kerneldoc: Add kerneldoc annotations to cmd_i2c.c Marek Vasut
2012-11-13  0:34 ` [U-Boot] [PATCH 4/7] i2c: mxs: Abstract out the MXS I2C speed setup Marek Vasut
2012-11-13  8:29   ` Wolfgang Denk
2012-11-13 13:45     ` Marek Vasut
2012-11-13  0:34 ` [U-Boot] [PATCH 5/7] i2c: mxs: Implement i2c_get/set_bus_speed() Marek Vasut
2012-11-13  0:34 ` [U-Boot] [PATCH 6/7] i2c: mxs: Use i2c_set_bus_speed() in i2c_init() Marek Vasut
2012-11-13  0:34 ` [U-Boot] [PATCH 7/7] i2c: mxs: Fix TIMING2 register value Marek Vasut
2012-11-13  7:16 ` [U-Boot] [PATCH 1/7] i2c: Use __weak instead of __attribute__((weak, alias)) Wolfgang Denk
2012-11-13 13:48   ` Marek Vasut [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=201211131448.17776.marex@denx.de \
    --to=marex@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox