[PATCH 05/14] drivers, samsung-laptop: fix initialization of sabi_data in sabi_set_commandb

From: Corentin Chary
Date: Tue Mar 20 2012 - 04:54:16 EST


From: David Rientjes <rientjes@xxxxxxxxxx>

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>
Signed-off-by: Corentin Chary <corentincj@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
index 7d7109f..b7c67c8 100644
--- 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);
--
1.7.3.4

--
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/