public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/gpu/drm/nouveau/nouveau_backlight.c:56:69: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 3
@ 2025-01-02 13:14 kernel test robot
  2025-01-03  0:38 ` Philip Li
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-01-02 13:14 UTC (permalink / raw)
  To: Jani Nikula
  Cc: oe-kbuild-all, linux-kernel, Hamza Mahfooz,
	Javier Martinez Canillas

Hi Jani,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   56e6a3499e14716b9a28a307bb6d18c10e95301e
commit: f89632a9e5fa6c4787c14458cd42a9ef42025434 drm: Add CONFIG_DRM_WERROR
date:   10 months ago
config: loongarch-randconfig-002-20250102 (https://download.01.org/0day-ci/archive/20250102/202501022122.Pct9ERae-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250102/202501022122.Pct9ERae-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501022122.Pct9ERae-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/gpu/drm/nouveau/nouveau_backlight.c: In function 'nouveau_backlight_init':
>> drivers/gpu/drm/nouveau/nouveau_backlight.c:56:69: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 3 [-Werror=format-truncation=]
      56 |                 snprintf(backlight_name, BL_NAME_SIZE, "nv_backlight%d", nb);
         |                                                                     ^~
   In function 'nouveau_get_backlight_name',
       inlined from 'nouveau_backlight_init' at drivers/gpu/drm/nouveau/nouveau_backlight.c:351:7:
   drivers/gpu/drm/nouveau/nouveau_backlight.c:56:56: note: directive argument in the range [1, 2147483647]
      56 |                 snprintf(backlight_name, BL_NAME_SIZE, "nv_backlight%d", nb);
         |                                                        ^~~~~~~~~~~~~~~~
   drivers/gpu/drm/nouveau/nouveau_backlight.c:56:17: note: 'snprintf' output between 14 and 23 bytes into a destination of size 15
      56 |                 snprintf(backlight_name, BL_NAME_SIZE, "nv_backlight%d", nb);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors


vim +56 drivers/gpu/drm/nouveau/nouveau_backlight.c

db1a0ae21461af Pierre Moreau      2016-12-08  46  
db1a0ae21461af Pierre Moreau      2016-12-08  47  static bool
6d757753cef8d5 Lyude Paul         2018-09-06  48  nouveau_get_backlight_name(char backlight_name[BL_NAME_SIZE],
6d757753cef8d5 Lyude Paul         2018-09-06  49  			   struct nouveau_backlight *bl)
db1a0ae21461af Pierre Moreau      2016-12-08  50  {
ab244be47a8f11 Christophe JAILLET 2022-02-09  51  	const int nb = ida_alloc_max(&bl_ida, 99, GFP_KERNEL);
ab244be47a8f11 Christophe JAILLET 2022-02-09  52  
ab244be47a8f11 Christophe JAILLET 2022-02-09  53  	if (nb < 0)
db1a0ae21461af Pierre Moreau      2016-12-08  54  		return false;
db1a0ae21461af Pierre Moreau      2016-12-08  55  	if (nb > 0)
db1a0ae21461af Pierre Moreau      2016-12-08 @56  		snprintf(backlight_name, BL_NAME_SIZE, "nv_backlight%d", nb);
db1a0ae21461af Pierre Moreau      2016-12-08  57  	else
db1a0ae21461af Pierre Moreau      2016-12-08  58  		snprintf(backlight_name, BL_NAME_SIZE, "nv_backlight");
6d757753cef8d5 Lyude Paul         2018-09-06  59  	bl->id = nb;
db1a0ae21461af Pierre Moreau      2016-12-08  60  	return true;
db1a0ae21461af Pierre Moreau      2016-12-08  61  }
db1a0ae21461af Pierre Moreau      2016-12-08  62  

:::::: The code at line 56 was first introduced by commit
:::::: db1a0ae21461afa4bc435651a6dd55e0e6ef4a8b drm/nouveau/bl: Assign different names to interfaces

:::::: TO: Pierre Moreau <pierre.morrow@free.fr>
:::::: CC: Ben Skeggs <bskeggs@redhat.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: drivers/gpu/drm/nouveau/nouveau_backlight.c:56:69: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 3
  2025-01-02 13:14 drivers/gpu/drm/nouveau/nouveau_backlight.c:56:69: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 3 kernel test robot
@ 2025-01-03  0:38 ` Philip Li
  0 siblings, 0 replies; 2+ messages in thread
From: Philip Li @ 2025-01-03  0:38 UTC (permalink / raw)
  To: kernel test robot
  Cc: Jani Nikula, oe-kbuild-all, linux-kernel, Hamza Mahfooz,
	Javier Martinez Canillas

On Thu, Jan 02, 2025 at 09:14:13PM +0800, kernel test robot wrote:
> Hi Jani,
> 
> FYI, the error/warning still remains.

Sorry, kindly ignore this report that the commit is not the initial cause of the issue.

> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   56e6a3499e14716b9a28a307bb6d18c10e95301e
> commit: f89632a9e5fa6c4787c14458cd42a9ef42025434 drm: Add CONFIG_DRM_WERROR
> date:   10 months ago
> config: loongarch-randconfig-002-20250102 (https://download.01.org/0day-ci/archive/20250102/202501022122.Pct9ERae-lkp@intel.com/config)
> compiler: loongarch64-linux-gcc (GCC) 14.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250102/202501022122.Pct9ERae-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202501022122.Pct9ERae-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>    drivers/gpu/drm/nouveau/nouveau_backlight.c: In function 'nouveau_backlight_init':
> >> drivers/gpu/drm/nouveau/nouveau_backlight.c:56:69: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 3 [-Werror=format-truncation=]
>       56 |                 snprintf(backlight_name, BL_NAME_SIZE, "nv_backlight%d", nb);
>          |                                                                     ^~
>    In function 'nouveau_get_backlight_name',
>        inlined from 'nouveau_backlight_init' at drivers/gpu/drm/nouveau/nouveau_backlight.c:351:7:
>    drivers/gpu/drm/nouveau/nouveau_backlight.c:56:56: note: directive argument in the range [1, 2147483647]
>       56 |                 snprintf(backlight_name, BL_NAME_SIZE, "nv_backlight%d", nb);
>          |                                                        ^~~~~~~~~~~~~~~~
>    drivers/gpu/drm/nouveau/nouveau_backlight.c:56:17: note: 'snprintf' output between 14 and 23 bytes into a destination of size 15
>       56 |                 snprintf(backlight_name, BL_NAME_SIZE, "nv_backlight%d", nb);
>          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    cc1: all warnings being treated as errors
> 
> 
> vim +56 drivers/gpu/drm/nouveau/nouveau_backlight.c
> 
> db1a0ae21461af Pierre Moreau      2016-12-08  46  
> db1a0ae21461af Pierre Moreau      2016-12-08  47  static bool
> 6d757753cef8d5 Lyude Paul         2018-09-06  48  nouveau_get_backlight_name(char backlight_name[BL_NAME_SIZE],
> 6d757753cef8d5 Lyude Paul         2018-09-06  49  			   struct nouveau_backlight *bl)
> db1a0ae21461af Pierre Moreau      2016-12-08  50  {
> ab244be47a8f11 Christophe JAILLET 2022-02-09  51  	const int nb = ida_alloc_max(&bl_ida, 99, GFP_KERNEL);
> ab244be47a8f11 Christophe JAILLET 2022-02-09  52  
> ab244be47a8f11 Christophe JAILLET 2022-02-09  53  	if (nb < 0)
> db1a0ae21461af Pierre Moreau      2016-12-08  54  		return false;
> db1a0ae21461af Pierre Moreau      2016-12-08  55  	if (nb > 0)
> db1a0ae21461af Pierre Moreau      2016-12-08 @56  		snprintf(backlight_name, BL_NAME_SIZE, "nv_backlight%d", nb);
> db1a0ae21461af Pierre Moreau      2016-12-08  57  	else
> db1a0ae21461af Pierre Moreau      2016-12-08  58  		snprintf(backlight_name, BL_NAME_SIZE, "nv_backlight");
> 6d757753cef8d5 Lyude Paul         2018-09-06  59  	bl->id = nb;
> db1a0ae21461af Pierre Moreau      2016-12-08  60  	return true;
> db1a0ae21461af Pierre Moreau      2016-12-08  61  }
> db1a0ae21461af Pierre Moreau      2016-12-08  62  
> 
> :::::: The code at line 56 was first introduced by commit
> :::::: db1a0ae21461afa4bc435651a6dd55e0e6ef4a8b drm/nouveau/bl: Assign different names to interfaces
> 
> :::::: TO: Pierre Moreau <pierre.morrow@free.fr>
> :::::: CC: Ben Skeggs <bskeggs@redhat.com>
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-03  0:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-02 13:14 drivers/gpu/drm/nouveau/nouveau_backlight.c:56:69: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 3 kernel test robot
2025-01-03  0:38 ` Philip Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox