From: Gwendal Grignou <gwendal@chromium.org>
To: enric.balletbo@collabora.com, bleung@chromium.org,
groeck@chromium.org, lee.jones@linaro.org
Cc: linux-kernel@vger.kernel.org, Gwendal Grignou <gwendal@chromium.org>
Subject: [PATCH 09/30] mfd: cros_ec: Remove zero-size structs
Date: Wed, 24 Apr 2019 16:28:57 -0700 [thread overview]
Message-ID: <20190424232918.243308-10-gwendal@chromium.org> (raw)
In-Reply-To: <20190424232918.243308-1-gwendal@chromium.org>
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>
---
include/linux/mfd/cros_ec_commands.h | 33 +++++++++++++++-------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h
index 67e15c29e083..2e5c93d858d8 100644
--- a/include/linux/mfd/cros_ec_commands.h
+++ b/include/linux/mfd/cros_ec_commands.h
@@ -1510,10 +1510,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;
@@ -1567,11 +1571,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;
@@ -2991,9 +2997,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 */
@@ -3019,9 +3023,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;
--
2.21.0.593.g511ec345e18-goog
next prev parent reply other threads:[~2019-04-24 23:29 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-24 23:28 [PATCH 00/30] Update cros_ec_commands.h Gwendal Grignou
2019-04-24 23:28 ` [PATCH 01/30] mfd: cros_ec: Update license term Gwendal Grignou
2019-04-24 23:28 ` [PATCH 02/30] mfd: cros_ec: Zero BUILD_ macro Gwendal Grignou
2019-04-24 23:28 ` [PATCH 03/30] mfd: cros_ec: set comments properly Gwendal Grignou
2019-04-24 23:28 ` [PATCH 04/30] mfd: cros_ec: add ec_align macros Gwendal Grignou
2019-04-24 23:28 ` [PATCH 05/30] mfd: cros_ec: Define commands as 4-digit UPPER CASE hex values Gwendal Grignou
2019-04-24 23:28 ` [PATCH 06/30] mfd: cros_ec: use BIT macro Gwendal Grignou
2019-04-24 23:28 ` [PATCH 07/30] mfd: cros_ec: Update ACPI interface definition Gwendal Grignou
2019-04-24 23:28 ` [PATCH 08/30] mfd: cros_ec: move HDMI CEC API definition Gwendal Grignou
2019-04-24 23:28 ` Gwendal Grignou [this message]
2019-04-24 23:28 ` [PATCH 10/30] mfd: cros_ec: Add Flash V2 commands API Gwendal Grignou
2019-04-24 23:28 ` [PATCH 11/30] mfd: cros_ec: Add PWM_SET_DUTY API Gwendal Grignou
2019-04-24 23:29 ` [PATCH 12/30] mfd: cros_ec: Add lightbar v2 API Gwendal Grignou
2019-04-24 23:29 ` [PATCH 13/30] mfd: cros_ec: Expand hash API Gwendal Grignou
2019-04-24 23:29 ` [PATCH 14/30] mfd: cros_ec: Add EC transport protocol v4 Gwendal Grignou
2019-04-24 23:29 ` [PATCH 15/30] mfd: cros_ec: Complete MEMS sensor API Gwendal Grignou
2019-04-24 23:29 ` [PATCH 16/30] mfd: cros_ec: Fix event processing API Gwendal Grignou
2019-04-24 23:29 ` [PATCH 17/30] mfd: cros_ec: Add fingerprint API Gwendal Grignou
2019-04-24 23:29 ` [PATCH 18/30] mfd: cros_ec: Fix temperature API Gwendal Grignou
2019-04-24 23:29 ` [PATCH 19/30] mfd: cros_ec: Complete Power and USB PD API Gwendal Grignou
2019-04-24 23:29 ` [PATCH 20/30] mfd: cros_ec: Add API for keyboard testing Gwendal Grignou
2019-04-24 23:29 ` [PATCH 21/30] mfd: cros_ec: Add Hibernate API Gwendal Grignou
2019-04-24 23:29 ` [PATCH 22/30] mfd: cros_ec: Add Smart Battery Firmware update API Gwendal Grignou
2019-04-24 23:29 ` [PATCH 23/30] mfd: cros_ec: Add I2C passthru protection API Gwendal Grignou
2019-04-24 23:29 ` [PATCH 24/30] mfd: cros_ec: Update I2S API Gwendal Grignou
2019-04-25 8:50 ` Enric Balletbo i Serra
2019-04-24 23:29 ` [PATCH 25/30] mfd: cros_ec: Add API for EC-EC communication Gwendal Grignou
2019-04-24 23:29 ` [PATCH 26/30] mfd: cros_ec: Add API for Touchpad support Gwendal Grignou
2019-04-24 23:29 ` [PATCH 27/30] mfd: cros_ec: Add API for Fingerprint support Gwendal Grignou
2019-04-24 23:29 ` [PATCH 28/30] mfd: cros_ec: Add API for rwsig Gwendal Grignou
2019-04-24 23:29 ` [PATCH 29/30] mfd: cros_ec: Add SKU ID and Secure storage API Gwendal Grignou
2019-04-24 23:29 ` [PATCH 30/30] mfd: cros_ec: Add Management API entry points Gwendal Grignou
2019-04-25 8:12 ` [PATCH 00/30] Update cros_ec_commands.h Lee Jones
2019-04-25 11:19 ` Enric Balletbo i Serra
2019-04-25 16:00 ` Gwendal Grignou
2019-04-25 16:11 ` Enric Balletbo i Serra
2019-04-25 16:38 ` Gwendal Grignou
2019-04-25 17:40 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190424232918.243308-10-gwendal@chromium.org \
--to=gwendal@chromium.org \
--cc=bleung@chromium.org \
--cc=enric.balletbo@collabora.com \
--cc=groeck@chromium.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).