cpufreq: sun50i: Fix build warning around snprint()
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 22 Apr 2024 03:28:51 +0000 (08:58 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 23 Apr 2024 06:13:22 +0000 (11:43 +0530)
commitd2059d3b548409905b20b4f52495bffbd7c8da8b
tree75ced25be7e6b9fe974a2aecbaa35ad8597bb32e
parent09d0aaa0ae9c80ff9569393b206226c1008801b1
cpufreq: sun50i: Fix build warning around snprint()

The Sun50i driver generates a warning with W=1:

warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=]

Fix it by allocating a big enough array to print an integer.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202404191715.LDwMm2gP-lkp@intel.com/
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
drivers/cpufreq/sun50i-cpufreq-nvmem.c