aboutsummaryrefslogtreecommitdiffstats
diff options
authorGustavo A. R. Silva <gustavoars@kernel.org>2025-05-06 15:14:01 -0600
committerTzung-Bi Shih <tzungbi@kernel.org>2025-05-07 03:04:29 +0000
commit3e552ccf405c0dea6339988202a564357249c437 (patch)
tree2d26cdbecc52fb8beec99bd1c25180c0f72c6893
parenta9635ef0ca12e7914f42bfa7ca6a019f606c2817 (diff)
downloadlinux-for-next.tar.gz
platform/chrome: kunit: Avoid -Wflex-array-member-not-at-endHEADmasterfor-next
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Move the conflicting declaration to the end of the structure. Notice that `struct cros_ec_command` is a flexible structure --a structure that contains a flexible-array member. Fix the following warning: drivers/platform/chrome/cros_ec_proto_test_util.h:16:32: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/aBp7mZ8kj9w4CKkl@kspp Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
-rw-r--r--drivers/platform/chrome/cros_ec_proto_test_util.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/platform/chrome/cros_ec_proto_test_util.h b/drivers/platform/chrome/cros_ec_proto_test_util.h
index 414002271c9c0c..b17239f052c23e 100644
--- a/drivers/platform/chrome/cros_ec_proto_test_util.h
+++ b/drivers/platform/chrome/cros_ec_proto_test_util.h
@@ -13,7 +13,6 @@ struct ec_xfer_mock {
struct kunit *test;
/* input */
- struct cros_ec_command msg;
void *i_data;
/* output */
@@ -21,6 +20,10 @@ struct ec_xfer_mock {
int result;
void *o_data;
u32 o_data_len;
+
+ /* input */
+ /* Must be last -ends in a flexible-array member. */
+ struct cros_ec_command msg;
};
extern int cros_kunit_ec_xfer_mock_default_result;