From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Ben Hutchings <bhutchings-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] Fix sparse warnings for I2C_BOARD_INFO()
Date: Wed, 8 Apr 2009 20:12:12 +0200 [thread overview]
Message-ID: <20090408201212.084db80a@hyperion.delvare> (raw)
In-Reply-To: <1239209853.3202.15.camel@achroite>
Hi Ben,
On Wed, 08 Apr 2009 17:57:33 +0100, Ben Hutchings wrote:
> 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-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>
> ---
> i2c.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> ---
> diff --git a/include/linux/i2c.h b/include/linux/i2c.h
> index c86c3b0..f352a0a 100644
> --- a/include/linux/i2c.h
> +++ b/include/linux/i2c.h
> @@ -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
>
Good catch! Applied, thanks.
--
Jean Delvare
prev parent reply other threads:[~2009-04-08 18:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-08 16:57 [PATCH] Fix sparse warnings for I2C_BOARD_INFO() Ben Hutchings
2009-04-08 18:12 ` Jean Delvare [this message]
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=20090408201212.084db80a@hyperion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=bhutchings-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox