summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/arm_scmi/clock.c
diff options
context:
space:
mode:
authorCristian Marussi <cristian.marussi@arm.com>2022-05-30 13:52:36 +0200
committerSudeep Holla <sudeep.holla@arm.com>2022-06-06 16:47:04 +0200
commitd0c94bef70e71e364c0a016b0e92307cd4d1d719 (patch)
treec546e11ea0d7f8af04db47c40c3b8f469cb07960 /drivers/firmware/arm_scmi/clock.c
parentfirmware: arm_scmi: Relax base protocol sanity checks on the protocol list (diff)
downloadlinux-d0c94bef70e71e364c0a016b0e92307cd4d1d719.tar.xz
linux-d0c94bef70e71e364c0a016b0e92307cd4d1d719.zip
firmware: arm_scmi: Remove all the unused local variables
While using SCMI iterators helpers a few local automatic variables are defined but then used only as input for sizeof operators. cppcheck is fooled to complain about this with: | drivers/firmware/arm_scmi/sensors.c:341:48: warning: Variable 'msg' is | not assigned a value. [unassignedVariable] | struct scmi_msg_sensor_list_update_intervals *msg; Even though this is an innocuos warning, since the uninitialized variable is at the end never used in the reported cases, fix these occurences all over SCMI stack to avoid keeping unneeded objects on the stack. Link: https://lore.kernel.org/r/20220530115237.277077-1-cristian.marussi@arm.com Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: Sudeep Holla <sudeep.holla@arm.com> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware/arm_scmi/clock.c')
-rw-r--r--drivers/firmware/arm_scmi/clock.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c
index 4d36a9a133d1..1a718faa4192 100644
--- a/drivers/firmware/arm_scmi/clock.c
+++ b/drivers/firmware/arm_scmi/clock.c
@@ -266,9 +266,7 @@ scmi_clock_describe_rates_get(const struct scmi_protocol_handle *ph, u32 clk_id,
struct scmi_clock_info *clk)
{
int ret;
-
void *iter;
- struct scmi_msg_clock_describe_rates *msg;
struct scmi_iterator_ops ops = {
.prepare_message = iter_clk_describe_prepare_message,
.update_state = iter_clk_describe_update_state,
@@ -281,7 +279,8 @@ scmi_clock_describe_rates_get(const struct scmi_protocol_handle *ph, u32 clk_id,
iter = ph->hops->iter_response_init(ph, &ops, SCMI_MAX_NUM_RATES,
CLOCK_DESCRIBE_RATES,
- sizeof(*msg), &cpriv);
+ sizeof(struct scmi_msg_clock_describe_rates),
+ &cpriv);
if (IS_ERR(iter))
return PTR_ERR(iter);