mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/power/supply/cros_usbpd-charger.c:15:49: warning: '%d' directive writing between 1 and 11 bytes into a region of size 5
@ 2025-01-07 20:10 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-01-07 20:10 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: oe-kbuild-all, linux-kernel, Lee Jones, Gwendal Grignou

Hi Enric,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fbfd64d25c7af3b8695201ebc85efe90be28c5a3
commit: 47f11e0b40e97f373da4efbacee0a9526c816ed5 mfd / platform: cros_ec: Move cros-ec core driver out from MFD
date:   5 years ago
config: arm-randconfig-r016-20221216 (https://download.01.org/0day-ci/archive/20250108/202501080332.cWaGQlRG-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250108/202501080332.cWaGQlRG-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/202501080332.cWaGQlRG-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/power/supply/cros_usbpd-charger.c: In function 'cros_usbpd_charger_probe':
>> drivers/power/supply/cros_usbpd-charger.c:15:49: warning: '%d' directive writing between 1 and 11 bytes into a region of size 5 [-Wformat-overflow=]
      15 | #define CHARGER_USBPD_DIR_NAME                  "CROS_USBPD_CHARGER%d"
         |                                                 ^~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/cros_usbpd-charger.c:656:45: note: in expansion of macro 'CHARGER_USBPD_DIR_NAME'
     656 |                         sprintf(port->name, CHARGER_USBPD_DIR_NAME, i);
         |                                             ^~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/cros_usbpd-charger.c:15:68: note: format string is defined here
      15 | #define CHARGER_USBPD_DIR_NAME                  "CROS_USBPD_CHARGER%d"
         |                                                                    ^~
   drivers/power/supply/cros_usbpd-charger.c:15:49: note: directive argument in the range [-2147483644, 2147483646]
      15 | #define CHARGER_USBPD_DIR_NAME                  "CROS_USBPD_CHARGER%d"
         |                                                 ^~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/cros_usbpd-charger.c:656:45: note: in expansion of macro 'CHARGER_USBPD_DIR_NAME'
     656 |                         sprintf(port->name, CHARGER_USBPD_DIR_NAME, i);
         |                                             ^~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/cros_usbpd-charger.c:656:25: note: 'sprintf' output between 20 and 30 bytes into a destination of size 23
     656 |                         sprintf(port->name, CHARGER_USBPD_DIR_NAME, i);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +15 drivers/power/supply/cros_usbpd-charger.c

f68b883e8fad23 Sameer Nanda  2018-05-02  14  
3af15cfacd1eef Fabien Parent 2018-08-10 @15  #define CHARGER_USBPD_DIR_NAME			"CROS_USBPD_CHARGER%d"
3af15cfacd1eef Fabien Parent 2018-08-10  16  #define CHARGER_DEDICATED_DIR_NAME		"CROS_DEDICATED_CHARGER"
3af15cfacd1eef Fabien Parent 2018-08-10  17  #define CHARGER_DIR_NAME_LENGTH		(sizeof(CHARGER_USBPD_DIR_NAME) >= \
3af15cfacd1eef Fabien Parent 2018-08-10  18  					 sizeof(CHARGER_DEDICATED_DIR_NAME) ? \
3af15cfacd1eef Fabien Parent 2018-08-10  19  					 sizeof(CHARGER_USBPD_DIR_NAME) : \
3af15cfacd1eef Fabien Parent 2018-08-10  20  					 sizeof(CHARGER_DEDICATED_DIR_NAME))
f68b883e8fad23 Sameer Nanda  2018-05-02  21  #define CHARGER_CACHE_UPDATE_DELAY		msecs_to_jiffies(500)
f68b883e8fad23 Sameer Nanda  2018-05-02  22  #define CHARGER_MANUFACTURER_MODEL_LENGTH	32
f68b883e8fad23 Sameer Nanda  2018-05-02  23  

:::::: The code at line 15 was first introduced by commit
:::::: 3af15cfacd1eef7f223802d49a88cae23c509183 power: supply: cros: add support for dedicated port

:::::: TO: Fabien Parent <fparent@baylibre.com>
:::::: CC: Sebastian Reichel <sre@kernel.org>

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

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

* drivers/power/supply/cros_usbpd-charger.c:15:49: warning: '%d' directive writing between 1 and 11 bytes into a region of size 5
@ 2024-12-03 11:57 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-12-03 11:57 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: oe-kbuild-all, linux-kernel, Lee Jones, Gwendal Grignou

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   cdd30ebb1b9f36159d66f088b61aee264e649d7a
commit: 47f11e0b40e97f373da4efbacee0a9526c816ed5 mfd / platform: cros_ec: Move cros-ec core driver out from MFD
date:   5 years ago
config: arm64-randconfig-004-20240106 (https://download.01.org/0day-ci/archive/20241203/202412031910.gddwrzU5-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241203/202412031910.gddwrzU5-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/202412031910.gddwrzU5-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/power/supply/cros_usbpd-charger.c: In function 'cros_usbpd_charger_probe':
>> drivers/power/supply/cros_usbpd-charger.c:15:49: warning: '%d' directive writing between 1 and 11 bytes into a region of size 5 [-Wformat-overflow=]
      15 | #define CHARGER_USBPD_DIR_NAME                  "CROS_USBPD_CHARGER%d"
         |                                                 ^~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/cros_usbpd-charger.c:656:45: note: in expansion of macro 'CHARGER_USBPD_DIR_NAME'
     656 |                         sprintf(port->name, CHARGER_USBPD_DIR_NAME, i);
         |                                             ^~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/cros_usbpd-charger.c:15:68: note: format string is defined here
      15 | #define CHARGER_USBPD_DIR_NAME                  "CROS_USBPD_CHARGER%d"
         |                                                                    ^~
   drivers/power/supply/cros_usbpd-charger.c:15:49: note: directive argument in the range [-2147483641, 2147483646]
      15 | #define CHARGER_USBPD_DIR_NAME                  "CROS_USBPD_CHARGER%d"
         |                                                 ^~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/cros_usbpd-charger.c:656:45: note: in expansion of macro 'CHARGER_USBPD_DIR_NAME'
     656 |                         sprintf(port->name, CHARGER_USBPD_DIR_NAME, i);
         |                                             ^~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/cros_usbpd-charger.c:656:25: note: 'sprintf' output between 20 and 30 bytes into a destination of size 23
     656 |                         sprintf(port->name, CHARGER_USBPD_DIR_NAME, i);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +15 drivers/power/supply/cros_usbpd-charger.c

f68b883e8fad23 Sameer Nanda  2018-05-02  14  
3af15cfacd1eef Fabien Parent 2018-08-10 @15  #define CHARGER_USBPD_DIR_NAME			"CROS_USBPD_CHARGER%d"
3af15cfacd1eef Fabien Parent 2018-08-10  16  #define CHARGER_DEDICATED_DIR_NAME		"CROS_DEDICATED_CHARGER"
3af15cfacd1eef Fabien Parent 2018-08-10  17  #define CHARGER_DIR_NAME_LENGTH		(sizeof(CHARGER_USBPD_DIR_NAME) >= \
3af15cfacd1eef Fabien Parent 2018-08-10  18  					 sizeof(CHARGER_DEDICATED_DIR_NAME) ? \
3af15cfacd1eef Fabien Parent 2018-08-10  19  					 sizeof(CHARGER_USBPD_DIR_NAME) : \
3af15cfacd1eef Fabien Parent 2018-08-10  20  					 sizeof(CHARGER_DEDICATED_DIR_NAME))
f68b883e8fad23 Sameer Nanda  2018-05-02  21  #define CHARGER_CACHE_UPDATE_DELAY		msecs_to_jiffies(500)
f68b883e8fad23 Sameer Nanda  2018-05-02  22  #define CHARGER_MANUFACTURER_MODEL_LENGTH	32
f68b883e8fad23 Sameer Nanda  2018-05-02  23  

:::::: The code at line 15 was first introduced by commit
:::::: 3af15cfacd1eef7f223802d49a88cae23c509183 power: supply: cros: add support for dedicated port

:::::: TO: Fabien Parent <fparent@baylibre.com>
:::::: CC: Sebastian Reichel <sre@kernel.org>

-- 
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-07 20:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-07 20:10 drivers/power/supply/cros_usbpd-charger.c:15:49: warning: '%d' directive writing between 1 and 11 bytes into a region of size 5 kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2024-12-03 11:57 kernel test robot

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

all inboxes | Powered by JetHome®