All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: kernel/printk/printk.c:1913:9: warning: function 'printk_sprint' might be a candidate for 'gnu_printf' format attribute
Date: Mon, 27 Sep 2021 21:28:54 +0800	[thread overview]
Message-ID: <YVHHFor0JuGIab7m@rli9-dbox> (raw)

[-- Attachment #1: Type: text/plain, Size: 3565 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   92477dd1faa650e50bd3bb35a6c0b8d09198cc35
commit: b031a684bfd01d633c79d281bd0cf11c2f834ada printk: remove logbuf_lock writer-protection of ringbuffer
date:   10 months ago
:::::: branch date: 6 days ago
:::::: commit date: 10 months ago
config: mips-randconfig-r012-20210927 (attached as .config)
compiler: mips-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b031a684bfd01d633c79d281bd0cf11c2f834ada
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b031a684bfd01d633c79d281bd0cf11c2f834ada
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   kernel/printk/printk.c: In function 'printk_sprint':
>> kernel/printk/printk.c:1913:9: warning: function 'printk_sprint' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
    1913 |         text_len = vscnprintf(text, size, fmt, args);
         |         ^~~~~~~~


vim +1913 kernel/printk/printk.c

b031a684bfd01d John Ogness 2020-12-09  1907  
b031a684bfd01d John Ogness 2020-12-09  1908  static u16 printk_sprint(char *text, u16 size, int facility, enum log_flags *lflags,
b031a684bfd01d John Ogness 2020-12-09  1909  			 const char *fmt, va_list args)
b031a684bfd01d John Ogness 2020-12-09  1910  {
b031a684bfd01d John Ogness 2020-12-09  1911  	u16 text_len;
b031a684bfd01d John Ogness 2020-12-09  1912  
b031a684bfd01d John Ogness 2020-12-09 @1913  	text_len = vscnprintf(text, size, fmt, args);
b031a684bfd01d John Ogness 2020-12-09  1914  
b031a684bfd01d John Ogness 2020-12-09  1915  	/* Mark and strip a trailing newline. */
b031a684bfd01d John Ogness 2020-12-09  1916  	if (text_len && text[text_len - 1] == '\n') {
b031a684bfd01d John Ogness 2020-12-09  1917  		text_len--;
b031a684bfd01d John Ogness 2020-12-09  1918  		*lflags |= LOG_NEWLINE;
b031a684bfd01d John Ogness 2020-12-09  1919  	}
b031a684bfd01d John Ogness 2020-12-09  1920  
b031a684bfd01d John Ogness 2020-12-09  1921  	/* Strip log level and control flags. */
b031a684bfd01d John Ogness 2020-12-09  1922  	if (facility == 0) {
b031a684bfd01d John Ogness 2020-12-09  1923  		u16 prefix_len;
b031a684bfd01d John Ogness 2020-12-09  1924  
b031a684bfd01d John Ogness 2020-12-09  1925  		prefix_len = parse_prefix(text, NULL, NULL);
b031a684bfd01d John Ogness 2020-12-09  1926  		if (prefix_len) {
b031a684bfd01d John Ogness 2020-12-09  1927  			text_len -= prefix_len;
b031a684bfd01d John Ogness 2020-12-09  1928  			memmove(text, text + prefix_len, text_len);
b031a684bfd01d John Ogness 2020-12-09  1929  		}
b031a684bfd01d John Ogness 2020-12-09  1930  	}
b031a684bfd01d John Ogness 2020-12-09  1931  
b031a684bfd01d John Ogness 2020-12-09  1932  	return text_len;
b031a684bfd01d John Ogness 2020-12-09  1933  }
b031a684bfd01d John Ogness 2020-12-09  1934  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28516 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: kernel/printk/printk.c:1913:9: warning: function 'printk_sprint' might be a candidate for 'gnu_printf' format attribute
Date: Mon, 27 Sep 2021 21:28:54 +0800	[thread overview]
Message-ID: <YVHHFor0JuGIab7m@rli9-dbox> (raw)

[-- Attachment #1: Type: text/plain, Size: 3500 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   92477dd1faa650e50bd3bb35a6c0b8d09198cc35
commit: b031a684bfd01d633c79d281bd0cf11c2f834ada printk: remove logbuf_lock writer-protection of ringbuffer
date:   10 months ago
:::::: branch date: 6 days ago
:::::: commit date: 10 months ago
config: mips-randconfig-r012-20210927 (attached as .config)
compiler: mips-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b031a684bfd01d633c79d281bd0cf11c2f834ada
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b031a684bfd01d633c79d281bd0cf11c2f834ada
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   kernel/printk/printk.c: In function 'printk_sprint':
>> kernel/printk/printk.c:1913:9: warning: function 'printk_sprint' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
    1913 |         text_len = vscnprintf(text, size, fmt, args);
         |         ^~~~~~~~


vim +1913 kernel/printk/printk.c

b031a684bfd01d John Ogness 2020-12-09  1907  
b031a684bfd01d John Ogness 2020-12-09  1908  static u16 printk_sprint(char *text, u16 size, int facility, enum log_flags *lflags,
b031a684bfd01d John Ogness 2020-12-09  1909  			 const char *fmt, va_list args)
b031a684bfd01d John Ogness 2020-12-09  1910  {
b031a684bfd01d John Ogness 2020-12-09  1911  	u16 text_len;
b031a684bfd01d John Ogness 2020-12-09  1912  
b031a684bfd01d John Ogness 2020-12-09 @1913  	text_len = vscnprintf(text, size, fmt, args);
b031a684bfd01d John Ogness 2020-12-09  1914  
b031a684bfd01d John Ogness 2020-12-09  1915  	/* Mark and strip a trailing newline. */
b031a684bfd01d John Ogness 2020-12-09  1916  	if (text_len && text[text_len - 1] == '\n') {
b031a684bfd01d John Ogness 2020-12-09  1917  		text_len--;
b031a684bfd01d John Ogness 2020-12-09  1918  		*lflags |= LOG_NEWLINE;
b031a684bfd01d John Ogness 2020-12-09  1919  	}
b031a684bfd01d John Ogness 2020-12-09  1920  
b031a684bfd01d John Ogness 2020-12-09  1921  	/* Strip log level and control flags. */
b031a684bfd01d John Ogness 2020-12-09  1922  	if (facility == 0) {
b031a684bfd01d John Ogness 2020-12-09  1923  		u16 prefix_len;
b031a684bfd01d John Ogness 2020-12-09  1924  
b031a684bfd01d John Ogness 2020-12-09  1925  		prefix_len = parse_prefix(text, NULL, NULL);
b031a684bfd01d John Ogness 2020-12-09  1926  		if (prefix_len) {
b031a684bfd01d John Ogness 2020-12-09  1927  			text_len -= prefix_len;
b031a684bfd01d John Ogness 2020-12-09  1928  			memmove(text, text + prefix_len, text_len);
b031a684bfd01d John Ogness 2020-12-09  1929  		}
b031a684bfd01d John Ogness 2020-12-09  1930  	}
b031a684bfd01d John Ogness 2020-12-09  1931  
b031a684bfd01d John Ogness 2020-12-09  1932  	return text_len;
b031a684bfd01d John Ogness 2020-12-09  1933  }
b031a684bfd01d John Ogness 2020-12-09  1934  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28516 bytes --]

             reply	other threads:[~2021-09-27 13:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 13:28 kernel test robot [this message]
2021-09-27 13:28 ` kernel/printk/printk.c:1913:9: warning: function 'printk_sprint' might be a candidate for 'gnu_printf' format attribute kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YVHHFor0JuGIab7m@rli9-dbox \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.