Skip to content

Commit

Permalink
drivers, samsung-laptop: fix initialization of sabi_data in sabi_set_…
Browse files Browse the repository at this point in the history
…commandb

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@google.com>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
  • Loading branch information
David Rientjes authored and Matthew Garrett committed Mar 26, 2012
1 parent c09b223 commit 8522944
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/platform/x86/samsung-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ static int sabi_command(struct samsung_laptop *samsung, u16 command,
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);
Expand Down

0 comments on commit 8522944

Please sign in to comment.