Skip to contentSkip to conversation

i2c: Fix warnings from I2C_BOARD_INFO()

PATCH In review Ben Dooks 2 participants 3 messages Apr 14, 2009

Subsystems (2)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 i2c: Fix warnings from I2C_BOARD_INFO()

The first argument for this macro is a string, and thus having (arg) in the macro is causing gcc 4.2.4 to produce warnings about strings of the form ("str").

Remove the brackets from the first argument.

example warning:

mach-bast.c:545:3: warning: array initialized from parenthesized string constant

---
 include/linux/i2c.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/i2c.h +1 -1
index 00ee11e..ad25805 100644
@@ -274,7 +274,7 @@ struct i2c_board_info {
  * are provided using conventional syntax.
  */
 #define I2C_BOARD_INFO(dev_type, dev_addr) \
-	.type = (dev_type), .addr = (dev_addr)
+	.type = dev_type, .addr = (dev_addr)
 
 
 /* Add-on boards should register/unregister their devices; e.g. a board
Signature · 1 line
1.5.6.5
#1 lore raw
Quoted 3 lines · Ben Dooks

The first argument for this macro is a string, and thus having (arg) in the macro is causing gcc 4.2.4 to produce warnings about strings of the form ("str").

Ben Hutchings submitted a patch for this recently which Jean merged.

author
#2 lore raw
Quoted 6 lines · Mark Brown
Quoted 3 lines · Ben Dooks

The first argument for this macro is a string, and thus having (arg) in the macro is causing gcc 4.2.4 to produce warnings about strings of the form ("str").

Ben Hutchings submitted a patch for this recently which Jean merged.

Yes, I didn't mean to submit this one, messed up git-format-patch for the fs/super.c patch I wanted to send.

Signature · 4 lines
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.