From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Tue, 13 Nov 2012 14:48:17 +0100 Subject: [U-Boot] [PATCH 1/7] i2c: Use __weak instead of __attribute__((weak, alias)) In-Reply-To: <20121113071613.49B3C2002E1@gemini.denx.de> References: <1352766871-892-1-git-send-email-marex@denx.de> <20121113071613.49B3C2002E1@gemini.denx.de> Message-ID: <201211131448.17776.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.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 > > Cc: Heiko Schocher > > --- > > > > 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