diff mbox

[U-Boot,1/7,V2] GCC4.6: Convert various empty macros to inline functions

Message ID 1316996766-14248-1-git-send-email-marek.vasut@gmail.com
State Accepted
Commit 60ce53cf9f408d9ad721f8e7a87d6a564e6d5bac
Headers show

Commit Message

Marek Vasut Sept. 26, 2011, 12:26 a.m. UTC
Fixes problems similar to the following ones:

cmd_date.c: In function ‘do_date’:
cmd_date.c:50:6: warning: variable ‘old_bus’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 common/usb.c         |    4 ++--
 common/usb_storage.c |    2 +-
 include/common.h     |    4 ++--
 include/i2c.h        |    5 ++++-
 4 files changed, 9 insertions(+), 6 deletions(-)

V2: Squash warning in usb_storage.c

Comments

Fabio Estevam Sept. 26, 2011, 2:39 a.m. UTC | #1
On Sun, Sep 25, 2011 at 9:26 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> Fixes problems similar to the following ones:
>
> cmd_date.c: In function ‘do_date’:
> cmd_date.c:50:6: warning: variable ‘old_bus’ set but not used
> [-Wunused-but-set-variable]


Your commit log does not match your patch.
Mike Frysinger Sept. 26, 2011, 3:41 a.m. UTC | #2
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
Marek Vasut Sept. 26, 2011, 9:04 a.m. UTC | #3
On Monday, September 26, 2011 04:39:42 AM Fabio Estevam wrote:
> On Sun, Sep 25, 2011 at 9:26 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > Fixes problems similar to the following ones:
> > 
> > cmd_date.c: In function ‘do_date’:
> > cmd_date.c:50:6: warning: variable ‘old_bus’ set but not used
> > [-Wunused-but-set-variable]
> 
> Your commit log does not match your patch.

"Fixes problems similar to the following ones" ... why not ?

Cheers
Wolfgang Denk Sept. 26, 2011, 11:28 a.m. UTC | #4
Dear Marek Vasut,

In message <201109261104.13082.marek.vasut@gmail.com> you wrote:
>
> > Your commit log does not match your patch.
> 
> "Fixes problems similar to the following ones" ... why not ?

Please show _exactly_ which problems the patch fixes.

Best regards,

Wolfgang Denk
Marek Vasut Oct. 3, 2011, 6:32 p.m. UTC | #5
On Monday, September 26, 2011 02:26:00 AM Marek Vasut wrote:
> Fixes problems similar to the following ones:
> 
> cmd_date.c: In function ‘do_date’:
> cmd_date.c:50:6: warning: variable ‘old_bus’ set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> ---

Wolfgang, can you please revert this patch ? It should get the PPCs building 
again, but I feel like it's more like hiding errors. As a temporary solution 
(until I come up with something better), this should work.

I'll give a final confirmation that this fixes the problem after I do build on 
all PPC and ARM boards, but TQM823L builds fine.
Wolfgang Denk Oct. 3, 2011, 6:36 p.m. UTC | #6
Dear Marek Vasut,

In message <201110032032.25013.marek.vasut@gmail.com> you wrote:
>
> Wolfgang, can you please revert this patch ? It should get the PPCs building 
> again, but I feel like it's more like hiding errors. As a temporary solution 
> (until I come up with something better), this should work.
>
> I'll give a final confirmation that this fixes the problem after I do build on 
> all PPC and ARM boards, but TQM823L builds fine.

OK, I'm waiting for your confirmation then.

Best regards,

Wolfgang Denk
Marek Vasut Oct. 3, 2011, 6:42 p.m. UTC | #7
On Monday, October 03, 2011 08:36:58 PM Wolfgang Denk wrote:
> Dear Marek Vasut,
> 
> In message <201110032032.25013.marek.vasut@gmail.com> you wrote:
> > Wolfgang, can you please revert this patch ? It should get the PPCs
> > building again, but I feel like it's more like hiding errors. As a
> > temporary solution (until I come up with something better), this should
> > work.
> > 
> > I'll give a final confirmation that this fixes the problem after I do
> > build on all PPC and ARM boards, but TQM823L builds fine.
> 
> OK, I'm waiting for your confirmation then.

Building like never before :-( Good so far, I know I screwed very badly this 
time.
Marek Vasut Oct. 3, 2011, 10:58 p.m. UTC | #8
On Monday, October 03, 2011 08:42:59 PM Marek Vasut wrote:
> On Monday, October 03, 2011 08:36:58 PM Wolfgang Denk wrote:
> > Dear Marek Vasut,
> > 
> > In message <201110032032.25013.marek.vasut@gmail.com> you wrote:
> > > Wolfgang, can you please revert this patch ? It should get the PPCs
> > > building again, but I feel like it's more like hiding errors. As a
> > > temporary solution (until I come up with something better), this should
> > > work.
> > > 
> > > I'll give a final confirmation that this fixes the problem after I do
> > > build on all PPC and ARM boards, but TQM823L builds fine.
> > 
> > OK, I'm waiting for your confirmation then.
> 
> Building like never before :-( Good so far, I know I screwed very badly
> this time.

I was compiling like there was no tomorrow:

* BMW board builds with some warnings (unrelated)

* MPC8360ERDK, MPC8360ERDK_33, MPC8360ERDK_66, socrates, TQM8548_BE doesn't 
build (mtd related issues) 
Configuring for MPC8360ERDK board...
fsl_upm.c:151: error: static declaration of 'nand_read_buf' follows non-static 
declaration
/home/marex/u-boot/include/nand.h:139: error: previous declaration of 
'nand_read_buf' was here
make[1]: *** [fsl_upm.o] Error 1
make: *** [drivers/mtd/nand/libnand.o] Error 2
make: *** Waiting for unfinished jobs....
make: *** wait: No child processes.  Stop.
powerpc-linux-size: './u-boot': No such file

NOTE: This can be fixed by the patch Message-Id: <1317682569-4896-1-git-send-
email-marek.vasut@gmail.com> and Message-Id: <1317682569-4896-3-git-send-email-
marek.vasut@gmail.com>

* P1011RDB and variants:
cmd_sf.c: In function 'do_spi_flash':
cmd_sf.c:164: warning: 'skipped' may be used uninitialized in this function
cmd_sf.c:164: note: 'skipped' was declared here

NOTE: Patch Message-Id: <1317682569-4896-2-git-send-email-marek.vasut@gmail.com> 
should fix the problem.

* mpq101 board:
Configuring for mpq101 board...
powerpc-linux-ld: section .bootpg [fffff000 -> fffff22f] overlaps section .data 
[ffffe258 -> fffffe1b]
powerpc-linux-ld: u-boot: section .bootpg lma 0xfffff000 overlaps previous 
sections
powerpc-linux-ld: u-boot: section .u_boot_cmd lma 0xfffffe1c overlaps previous 
sections
powerpc-linux-ld: u-boot: section .resetvec lma 0xfffffffc overlaps previous 
sections
powerpc-linux-ld: u-boot: section .ppcenv lma 0xfffc0000 overlaps previous 
sections
make: *** [u-boot] Error 1
powerpc-linux-size: './u-boot': No such file

I'll re-run the tests with the reverted GCC4.6 debug() patch and the three 
patches I submitted (Referenced in this mail) and reply in the morning.

Cheers
Marek Vasut Oct. 4, 2011, 12:18 p.m. UTC | #9
On Monday, October 03, 2011 08:36:58 PM Wolfgang Denk wrote:
> Dear Marek Vasut,
> 
> In message <201110032032.25013.marek.vasut@gmail.com> you wrote:
> > Wolfgang, can you please revert this patch ? It should get the PPCs
> > building again, but I feel like it's more like hiding errors. As a
> > temporary solution (until I come up with something better), this should
> > work.
> > 
> > I'll give a final confirmation that this fixes the problem after I do
> > build on all PPC and ARM boards, but TQM823L builds fine.
> 
> OK, I'm waiting for your confirmation then.
> 

I can confirm revert of this patch does fix the build issues on PPC 
architecture. I'll continue the investigation as for how this can be fixed 
without growing the code.

Cheers
Marek Vasut Oct. 4, 2011, 7:06 p.m. UTC | #10
On Tuesday, October 04, 2011 02:18:23 PM Marek Vasut wrote:
> On Monday, October 03, 2011 08:36:58 PM Wolfgang Denk wrote:
> > Dear Marek Vasut,
> > 
> > In message <201110032032.25013.marek.vasut@gmail.com> you wrote:
> > > Wolfgang, can you please revert this patch ? It should get the PPCs
> > > building again, but I feel like it's more like hiding errors. As a
> > > temporary solution (until I come up with something better), this should
> > > work.
> > > 
> > > I'll give a final confirmation that this fixes the problem after I do
> > > build on all PPC and ARM boards, but TQM823L builds fine.
> > 
> > OK, I'm waiting for your confirmation then.
> 
> I can confirm revert of this patch does fix the build issues on PPC
> architecture. I'll continue the investigation as for how this can be fixed
> without growing the code.
> 
> Cheers

Please revert the "GCC4.6: Convert various empty macros to inline functions". 
Please consider this a final confirmation.
Wolfgang Denk Oct. 4, 2011, 7:23 p.m. UTC | #11
Dear Marek Vasut,

In message <201110042106.43968.marek.vasut@gmail.com> you wrote:
>
> Please revert the "GCC4.6: Convert various empty macros to inline functions". 
> Please consider this a final confirmation.

Thanks, reverted.



Best regards,

Wolfgang Denk
Mike Frysinger Oct. 4, 2011, 7:46 p.m. UTC | #12
On Tuesday 04 October 2011 15:06:43 Marek Vasut wrote:
> On Tuesday, October 04, 2011 02:18:23 PM Marek Vasut wrote:
> > On Monday, October 03, 2011 08:36:58 PM Wolfgang Denk wrote:
> > > Marek Vasut wrote:
> > > > Wolfgang, can you please revert this patch ? It should get the PPCs
> > > > building again, but I feel like it's more like hiding errors. As a
> > > > temporary solution (until I come up with something better), this
> > > > should work.
> > > > 
> > > > I'll give a final confirmation that this fixes the problem after I do
> > > > build on all PPC and ARM boards, but TQM823L builds fine.
> > > 
> > > OK, I'm waiting for your confirmation then.
> > 
> > I can confirm revert of this patch does fix the build issues on PPC
> > architecture. I'll continue the investigation as for how this can be
> > fixed without growing the code.
> 
> Please revert the "GCC4.6: Convert various empty macros to inline
> functions". Please consider this a final confirmation.

to be clear, we will want this back eventually :)

it's finding legit bugs ... it noticed some DEBUG code of mine in the Blackfin 
SPI driver had rotted.
-mike
Wolfgang Denk Oct. 4, 2011, 8:44 p.m. UTC | #13
Dear Mike Frysinger,

In message <201110041546.41827.vapier@gentoo.org> you wrote:
>
> > Please revert the "GCC4.6: Convert various empty macros to inline
> > functions". Please consider this a final confirmation.
> 
> to be clear, we will want this back eventually :)

Agreed.

But in a form that 1) does not break building of boards and 2) does
not inclrease code size for boards that don't even have DEBUG
defined.

Best regards,

Wolfgang Denk
Marek Vasut Oct. 4, 2011, 8:58 p.m. UTC | #14
On Tuesday, October 04, 2011 10:44:28 PM Wolfgang Denk wrote:
> Dear Mike Frysinger,
> 
> In message <201110041546.41827.vapier@gentoo.org> you wrote:
> > > Please revert the "GCC4.6: Convert various empty macros to inline
> > > functions". Please consider this a final confirmation.
> > 
> > to be clear, we will want this back eventually :)
> 
> Agreed.
> 
> But in a form that 1) does not break building of boards and 2) does
> not inclrease code size for boards that don't even have DEBUG
> defined.

Agreed, I'll keep digging into it. And it's true it found some bugs.

Cheers
diff mbox

Patch

diff --git a/common/usb.c b/common/usb.c
index a401c09..a5f9e9f 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -63,7 +63,7 @@ 
 #ifdef	USB_DEBUG
 #define	USB_PRINTF(fmt, args...)	printf(fmt , ##args)
 #else
-#define USB_PRINTF(fmt, args...)
+static inline void USB_PRINTF(const char *fmt, ...) {}
 #endif
 
 #define USB_BUFSIZ	512
@@ -970,7 +970,7 @@  void usb_scan_devices(void)
 #ifdef	USB_HUB_DEBUG
 #define	USB_HUB_PRINTF(fmt, args...)	printf(fmt , ##args)
 #else
-#define USB_HUB_PRINTF(fmt, args...)
+static inline void USB_HUB_PRINTF(const char *fmt, ...) {}
 #endif
 
 
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 16667f3..5c56918 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -63,7 +63,7 @@ 
 #ifdef	USB_STOR_DEBUG
 #define USB_STOR_PRINTF(fmt, args...)	printf(fmt , ##args)
 #else
-#define USB_STOR_PRINTF(fmt, args...)
+static inline void USB_STOR_PRINTF(const char *fmt, ...) {}
 #endif
 
 #include <scsi.h>
diff --git a/include/common.h b/include/common.h
index d244bd4..aeb2d84 100644
--- a/include/common.h
+++ b/include/common.h
@@ -120,8 +120,8 @@  typedef volatile unsigned char	vu_char;
 #define debug(fmt,args...)	printf (fmt ,##args)
 #define debugX(level,fmt,args...) if (DEBUG>=level) printf(fmt,##args);
 #else
-#define debug(fmt,args...)
-#define debugX(level,fmt,args...)
+static inline void debug(const char *fmt, ...) {}
+static inline void debugX(int level, const char *fmt, ...) {}
 #endif	/* DEBUG */
 
 #ifdef DEBUG
diff --git a/include/i2c.h b/include/i2c.h
index 8ceb4c8..323150d 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -55,7 +55,10 @@ 
 #else
 #define CONFIG_SYS_MAX_I2C_BUS		1
 #define I2C_GET_BUS()		0
-#define I2C_SET_BUS(a)
+static inline int I2C_SET_BUS(unsigned int bus)
+{
+	return 0;
+}
 #endif
 
 /* define the I2C bus number for RTC and DTT if not already done */