BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev TO: "Jiri Slaby (SUSE)" tree: https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git devel head: 11201baa38a1999e2502e12d8c85e4fa815b8cb8 commit: 0d4210c27d7b86643f90484d081d6dded3281e89 [41/48] serial: make strlen of sysrq_toggle_seq[] a global constant :::::: branch date: 21 hours ago :::::: commit date: 21 hours ago config: x86_64-randconfig-m001 compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter New smatch warnings: drivers/tty/serial/serial_core.c:3370 uart_try_toggle_sysrq() warn: impossible condition '(++port->sysrq_seq < sysrq_toggle_seq_len) => (0-255 < 0)' Old smatch warnings: drivers/tty/serial/serial_core.c:328 uart_shutdown() error: uninitialized symbol 'flags'. drivers/tty/serial/serial_core.c:2921 iomem_base_show() warn: argument 3 to %lX specifier is cast from pointer vim +3370 drivers/tty/serial/serial_core.c 68af43173d3fce Dmitry Safonov 2020-03-02 3347 68af43173d3fce Dmitry Safonov 2020-03-02 3348 /** 68af43173d3fce Dmitry Safonov 2020-03-02 3349 * uart_try_toggle_sysrq - Enables SysRq from serial line 68af43173d3fce Dmitry Safonov 2020-03-02 3350 * @port: uart_port structure where char(s) after BREAK met 68af43173d3fce Dmitry Safonov 2020-03-02 3351 * @ch: new character in the sequence after received BREAK 68af43173d3fce Dmitry Safonov 2020-03-02 3352 * 68af43173d3fce Dmitry Safonov 2020-03-02 3353 * Enables magic SysRq when the required sequence is met on port 68af43173d3fce Dmitry Safonov 2020-03-02 3354 * (see CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE). 68af43173d3fce Dmitry Safonov 2020-03-02 3355 * 987233b342b950 Jiri Slaby 2022-07-28 3356 * Returns: %false if @ch is out of enabling sequence and should be 987233b342b950 Jiri Slaby 2022-07-28 3357 * handled some other way, %true if @ch was consumed. 68af43173d3fce Dmitry Safonov 2020-03-02 3358 */ 3feffd076f9311 Jiri Slaby (SUSE 2022-11-23 3359) bool uart_try_toggle_sysrq(struct uart_port *port, u8 ch) 68af43173d3fce Dmitry Safonov 2020-03-02 3360 { 2ce5eace42b859 Andy Shevchenko 2020-03-10 3361 if (!sysrq_toggle_seq_len) 68af43173d3fce Dmitry Safonov 2020-03-02 3362 return false; 68af43173d3fce Dmitry Safonov 2020-03-02 3363 68af43173d3fce Dmitry Safonov 2020-03-02 3364 BUILD_BUG_ON(ARRAY_SIZE(sysrq_toggle_seq) >= U8_MAX); 68af43173d3fce Dmitry Safonov 2020-03-02 3365 if (sysrq_toggle_seq[port->sysrq_seq] != ch) { 68af43173d3fce Dmitry Safonov 2020-03-02 3366 port->sysrq_seq = 0; 68af43173d3fce Dmitry Safonov 2020-03-02 3367 return false; 68af43173d3fce Dmitry Safonov 2020-03-02 3368 } 68af43173d3fce Dmitry Safonov 2020-03-02 3369 2ce5eace42b859 Andy Shevchenko 2020-03-10 @3370 if (++port->sysrq_seq < sysrq_toggle_seq_len) { 68af43173d3fce Dmitry Safonov 2020-03-02 3371 port->sysrq = jiffies + SYSRQ_TIMEOUT; 68af43173d3fce Dmitry Safonov 2020-03-02 3372 return true; 68af43173d3fce Dmitry Safonov 2020-03-02 3373 } 68af43173d3fce Dmitry Safonov 2020-03-02 3374 68af43173d3fce Dmitry Safonov 2020-03-02 3375 schedule_work(&sysrq_enable_work); 68af43173d3fce Dmitry Safonov 2020-03-02 3376 68af43173d3fce Dmitry Safonov 2020-03-02 3377 port->sysrq = 0; 68af43173d3fce Dmitry Safonov 2020-03-02 3378 return true; 68af43173d3fce Dmitry Safonov 2020-03-02 3379 } 08d5470308ac35 Johan Hovold 2020-06-10 3380 EXPORT_SYMBOL_GPL(uart_try_toggle_sysrq); 68af43173d3fce Dmitry Safonov 2020-03-02 3381 #endif 68af43173d3fce Dmitry Safonov 2020-03-02 3382 :::::: The code at line 3370 was first introduced by commit :::::: 2ce5eace42b859cabef898877b38a0429f931370 serial: core: Use string length for SysRq magic sequence :::::: TO: Andy Shevchenko :::::: CC: Greg Kroah-Hartman -- 0-DAY CI Kernel Test Service https://01.org/lkp