Skip to content

Commit

Permalink
i2c: Fix sparse warnings for I2C_BOARD_INFO()
Browse files Browse the repository at this point in the history
Since the first argument to I2C_BOARD_INFO() must be a string constant,
there is no need to parenthesise it, and adding parentheses results in
an invalid initialiser for char[].  gcc obviously accepts this syntax as
an extension, but sparse complains, e.g.:

drivers/net/sfc/boards.c:173:2: warning: array initialized from parenthesized string constant

Therefore, remove the parentheses.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Ben Hutchings authored and Jean Delvare committed Apr 13, 2009
1 parent 3f307fb commit c758e8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c758e8c

Please sign in to comment.