Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit d992f88

Browse files
GallaisPoutinevireshk
authored andcommitted
cpufreq: sti: fix build warning
Building this driver yields the following: .../drivers/cpufreq/sti-cpufreq.c:215:50: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=] 215 | snprintf(name, MAX_PCODE_NAME_LEN, pcode%d, pcode); | ^~ .../drivers/cpufreq/sti-cpufreq.c:215:44: note: directive argument in the range [0, 2147483647] 215 | snprintf(name, MAX_PCODE_NAME_LEN, pcode%d, pcode); | ^~~~~~~~~ .../drivers/cpufreq/sti-cpufreq.c:215:9: note: ‘snprintf’ output between 7 and 16 bytes into a destination of size 7 215 | snprintf(name, MAX_PCODE_NAME_LEN, pcode%d, pcode); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix the buffer size to avoid the warning at build time. Signed-off-by: Raphael Gallais-Pou <rgallaispou@gmail.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent ce87974 commit d992f88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cpufreq/sti-cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <linux/regmap.h>
1919

2020
#define VERSION_ELEMENTS 3
21-
#define MAX_PCODE_NAME_LEN 7
21+
#define MAX_PCODE_NAME_LEN 16
2222

2323
#define VERSION_SHIFT 28
2424
#define HW_INFO_INDEX 1

0 commit comments

Comments
 (0)