Hi John,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on tty/tty-testing]
[also build test WARNING on linus/master v5.9-rc1 next-20200819]
[cannot apply to tip/locking/core linux/master wq/for-next pmladek/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/John-Ogness/printk-new-log_cont-...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: x86_64-randconfig-a013-20200818 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
kernel/printk/printk.c: In function 'pr_cont_begin':
> kernel/printk/printk.c:3497:3: warning: function
'pr_cont_begin' might be a candidate for 'gnu_printf' format attribute
[-Wsuggest-attribute=format]
3497 | text_len = vprintk(fmt, args);
| ^~~~~~~~
kernel/printk/printk.c:3505:2: warning: function 'pr_cont_begin' might be a
candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
3505 | c->text_len = vscnprintf(text, CONT_LINE_MAX, fmt, args);
| ^
kernel/printk/printk.c: In function 'pr_cont_append':
> kernel/printk/printk.c:3561:3: warning: function
'pr_cont_append' might be a candidate for 'gnu_printf' format attribute
[-Wsuggest-attribute=format]
3561 | text_len = vprintk(fmt, args);
| ^~~~~~~~
kernel/printk/printk.c:3571:2: warning: function 'pr_cont_append' might be a
candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
3571 | text_len = vsnprintf(text + c->text_len, CONT_LINE_MAX - c->text_len,
fmt, args);
| ^~~~~~~~
kernel/printk/printk.c:3585:3: warning: function 'pr_cont_append' might be a
candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
3585 | c->text_len = vscnprintf(text, CONT_LINE_MAX, fmt, args_copy);
| ^
#
https://github.com/0day-ci/linux/commit/2b9bfd8702672aa1b375a495f3286a277...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
John-Ogness/printk-new-log_cont-implementation/20200820-072853
git checkout 2b9bfd8702672aa1b375a495f3286a277ebf7736
vim +3497 kernel/printk/printk.c
3483
3484 /* alloc buffer, get loglevel, setup initial text */
3485 int pr_cont_begin(pr_cont_t *c, const char *fmt, ...)
3486 {
3487 int kern_level;
3488 va_list args;
3489 char *text;
3490
3491 c->index = get_cont_buf();
3492 if (c->index == CONT_BUF_COUNT) {
3493 /* Fallback to printk parts individually. */
3494 int text_len;
3495
3496 va_start(args, fmt);
3497 text_len = vprintk(fmt, args);
3498 va_end(args);
3499 return text_len;
3500 }
3501
3502 text = &cont_buf[c->index][0];
3503
3504 va_start(args, fmt);
3505 c->text_len = vscnprintf(text, CONT_LINE_MAX, fmt, args);
3506 va_end(args);
3507
3508 c->loglevel = default_message_loglevel;
3509 while (c->text_len > 1 &&
3510 (kern_level = printk_get_level(text)) != 0) {
3511 switch (kern_level) {
3512 case '0' ... '7':
3513 c->loglevel = kern_level - '0';
3514 break;
3515 }
3516
3517 c->text_len -= 2;
3518 memmove(text, text + 2, c->text_len);
3519 }
3520
3521 return c->text_len;
3522 }
3523
3524 /* printk existing buffer, reset buffer */
3525 void pr_cont_flush(pr_cont_t *c)
3526 {
3527 char *text;
3528
3529 if (c->index == CONT_BUF_COUNT || !c->text_len)
3530 return;
3531
3532 text = &cont_buf[c->index][0];
3533
3534 printk("%c%c%s\n", KERN_SOH_ASCII, c->loglevel + '0', text);
3535
3536 c->text_len = 0;
3537 }
3538
3539 /* printk existing buffer, free buffer */
3540 void pr_cont_end(pr_cont_t *c)
3541 {
3542 if (c->index == CONT_BUF_COUNT)
3543 return;
3544
3545 pr_cont_flush(c);
3546 put_cont_buf(c->index);
3547 c->index = CONT_BUF_COUNT;
3548 }
3549
3550 /* append to buffer */
3551 int pr_cont_append(pr_cont_t *c, const char *fmt, ...)
3552 {
3553 va_list args_copy;
3554 va_list args;
3555 int text_len;
3556 char *text;
3557
3558 if (c->index == CONT_BUF_COUNT) {
3559 /* Fallback to printk parts individually. */
3560 va_start(args, fmt);
3561 text_len = vprintk(fmt, args);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org