* [linux-rt-devel:linux-5.10.y-rt-rebase 76/252] kernel/printk/printk.c:1899:2: warning: function 'printk_sprint' might be a candidate for 'gnu_printf' format attribute
@ 2020-11-30 19:47 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-11-30 19:47 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2455 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.10.y-rt-rebase
head: f0e8c5cc07c1ff61f3e3f0cdc67ebbaba3efba35
commit: 2f0edafd96943679520f78dce1407be69dd636c8 [76/252] printk: remove logbuf_lock, add syslog_lock
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.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/rt/linux-rt-devel.git/commit/?id=2f0edafd96943679520f78dce1407be69dd636c8
git remote add linux-rt-devel https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
git fetch --no-tags linux-rt-devel linux-5.10.y-rt-rebase
git checkout 2f0edafd96943679520f78dce1407be69dd636c8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa
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:1899:2: warning: function 'printk_sprint' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
1899 | text_len = vscnprintf(text, size, fmt, args);
| ^~~~~~~~
vim +1899 kernel/printk/printk.c
1892
1893 static u16 printk_sprint(char *text, u16 size, int facility, enum log_flags *lflags,
1894 const char *fmt, va_list args)
1895 {
1896 char *orig_text = text;
1897 u16 text_len;
1898
> 1899 text_len = vscnprintf(text, size, fmt, args);
1900
1901 /* Mark and strip a trailing newline. */
1902 if (text_len && text[text_len - 1] == '\n') {
1903 text_len--;
1904 *lflags |= LOG_NEWLINE;
1905 }
1906
1907 /* Strip kernel syslog prefix. */
1908 if (facility == 0) {
1909 while (text_len >= 2 && printk_get_level(text)) {
1910 text_len -= 2;
1911 text += 2;
1912 }
1913
1914 if (text != orig_text)
1915 memmove(orig_text, text, text_len);
1916 }
1917
1918 return text_len;
1919 }
1920
---
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: 66241 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-11-30 19:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-30 19:47 [linux-rt-devel:linux-5.10.y-rt-rebase 76/252] kernel/printk/printk.c:1899:2: warning: function 'printk_sprint' might be a candidate for 'gnu_printf' format attribute 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.