Re: [patch -next 1/2] drivers, samsung-laptop: fix initialization ofsabi_data in sabi_set_commandb
From: Corentin Chary
Date: Wed Mar 14 2012 - 03:12:23 EST
On Wed, Mar 14, 2012 at 6:59 AM, David Rientjes <rientjes@xxxxxxxxxx> wrote:
> Fields d0, d1, d2, and d3 are members of an anonymous struct inside an
> anonymous union inside struct sabi_data. ÂInitialization must be done by
> wrapping the anonymous union and structs with brackets to avoid a build
> error:
>
> drivers/platform/x86/samsung-laptop.c: In function âsabi_set_commandbâ:
> drivers/platform/x86/samsung-laptop.c:433: error: unknown field âd0â specified in initializer
> drivers/platform/x86/samsung-laptop.c:433: warning: missing braces around initializer
> drivers/platform/x86/samsung-laptop.c:433: warning: (near initialization for âin.<anonymous>â)
> ...
>
> Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx>
> ---
> Âdrivers/platform/x86/samsung-laptop.c | Â Â2 +-
> Â1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
> --- a/drivers/platform/x86/samsung-laptop.c
> +++ b/drivers/platform/x86/samsung-laptop.c
> @@ -430,7 +430,7 @@ exit:
> Âstatic int sabi_set_commandb(struct samsung_laptop *samsung,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â u16 command, u8 data)
> Â{
> - Â Â Â struct sabi_data in = { .d0 = 0, .d1 = 0, .d2 = 0, .d3 = 0 };
> + Â Â Â struct sabi_data in = { { { .d0 = 0, .d1 = 0, .d2 = 0, .d3 = 0 } } };
>
> Â Â Â Âin.data[0] = data;
> Â Â Â Âreturn sabi_command(samsung, command, &in, NULL);
Acked-by: Corentin Chary <corentincj@xxxxxxxxxx>
David, just in case, I found this mail in my spam folder, probably
because your smtp server is not allowed to send @google.com mails.
Also, with which version of gcc is this necessary ? Old version worked
with 4.5 and 4.6.
Matthew, could you merge that one and the other directly in your tree ? Thanks
--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/