From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] GCC4.6: Convert various empty macros to inline functions
Date: Sat, 24 Sep 2011 00:22:05 +0200 [thread overview]
Message-ID: <1316816525-4010-1-git-send-email-marek.vasut@gmail.com> (raw)
In-Reply-To: <1316804993-29406-1-git-send-email-marek.vasut@gmail.com>
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 ++--
include/common.h | 4 ++--
include/i2c.h | 5 ++++-
3 files changed, 8 insertions(+), 5 deletions(-)
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/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 */
--
1.7.5.4
next prev parent reply other threads:[~2011-09-23 22:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-23 19:09 [U-Boot] [PATCH 1/2] GCC4.6: Convert various empty macros to inline functions Marek Vasut
2011-09-23 19:09 ` [U-Boot] [PATCH 2/2] GCC4.6: Remove unused "port" variable in cmd_usb.c Marek Vasut
2011-09-24 17:37 ` Remy Bohmer
2011-09-23 20:33 ` [U-Boot] [PATCH 1/2] GCC4.6: Convert various empty macros to inline functions Mike Frysinger
2011-09-23 21:52 ` Marek Vasut
2011-09-23 23:04 ` Mike Frysinger
2011-09-24 0:40 ` Marek Vasut
2011-09-24 5:05 ` Mike Frysinger
2011-09-23 22:22 ` Marek Vasut [this message]
2011-09-23 22:22 ` [U-Boot] [PATCH 1/2 V2] " Marek Vasut
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=1316816525-4010-1-git-send-email-marek.vasut@gmail.com \
--to=marek.vasut@gmail.com \
--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.