leds: pca955x: Avoid potential overflow when filling default_label (take 2)
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 30 Jun 2025 09:39:06 +0000 (12:39 +0300)
committerLee Jones <lee@kernel.org>
Wed, 2 Jul 2025 16:18:44 +0000 (17:18 +0100)
commit239afba8b9f3b0fcfd464d5ffeaed0ed4441c5a4
tree71d1d36001d31f5b8478adb858e1866b8b6d51a5
parentcb335325b1431152f696c53e32465ba192cd119a
leds: pca955x: Avoid potential overflow when filling default_label (take 2)

GCC compiler v8.5.0 is not happy about printing
into a too short buffer (when build with `make W=1`):

  drivers/leds/leds-pca955x.c:696:5: note: 'snprintf' output between 2 and 11 bytes into a destination of size 8

Unfortunately this is a false positive from the old GCC versions,
but we may still improve the code by using '%hhu' format specifier
and reduce buffer size by 4 bytes.

Fixes: bd3d14932923 ("leds: pca955x: Avoid potential overflow when filling default_label")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506282159.TXfvorYl-lkp@intel.com/
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250630093906.1715800-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/leds-pca955x.c