diff mbox

[v3,6/7] Mark a few functions with the printf attribute

Message ID 20160726224234.c680b28a327365604664cb2b@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Emese Revfy July 26, 2016, 8:42 p.m. UTC
This allows not only compile time format string checking but can also
increase the coverage of the initify plugin.

Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
 drivers/scsi/esas2r/esas2r_log.h | 4 ++--
 include/acpi/acpiosxf.h          | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

kernel test robot July 27, 2016, 1:17 a.m. UTC | #1
Hi,

[auto build test WARNING on next-20160726]
[cannot apply to stable/master linus/master linux/master v4.7-rc7 v4.7-rc6 v4.7-rc5 v4.7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Emese-Revfy/Introduce-the-initify-gcc-plugin/20160727-084514
config: x86_64-randconfig-s1-07270838 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers/acpi/acpica/utdebug.c: In function 'acpi_debug_print':
>> drivers/acpi/acpica/utdebug.c:192: warning: format '%04ld' expects type 'long int', but argument 3 has type 'u32'
--
   drivers/acpi/acpica/dbhistry.c: In function 'acpi_db_display_history':
>> drivers/acpi/acpica/dbhistry.c:162: warning: format '%3ld' expects type 'long int', but argument 2 has type 'u32'
--
   drivers/acpi/acpica/dbinput.c: In function 'acpi_db_get_line':
>> drivers/acpi/acpica/dbinput.c:610: warning: format '%u' expects type 'unsigned int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbinput.c: In function 'acpi_db_command_dispatch':
>> drivers/acpi/acpica/dbinput.c:866: warning: format '%8.8lX' expects type 'long unsigned int', but argument 2 has type 'u32'
   drivers/acpi/acpica/dbinput.c:869: warning: format '%8.8lX' expects type 'long unsigned int', but argument 2 has type 'u32'
   drivers/acpi/acpica/dbinput.c:876: warning: format '%8.8lX' expects type 'long unsigned int', but argument 2 has type 'u32'
   drivers/acpi/acpica/dbinput.c:876: warning: format '%8.8lX' expects type 'long unsigned int', but argument 3 has type 'u32'
   drivers/acpi/acpica/dbinput.c:883: warning: format '%8.8lX' expects type 'long unsigned int', but argument 2 has type 'u32'
   drivers/acpi/acpica/dbinput.c:883: warning: format '%8.8lX' expects type 'long unsigned int', but argument 3 has type 'u32'
--
   drivers/acpi/acpica/dbstats.c: In function 'acpi_db_display_statistics':
>> drivers/acpi/acpica/dbstats.c:383: warning: format '% 10ld' expects type 'long int', but argument 3 has type 'int'
   drivers/acpi/acpica/dbstats.c:383: warning: format '% 10ld' expects type 'long int', but argument 4 has type 'int'
   drivers/acpi/acpica/dbstats.c:388: warning: format '% 10ld' expects type 'long int', but argument 3 has type 'int'
   drivers/acpi/acpica/dbstats.c:388: warning: format '% 10ld' expects type 'long int', but argument 4 has type 'int'
>> drivers/acpi/acpica/dbstats.c:391: warning: format '% 10ld' expects type 'long int', but argument 3 has type 'u32'
   drivers/acpi/acpica/dbstats.c:391: warning: format '% 10ld' expects type 'long int', but argument 4 has type 'u32'
>> drivers/acpi/acpica/dbstats.c:419: warning: format '% 7ld' expects type 'long int', but argument 2 has type 'u32'
   drivers/acpi/acpica/dbstats.c:421: warning: format '% 7ld' expects type 'long int', but argument 2 has type 'u32'
   drivers/acpi/acpica/dbstats.c:429: warning: format '% 7ld' expects type 'long int', but argument 3 has type 'u32'
>> drivers/acpi/acpica/dbstats.c:438: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:440: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:442: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:444: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:446: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:448: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:450: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:452: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:454: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:456: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:458: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:460: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:462: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:464: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:466: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:468: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:470: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:472: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:474: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:476: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:478: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:480: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:485: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:487: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:489: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:491: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:493: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:495: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:500: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:502: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:504: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:506: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:508: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:510: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:512: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:514: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:516: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'
   drivers/acpi/acpica/dbstats.c:518: warning: format '%3d' expects type 'int', but argument 2 has type 'long unsigned int'

vim +192 drivers/acpi/acpica/utdebug.c

^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  176  	thread_id = acpi_os_get_thread_id();
0dfaaa3d drivers/acpi/acpica/utdebug.c    Bob Moore      2016-03-24  177  	if (thread_id != acpi_gbl_previous_thread_id) {
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  178  		if (ACPI_LV_THREADS & acpi_dbg_level) {
4be44fcd drivers/acpi/utilities/utdebug.c Len Brown      2005-08-05  179  			acpi_os_printf
28eb3fcf drivers/acpi/acpica/utdebug.c    Lin Ming       2010-09-15  180  			    ("\n**** Context Switch from TID %u to TID %u ****\n\n",
0dfaaa3d drivers/acpi/acpica/utdebug.c    Bob Moore      2016-03-24  181  			     (u32)acpi_gbl_previous_thread_id, (u32)thread_id);
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  182  		}
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  183  
0dfaaa3d drivers/acpi/acpica/utdebug.c    Bob Moore      2016-03-24  184  		acpi_gbl_previous_thread_id = thread_id;
bf9b448e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-11-21  185  		acpi_gbl_nesting_level = 0;
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  186  	}
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  187  
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  188  	/*
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  189  	 * Display the module name, current line number, thread ID (if requested),
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  190  	 * current procedure nesting level, and the current procedure name
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  191  	 */
2856846e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-09-23 @192  	acpi_os_printf("%9s-%04ld ", module_name, line_number);
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  193  
5076f005 drivers/acpi/acpica/utdebug.c    Bob Moore      2014-01-08  194  #ifdef ACPI_APPLICATION
bf9b448e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-11-21  195  	/*
5076f005 drivers/acpi/acpica/utdebug.c    Bob Moore      2014-01-08  196  	 * For acpi_exec/iASL only, emit the thread ID and nesting level.
bf9b448e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-11-21  197  	 * Note: nesting level is really only useful during a single-thread
bf9b448e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-11-21  198  	 * execution. Otherwise, multiple threads will keep resetting the
bf9b448e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-11-21  199  	 * level.
bf9b448e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-11-21  200  	 */

:::::: The code at line 192 was first introduced by commit
:::::: 2856846e3a7bee02ce6b498c760376061e41aaed ACPICA: Debug output: small formatting update, no functional change.

:::::: TO: Bob Moore <robert.moore@intel.com>
:::::: CC: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot July 27, 2016, 1:23 a.m. UTC | #2
Hi,

[auto build test WARNING on next-20160726]
[cannot apply to stable/master linus/master linux/master v4.7-rc7 v4.7-rc6 v4.7-rc5 v4.7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Emese-Revfy/Introduce-the-initify-gcc-plugin/20160727-084514
config: x86_64-randconfig-s0-07270838 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers/scsi/esas2r/esas2r_init.c: In function 'esas2r_claim_interrupts':
>> drivers/scsi/esas2r/esas2r_init.c:241: warning: format '%x' expects type 'unsigned int', but argument 6 has type 'long unsigned int'
--
   drivers/scsi/esas2r/esas2r_ioctl.c: In function 'esas2r_ioctl_handler':
>> drivers/scsi/esas2r/esas2r_ioctl.c:1305: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
--
   drivers/scsi/esas2r/esas2r_main.c: In function 'write_hw':
>> drivers/scsi/esas2r/esas2r_main.c:202: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
   drivers/scsi/esas2r/esas2r_main.c: In function 'esas2r_dev_targ_reset':
>> drivers/scsi/esas2r/esas2r_main.c:1191: warning: format '%d' expects type 'int', but argument 4 has type 'u64'

vim +241 drivers/scsi/esas2r/esas2r_init.c

26780d9e Bradley Grove      2013-08-23  225  			   "unknown interrupt_mode %d requested, "
26780d9e Bradley Grove      2013-08-23  226  			   "falling back to legacy interrupt",
26780d9e Bradley Grove      2013-08-23  227  			   interrupt_mode);
26780d9e Bradley Grove      2013-08-23  228  		goto use_legacy_interrupts;
26780d9e Bradley Grove      2013-08-23  229  	}
26780d9e Bradley Grove      2013-08-23  230  }
26780d9e Bradley Grove      2013-08-23  231  
26780d9e Bradley Grove      2013-08-23  232  static void esas2r_claim_interrupts(struct esas2r_adapter *a)
26780d9e Bradley Grove      2013-08-23  233  {
4909cc2b Michael Opdenacker 2014-03-05  234  	unsigned long flags = 0;
26780d9e Bradley Grove      2013-08-23  235  
26780d9e Bradley Grove      2013-08-23  236  	if (a->intr_mode == INTR_MODE_LEGACY)
26780d9e Bradley Grove      2013-08-23  237  		flags |= IRQF_SHARED;
26780d9e Bradley Grove      2013-08-23  238  
26780d9e Bradley Grove      2013-08-23  239  	esas2r_log(ESAS2R_LOG_INFO,
26780d9e Bradley Grove      2013-08-23  240  		   "esas2r_claim_interrupts irq=%d (%p, %s, %x)",
26780d9e Bradley Grove      2013-08-23 @241  		   a->pcid->irq, a, a->name, flags);
26780d9e Bradley Grove      2013-08-23  242  
26780d9e Bradley Grove      2013-08-23  243  	if (request_irq(a->pcid->irq,
26780d9e Bradley Grove      2013-08-23  244  			(a->intr_mode ==
26780d9e Bradley Grove      2013-08-23  245  			 INTR_MODE_LEGACY) ? esas2r_interrupt :
26780d9e Bradley Grove      2013-08-23  246  			esas2r_msi_interrupt,
26780d9e Bradley Grove      2013-08-23  247  			flags,
26780d9e Bradley Grove      2013-08-23  248  			a->name,
26780d9e Bradley Grove      2013-08-23  249  			a)) {

:::::: The code at line 241 was first introduced by commit
:::::: 26780d9e12edf45c0b98315de272b1feff5a8e93 [SCSI] esas2r: ATTO Technology ExpressSAS 6G SAS/SATA RAID Adapter Driver

:::::: TO: Bradley Grove <bgrove@attotech.com>
:::::: CC: James Bottomley <JBottomley@Parallels.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot July 27, 2016, 1:29 a.m. UTC | #3
Hi,

[auto build test WARNING on next-20160726]
[cannot apply to stable/master linus/master linux/master v4.7-rc7 v4.7-rc6 v4.7-rc5 v4.7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Emese-Revfy/Introduce-the-initify-gcc-plugin/20160727-084514
config: x86_64-randconfig-s3-07270832 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers/acpi/acpica/utdebug.c: In function 'acpi_debug_print':
>> drivers/acpi/acpica/utdebug.c:192:26: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'u32 {aka unsigned int}' [-Wformat=]
     acpi_os_printf("%9s-%04ld ", module_name, line_number);
                             ^
--
   drivers/acpi/acpica/dbhistry.c: In function 'acpi_db_display_history':
>> drivers/acpi/acpica/dbhistry.c:158:23: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'u32 {aka unsigned int}' [-Wformat=]
       acpi_os_printf("%3ld %s\n",
                          ^
--
   drivers/acpi/acpica/dbinput.c: In function 'acpi_db_get_line':
>> drivers/acpi/acpica/dbinput.c:609:56: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat=]
          ("Buffer overflow while parsing input line (max %u characters)\n",
                                                           ^
   drivers/acpi/acpica/dbinput.c: In function 'acpi_db_command_dispatch':
>> drivers/acpi/acpica/dbinput.c:865:58: warning: format '%lX' expects argument of type 'long unsigned int', but argument 2 has type 'u32 {aka unsigned int}' [-Wformat=]
           ("Current debug level for file output is:    %8.8lX\n",
                                                             ^
   drivers/acpi/acpica/dbinput.c:868:58: warning: format '%lX' expects argument of type 'long unsigned int', but argument 2 has type 'u32 {aka unsigned int}' [-Wformat=]
           ("Current debug level for console output is: %8.8lX\n",
                                                             ^
   drivers/acpi/acpica/dbinput.c:875:50: warning: format '%lX' expects argument of type 'long unsigned int', but argument 2 has type 'u32 {aka unsigned int}' [-Wformat=]
           ("Debug Level for console output was %8.8lX, now %8.8lX\n",
                                                     ^
   drivers/acpi/acpica/dbinput.c:875:62: warning: format '%lX' expects argument of type 'long unsigned int', but argument 3 has type 'u32 {aka unsigned int}' [-Wformat=]
           ("Debug Level for console output was %8.8lX, now %8.8lX\n",
                                                                 ^
   drivers/acpi/acpica/dbinput.c:882:47: warning: format '%lX' expects argument of type 'long unsigned int', but argument 2 has type 'u32 {aka unsigned int}' [-Wformat=]
           ("Debug Level for file output was %8.8lX, now %8.8lX\n",
                                                  ^
   drivers/acpi/acpica/dbinput.c:882:59: warning: format '%lX' expects argument of type 'long unsigned int', but argument 3 has type 'u32 {aka unsigned int}' [-Wformat=]
           ("Debug Level for file output was %8.8lX, now %8.8lX\n",
                                                              ^
--
   drivers/acpi/acpica/dbstats.c: In function 'acpi_db_display_statistics':
>> drivers/acpi/acpica/dbstats.c:380:33: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat=]
       acpi_os_printf("%16.16s % 10ld% 10ld\n",
                                    ^
   drivers/acpi/acpica/dbstats.c:380:39: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Wformat=]
       acpi_os_printf("%16.16s % 10ld% 10ld\n",
                                          ^
   drivers/acpi/acpica/dbstats.c:386:32: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat=]
      acpi_os_printf("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
                                   ^
   drivers/acpi/acpica/dbstats.c:386:38: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Wformat=]
      acpi_os_printf("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
                                         ^
>> drivers/acpi/acpica/dbstats.c:390:32: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'u32 {aka unsigned int}' [-Wformat=]
      acpi_os_printf("%16.16s % 10ld% 10ld\n", "TOTALS:",
                                   ^
   drivers/acpi/acpica/dbstats.c:390:38: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'u32 {aka unsigned int}' [-Wformat=]
      acpi_os_printf("%16.16s % 10ld% 10ld\n", "TOTALS:",
                                         ^
   drivers/acpi/acpica/dbstats.c:418:54: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'u32 {aka unsigned int}' [-Wformat=]
      acpi_os_printf("Calls to AcpiPsFind:.. ........% 7ld\n",
                                                         ^
   drivers/acpi/acpica/dbstats.c:420:55: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'u32 {aka unsigned int}' [-Wformat=]
      acpi_os_printf("Calls to AcpiNsLookup:..........% 7ld\n",
                                                          ^
   drivers/acpi/acpica/dbstats.c:427:35: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'u32 {aka unsigned int}' [-Wformat=]
       acpi_os_printf("%-28s:     % 7ld\n",
                                      ^
>> drivers/acpi/acpica/dbstats.c:437:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Common         %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:439:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Number         %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:441:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("String         %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:443:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Buffer         %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:445:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Package        %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:447:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("BufferField    %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:449:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Device         %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:451:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Event          %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:453:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Method         %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:455:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Mutex          %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:457:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Region         %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:459:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("PowerResource  %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:461:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Processor      %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:463:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("ThermalZone    %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:465:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("RegionField    %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:467:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("BankField      %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:469:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("IndexField     %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:471:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Reference      %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:473:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Notify         %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:475:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("AddressSpace   %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:477:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Extra          %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:479:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Data           %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:484:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("ParseObject    %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:486:38: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("ParseObjectNamed %3d\n",
                                         ^
   drivers/acpi/acpica/dbstats.c:488:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("ParseObjectAsl %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:490:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("OperandObject  %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:492:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("NamespaceNode  %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:494:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("AcpiObject     %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:499:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Generic State  %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:501:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Common State   %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:503:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Control State  %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:505:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Update State   %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:507:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Scope State    %3d\n",
                                       ^
   drivers/acpi/acpica/dbstats.c:509:36: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      acpi_os_printf("Parse Scope    %3d\n",

vim +192 drivers/acpi/acpica/utdebug.c

^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  176  	thread_id = acpi_os_get_thread_id();
0dfaaa3d drivers/acpi/acpica/utdebug.c    Bob Moore      2016-03-24  177  	if (thread_id != acpi_gbl_previous_thread_id) {
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  178  		if (ACPI_LV_THREADS & acpi_dbg_level) {
4be44fcd drivers/acpi/utilities/utdebug.c Len Brown      2005-08-05  179  			acpi_os_printf
28eb3fcf drivers/acpi/acpica/utdebug.c    Lin Ming       2010-09-15  180  			    ("\n**** Context Switch from TID %u to TID %u ****\n\n",
0dfaaa3d drivers/acpi/acpica/utdebug.c    Bob Moore      2016-03-24  181  			     (u32)acpi_gbl_previous_thread_id, (u32)thread_id);
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  182  		}
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  183  
0dfaaa3d drivers/acpi/acpica/utdebug.c    Bob Moore      2016-03-24  184  		acpi_gbl_previous_thread_id = thread_id;
bf9b448e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-11-21  185  		acpi_gbl_nesting_level = 0;
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  186  	}
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  187  
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  188  	/*
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  189  	 * Display the module name, current line number, thread ID (if requested),
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  190  	 * current procedure nesting level, and the current procedure name
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  191  	 */
2856846e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-09-23 @192  	acpi_os_printf("%9s-%04ld ", module_name, line_number);
^1da177e drivers/acpi/utilities/utdebug.c Linus Torvalds 2005-04-16  193  
5076f005 drivers/acpi/acpica/utdebug.c    Bob Moore      2014-01-08  194  #ifdef ACPI_APPLICATION
bf9b448e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-11-21  195  	/*
5076f005 drivers/acpi/acpica/utdebug.c    Bob Moore      2014-01-08  196  	 * For acpi_exec/iASL only, emit the thread ID and nesting level.
bf9b448e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-11-21  197  	 * Note: nesting level is really only useful during a single-thread
bf9b448e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-11-21  198  	 * execution. Otherwise, multiple threads will keep resetting the
bf9b448e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-11-21  199  	 * level.
bf9b448e drivers/acpi/acpica/utdebug.c    Bob Moore      2013-11-21  200  	 */

:::::: The code at line 192 was first introduced by commit
:::::: 2856846e3a7bee02ce6b498c760376061e41aaed ACPICA: Debug output: small formatting update, no functional change.

:::::: TO: Bob Moore <robert.moore@intel.com>
:::::: CC: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/scsi/esas2r/esas2r_log.h b/drivers/scsi/esas2r/esas2r_log.h
index 7b6397b..75b9d23 100644
--- a/drivers/scsi/esas2r/esas2r_log.h
+++ b/drivers/scsi/esas2r/esas2r_log.h
@@ -61,8 +61,8 @@  enum {
 #endif
 };
 
-int esas2r_log(const long level, const char *format, ...);
-int esas2r_log_dev(const long level,
+__printf(2, 3) int esas2r_log(const long level, const char *format, ...);
+__printf(3, 4) int esas2r_log_dev(const long level,
 		   const struct device *dev,
 		   const char *format,
 		   ...);
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 562603d..7ee4475 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -337,11 +337,12 @@  acpi_status acpi_os_signal(u32 function, void *info);
  * Debug print routines
  */
 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_printf
+__printf(1, 2)
 void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...);
 #endif
 
 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_vprintf
-void acpi_os_vprintf(const char *format, va_list args);
+__printf(1, 0) void acpi_os_vprintf(const char *format, va_list args);
 #endif
 
 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_redirect_output