summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/arm_scmi/clock.c
diff options
context:
space:
mode:
authorCristian Marussi <cristian.marussi@arm.com>2022-03-30 17:05:37 +0200
committerSudeep Holla <sudeep.holla@arm.com>2022-04-28 19:22:51 +0200
commit91ebc56cbcfa4c746a84ab9ee6a854be739860e2 (patch)
treee6dd619536b9fcf59fa14ae94f341190f463714c /drivers/firmware/arm_scmi/clock.c
parentfirmware: arm_scmi: Check CLOCK_RATE_SET_COMPLETE async response (diff)
downloadlinux-91ebc56cbcfa4c746a84ab9ee6a854be739860e2.tar.xz
linux-91ebc56cbcfa4c746a84ab9ee6a854be739860e2.zip
firmware: arm_scmi: Remove unneeded NULL termination of clk name
The string array 'name' inside struct scmi_clock_info holds the clock name which was successfully retrieved by querying the SCMI platform, unless the related underlying SCMI command failed. Anyway, such scmi_clock_info structure is allocated using devm_kcalloc() which in turn internally appends a __GFP_ZERO flag to its invocation: as a consequence the string 'name' field does not need to be zeroed when we fail to get the clock name via SCMI, it is already NULL terminated. Remove unneeded explicit NULL termination. Link: https://lore.kernel.org/r/20220330150551.2573938-9-cristian.marussi@arm.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.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c
index 30d30ec8df94..9dff6a948674 100644
--- a/drivers/firmware/arm_scmi/clock.c
+++ b/drivers/firmware/arm_scmi/clock.c
@@ -129,8 +129,6 @@ static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph,
if (t->rx.len == sizeof(*attr))
clk->enable_latency =
le32_to_cpu(attr->clock_enable_latency);
- } else {
- clk->name[0] = '\0';
}
ph->xops->xfer_put(ph, t);