]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cpufreq: sti: fix build warning
authorRaphael Gallais-Pou <rgallaispou@gmail.com>
Mon, 8 Jul 2024 17:14:34 +0000 (19:14 +0200)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 9 Jul 2024 03:15:43 +0000 (08:45 +0530)
commitd992f881764cc89444aa5a9752ff508a1baeb61e
tree2667d64366bd3d8aa781e87a8687e03c7306a361
parentce87974811e015eb0e002c1b64a980d7a9d4c167
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>
drivers/cpufreq/sti-cpufreq.c