Re: [PATCH 2/2] tty: sysrq: Use printk_loud_console context on __handle_sysrq

kernel test robot
2024-10-18T04:37:07Z

Hi Marcos,

kernel test robot noticed the following build errors:

[auto build test ERROR on 1d227fcc72223cbdd34d0ce13541cbaab5e0d72f]

url: https://github.com/intel-lab-lkp/linux/commits/Marcos-Paulo-de-Souza/printk-Introduce-LOUD_CON-flag/20241017-010521
base: 1d227fcc72223cbdd34d0ce13541cbaab5e0d72f
patch link: https://lore.kernel.org/r/20241016-printk-loud-con-v1-2-065e4dad6632%40suse.com
patch subject: [PATCH 2/2] tty: sysrq: Use printk_loud_console context on __handle_sysrq
config: i386-buildonly-randconfig-001-20241018 (https://download.01.org/0day-ci/archive/20241018/202410181205.VT06PKmP-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241018/202410181205.VT06PKmP-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/202410181205.VT06PKmP-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/tty/sysrq.c:600:2: error: call to undeclared function 'printk_loud_console_enter'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
600 | printk_loud_console_enter();
| ^
>> drivers/tty/sysrq.c:610:4: error: call to undeclared function 'printk_loud_console_exit'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
610 | printk_loud_console_exit();
| ^
drivers/tty/sysrq.c:614:4: error: call to undeclared function 'printk_loud_console_exit'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
614 | printk_loud_console_exit();
| ^
drivers/tty/sysrq.c:632:3: error: call to undeclared function 'printk_loud_console_exit'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
632 | printk_loud_console_exit();
| ^
4 errors generated.

vim +/printk_loud_console_enter +600 drivers/tty/sysrq.c

582
583 void __handle_sysrq(u8 key, bool check_mask)
584 {
585 const struct sysrq_key_op *op_p;
586 int orig_suppress_printk;
587 int i;
588
589 orig_suppress_printk = suppress_printk;
590 suppress_printk = 0;
591
592 rcu_sysrq_start();
593 rcu_read_lock();
594 /*
595 * Enter in the console_loud context so that sysrq header is shown to
596 * provide the user with positive feedback. We do not simply emit this
597 * at KERN_EMERG as that would change message routing in the consumers
598 * of /proc/kmsg.
599 */
> 600 printk_loud_console_enter();
601
602 op_p = __sysrq_get_key_op(key);
603 if (op_p) {
604 /*
605 * Should we check for enabled operations (/proc/sysrq-trigger
606 * should not) and is the invoked operation enabled?
607 */
608 if (!check_mask || sysrq_on_mask(op_p->enable_mask)) {
609 pr_info("%s\n", op_p->action_msg);
> 610 printk_loud_console_exit();
611 op_p->handler(key);
612 } else {
613 pr_info("This sysrq operation is disabled.\n");
614 printk_loud_console_exit();
615 }
616 } else {
617 pr_info("HELP : ");
618 /* Only print the help msg once per handler */
619 for (i = 0; i < ARRAY_SIZE(sysrq_key_table); i++) {
620 if (sysrq_key_table[i]) {
621 int j;
622
623 for (j = 0; sysrq_key_table[i] !=
624 sysrq_key_table[j]; j++)
625 ;
626 if (j != i)
627 continue;
628 pr_cont("%s ", sysrq_key_table[i]->help_msg);
629 }
630 }
631 pr_cont("\n");
632 printk_loud_console_exit();
633 }
634 rcu_read_unlock();
635 rcu_sysrq_end();
636
637 suppress_printk = orig_suppress_printk;
638 }
639

--
0-DAY CI Kernel Test Service