summaryrefslogtreecommitdiff
path: root/drivers/soc/qcom/system_stats.c
diff options
context:
space:
mode:
authorSwetha Chikkaboraiah <schikk@codeaurora.org>2020-03-02 10:55:12 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2020-05-21 23:57:59 -0700
commit6dbab77b6ddda309f56027f135f1eede33b76c2c (patch)
tree1d6202db5896c0cd90b44962678ebfafec402362 /drivers/soc/qcom/system_stats.c
parent5a6566f225652a01f17f062b4fa91f269e49014a (diff)
kernel: Fix build errors with LLVM
This patch intends to fix compilation errors while building kernel with LLVM toolchain. Change-Id: I76c4f97d8a0efb44434d54fb07cae23b050d2003 Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
Diffstat (limited to 'drivers/soc/qcom/system_stats.c')
-rw-r--r--drivers/soc/qcom/system_stats.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/soc/qcom/system_stats.c b/drivers/soc/qcom/system_stats.c
index ba35928a991b..30e15a0a2c9a 100644
--- a/drivers/soc/qcom/system_stats.c
+++ b/drivers/soc/qcom/system_stats.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016, 2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -298,6 +298,7 @@ static int msm_rpmstats_probe(struct platform_device *pdev)
void __iomem *offset_addr = NULL;
struct resource res;
int i, ret = 0;
+ size_t master_name_len = 0;
if (!pdev)
return -EINVAL;
@@ -365,7 +366,7 @@ static int msm_rpmstats_probe(struct platform_device *pdev)
* Read master names from DT
*/
for (i = 0; i < ss.num_masters; i++) {
- const char *master_name;
+ const char *master_name = NULL;
of_property_read_string_index(pdev->dev.of_node,
"qcom,masters",
@@ -377,8 +378,9 @@ static int msm_rpmstats_probe(struct platform_device *pdev)
pr_err("%s:Failed to get memory\n", __func__);
return -ENOMEM;
}
+ master_name_len = strlen(master_name);
strlcpy(ss.master[i], master_name,
- strlen(master_name) + 1);
+ master_name_len + 1);
}
dent = debugfs_create_file("system_stats", S_IRUGO, NULL,