All of lore.kernel.org
 help / color / mirror / Atom feed
* [bvanassche:scsi-sdev-printk 1/2] drivers/scsi/scsi_logging_test.c:36:11: warning: diagnostic behavior may be improved by adding the 'format(printf, 3, 0)' attribute to the declaration of 'test_capture_dev_printk'
@ 2026-08-18  6:55 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-08-18  6:55 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: oe-kbuild-all

tree:   https://github.com/bvanassche/linux scsi-sdev-printk
head:   a31bd03242fd8e9fc6f3b0b5f48ca64bbb6c8f4c
commit: 3046a51bbd1826503f7037dd728fa56f87b73c23 [1/2] scsi: core: Add KUnit tests for scsi_logging.c
config: arm-randconfig-r072-20260818 (https://download.01.org/0day-ci/archive/20260818/202608181453.gR1dacPX-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 844a18e753e822736c9805ab779144b647a2c186)
smatch: v0.5.0-9187-g5189e3fb
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260818/202608181453.gR1dacPX-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/202608181453.gR1dacPX-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/scsi/scsi_logging.c:467:
>> drivers/scsi/scsi_logging_test.c:36:11: warning: diagnostic behavior may be improved by adding the 'format(printf, 3, 0)' attribute to the declaration of 'test_capture_dev_printk' [-Wmissing-format-attribute]
      28 | static void test_capture_dev_printk(const char *level, const struct device *dev,
         | __attribute__((format(printf, 3, 0))) 
      29 |                                     const char *fmt, va_list args)
      30 | {
      31 |         if (captured_count < MAX_CAPTURED_LINES) {
      32 |                 captured_logs[captured_count].level = level;
      33 |                 captured_logs[captured_count].dev = dev;
      34 |                 vscnprintf(captured_logs[captured_count].msg,
      35 |                            sizeof(captured_logs[captured_count].msg), fmt,
      36 |                            args);
         |                                ^
   drivers/scsi/scsi_logging_test.c:28:13: note: 'test_capture_dev_printk' declared here
      28 | static void test_capture_dev_printk(const char *level, const struct device *dev,
         |             ^
   1 warning generated.


vim +36 drivers/scsi/scsi_logging_test.c

    27	
    28	static void test_capture_dev_printk(const char *level, const struct device *dev,
    29					    const char *fmt, va_list args)
    30	{
    31		if (captured_count < MAX_CAPTURED_LINES) {
    32			captured_logs[captured_count].level = level;
    33			captured_logs[captured_count].dev = dev;
    34			vscnprintf(captured_logs[captured_count].msg,
    35				   sizeof(captured_logs[captured_count].msg), fmt,
  > 36				   args);
    37			captured_count++;
    38		}
    39	}
    40	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-18  6:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18  6:55 [bvanassche:scsi-sdev-printk 1/2] drivers/scsi/scsi_logging_test.c:36:11: warning: diagnostic behavior may be improved by adding the 'format(printf, 3, 0)' attribute to the declaration of 'test_capture_dev_printk' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.