[PATCH] cpufreq: sun50i: Fix build warning around snprint()

Chen-Yu Tsai wens at csie.org
Sun Apr 21 23:27:50 PDT 2024


On Sun, Apr 21, 2024 at 8:31 PM Viresh Kumar <viresh.kumar at linaro.org> wrote:
>
> 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 at intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202404191715.LDwMm2gP-lkp@intel.com/
> Signed-off-by: Viresh Kumar <viresh.kumar at linaro.org>

Acked-by: Chen-Yu Tsai <wens at csie.org>



More information about the linux-arm-kernel mailing list