* [PATCH] firmware: qcom: avoid struct initialization warning on gcc-4.8
@ 2020-04-29 8:57 Arnd Bergmann
2020-04-29 19:37 ` Stephen Boyd
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2020-04-29 8:57 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Elliot Berman
Cc: Arnd Bergmann, Rob Clark, Stephen Boyd, linux-arm-msm, linux-kernel
When building with old compilers like gcc-4.8, a struct initializer
can warn about invalid syntax:
drivers/firmware/qcom_scm-smc.c: In function 'scm_smc_call':
drivers/firmware/qcom_scm-smc.c:94:9: error: missing braces around initializer [-Werror=missing-braces]
struct arm_smccc_args smc = {0};
^
drivers/firmware/qcom_scm-smc.c:94:9: error: (near initialization for 'smc.args') [-Werror=missing-braces]
cc1: some warnings being treated as errors
drivers/firmware/qcom_scm-legacy.c: In function 'scm_legacy_call':
drivers/firmware/qcom_scm-legacy.c:139:9: error: missing braces around initializer [-Werror=missing-braces]
struct arm_smccc_args smc = {0};
^
drivers/firmware/qcom_scm-legacy.c:139:9: error: (near initialization for 'smc.args') [-Werror=missing-braces]
Change this to use the empty initializer extension that
works with all compilers.
Fixes: 590e92809a58 ("firmware: qcom_scm-32: Move SMCCC register filling to qcom_scm_call")
Fixes: 3f951ea627da ("firmware: qcom_scm-64: Move SMC register filling to qcom_scm_call_smccc")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/firmware/qcom_scm-legacy.c | 2 +-
drivers/firmware/qcom_scm-smc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/qcom_scm-legacy.c b/drivers/firmware/qcom_scm-legacy.c
index eba6b60bfb61..5aa15fcf01d9 100644
--- a/drivers/firmware/qcom_scm-legacy.c
+++ b/drivers/firmware/qcom_scm-legacy.c
@@ -136,7 +136,7 @@ int scm_legacy_call(struct device *dev, const struct qcom_scm_desc *desc,
unsigned int i;
struct scm_legacy_command *cmd;
struct scm_legacy_response *rsp;
- struct arm_smccc_args smc = {0};
+ struct arm_smccc_args smc = { };
struct arm_smccc_res smc_res;
const size_t cmd_len = arglen * sizeof(__le32);
const size_t resp_len = MAX_QCOM_SCM_RETS * sizeof(__le32);
diff --git a/drivers/firmware/qcom_scm-smc.c b/drivers/firmware/qcom_scm-smc.c
index 497c13ba98d6..81818ea74824 100644
--- a/drivers/firmware/qcom_scm-smc.c
+++ b/drivers/firmware/qcom_scm-smc.c
@@ -91,7 +91,7 @@ int scm_smc_call(struct device *dev, const struct qcom_scm_desc *desc,
(qcom_scm_convention == SMC_CONVENTION_ARM_32) ?
ARM_SMCCC_SMC_32 : ARM_SMCCC_SMC_64;
struct arm_smccc_res smc_res;
- struct arm_smccc_args smc = {0};
+ struct arm_smccc_args smc = { };
smc.args[0] = ARM_SMCCC_CALL_VAL(
smccc_call_type,
--
2.26.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] firmware: qcom: avoid struct initialization warning on gcc-4.8
2020-04-29 8:57 [PATCH] firmware: qcom: avoid struct initialization warning on gcc-4.8 Arnd Bergmann
@ 2020-04-29 19:37 ` Stephen Boyd
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2020-04-29 19:37 UTC (permalink / raw)
To: Andy Gross, Arnd Bergmann, Bjorn Andersson, Elliot Berman
Cc: Arnd Bergmann, Rob Clark, linux-arm-msm, linux-kernel
Quoting Arnd Bergmann (2020-04-29 01:57:33)
> When building with old compilers like gcc-4.8, a struct initializer
> can warn about invalid syntax:
>
> drivers/firmware/qcom_scm-smc.c: In function 'scm_smc_call':
> drivers/firmware/qcom_scm-smc.c:94:9: error: missing braces around initializer [-Werror=missing-braces]
> struct arm_smccc_args smc = {0};
> ^
> drivers/firmware/qcom_scm-smc.c:94:9: error: (near initialization for 'smc.args') [-Werror=missing-braces]
> cc1: some warnings being treated as errors
> drivers/firmware/qcom_scm-legacy.c: In function 'scm_legacy_call':
> drivers/firmware/qcom_scm-legacy.c:139:9: error: missing braces around initializer [-Werror=missing-braces]
> struct arm_smccc_args smc = {0};
> ^
> drivers/firmware/qcom_scm-legacy.c:139:9: error: (near initialization for 'smc.args') [-Werror=missing-braces]
>
> Change this to use the empty initializer extension that
> works with all compilers.
>
> Fixes: 590e92809a58 ("firmware: qcom_scm-32: Move SMCCC register filling to qcom_scm_call")
> Fixes: 3f951ea627da ("firmware: qcom_scm-64: Move SMC register filling to qcom_scm_call_smccc")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-29 19:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 8:57 [PATCH] firmware: qcom: avoid struct initialization warning on gcc-4.8 Arnd Bergmann
2020-04-29 19:37 ` Stephen Boyd
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.