• Raphael Gallais-Pou's avatar
    cpufreq: sti: fix build warning · d992f881
    Raphael Gallais-Pou authored
    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: default avatarRaphael Gallais-Pou <rgallaispou@gmail.com>
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    d992f881
sti-cpufreq.c 7.22 KB