mfd: cros_ec: Remove zero-size structs
authorGwendal Grignou <gwendal@chromium.org>
Mon, 3 Jun 2019 18:33:40 +0000 (11:33 -0700)
committerLee Jones <lee.jones@linaro.org>
Mon, 10 Jun 2019 08:15:08 +0000 (09:15 +0100)
Empty structure size is different between C and C++.
To prevent clang warning when compiling this include file in C++
programs, remove empty structures.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Acked-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
include/linux/mfd/cros_ec_commands.h

index d8bde2b5e9cee4e6e9a4b81f6918482f8cb3ffa1..fabf341af97fb9fb73d6028ea8abe4175d23f8b1 100644 (file)
@@ -1540,10 +1540,14 @@ struct lightbar_program {
 struct ec_params_lightbar {
        uint8_t cmd;                  /* Command (see enum lightbar_command) */
        union {
-               struct {
-                       /* no args */
-               } dump, off, on, init, get_seq, get_params_v0, get_params_v1,
-                       version, get_brightness, get_demo, suspend, resume;
+               /*
+                * The following commands have no args:
+                *
+                * dump, off, on, init, get_seq, get_params_v0, get_params_v1,
+                * version, get_brightness, get_demo, suspend, resume
+                *
+                * Don't use an empty struct, because C++ hates that.
+                */
 
                struct __ec_todo_unpacked {
                        uint8_t num;
@@ -1597,11 +1601,13 @@ struct ec_response_lightbar {
                        uint8_t red, green, blue;
                } get_rgb;
 
-               struct {
-                       /* no return params */
-               } off, on, init, set_brightness, seq, reg, set_rgb,
-                       demo, set_params_v0, set_params_v1,
-                       set_program, manual_suspend_ctrl, suspend, resume;
+               /*
+                * The following commands have no response:
+                *
+                * off, on, init, set_brightness, seq, reg, set_rgb,
+                * set_params_v0, set_params_v1, set_program,
+                * manual_suspend_ctrl, suspend, resume
+                */
        };
 } __ec_todo_packed;
 
@@ -3021,9 +3027,7 @@ enum charge_state_params {
 struct ec_params_charge_state {
        uint8_t cmd;                            /* enum charge_state_command */
        union {
-               struct {
-                       /* no args */
-               } get_state;
+               /* get_state has no args */
 
                struct __ec_todo_unpacked {
                        uint32_t param;         /* enum charge_state_param */
@@ -3049,9 +3053,8 @@ struct ec_response_charge_state {
                struct __ec_align4 {
                        uint32_t value;
                } get_param;
-               struct {
-                       /* no return values */
-               } set_param;
+
+               /* set_param returns no args */
        };
 } __ec_align4;