Skip to content

Commit 8522944

Browse files
rientjesMatthew Garrett
authored andcommitted
drivers, samsung-laptop: fix initialization of sabi_data in sabi_set_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>
1 parent c09b223 commit 8522944

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/x86/samsung-laptop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ static int sabi_command(struct samsung_laptop *samsung, u16 command,
430430
static int sabi_set_commandb(struct samsung_laptop *samsung,
431431
u16 command, u8 data)
432432
{
433-
struct sabi_data in = { .d0 = 0, .d1 = 0, .d2 = 0, .d3 = 0 };
433+
struct sabi_data in = { { { .d0 = 0, .d1 = 0, .d2 = 0, .d3 = 0 } } };
434434

435435
in.data[0] = data;
436436
return sabi_command(samsung, command, &in, NULL);

0 commit comments

Comments
 (0)