Hi Mao,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 98beb6bc5000f977169e4f633e450f4e3e9d84d1 commit: 1c30433d9fa5c5b48039990ba214c0e8e199a22d [1320/1320] sc16is7xx: missing unregister/delete driver on error in sc16is7xx_init() config: arm64-randconfig-003 (https://download.01.org/0day-ci/archive/20241204/202412041458.vwP2M34t-lkp@i...) compiler: aarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241204/202412041458.vwP2M34t-lkp@i...)
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/202412041458.vwP2M34t-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/tty/serial/sc16is7xx.c: In function 'sc16is7xx_init':
drivers/tty/serial/sc16is7xx.c:1501:1: warning: label 'err_i2c' defined but not used [-Wunused-label]
1501 | err_i2c: | ^~~~~~~ In file included from drivers/tty/serial/sc16is7xx.c:17: drivers/tty/serial/sc16is7xx.c: At top level: include/linux/module.h:140:14: warning: 'cleanup_module' specifies less restrictive attribute than its target 'sc16is7xx_exit': 'cold' [-Wmissing-attributes] 140 | void cleanup_module(void) __attribute__((alias(#exitfn))); | ^~~~~~~~~~~~~~ drivers/tty/serial/sc16is7xx.c:1518:1: note: in expansion of macro 'module_exit' 1518 | module_exit(sc16is7xx_exit); | ^~~~~~~~~~~ drivers/tty/serial/sc16is7xx.c:1507:20: note: 'cleanup_module' target declared here 1507 | static void __exit sc16is7xx_exit(void) | ^~~~~~~~~~~~~~ include/linux/module.h:134:13: warning: 'init_module' specifies less restrictive attribute than its target 'sc16is7xx_init': 'cold' [-Wmissing-attributes] 134 | int init_module(void) __attribute__((alias(#initfn))); | ^~~~~~~~~~~ drivers/tty/serial/sc16is7xx.c:1505:1: note: in expansion of macro 'module_init' 1505 | module_init(sc16is7xx_init); | ^~~~~~~~~~~ drivers/tty/serial/sc16is7xx.c:1470:19: note: 'init_module' target declared here 1470 | static int __init sc16is7xx_init(void) | ^~~~~~~~~~~~~~ drivers/tty/serial/sc16is7xx.c: In function 'sc16is7xx_remove.isra': drivers/tty/serial/sc16is7xx.c:1309:17: warning: array subscript i is outside array bounds of 'struct sc16is7xx_one[0]' [-Warray-bounds=] 1309 | uart_remove_one_port(&sc16is7xx_uart, &s->p[i].port); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/tty/serial/sc16is7xx.c:331:41: note: while referencing 'p' 331 | struct sc16is7xx_one p[0]; | ^ drivers/tty/serial/sc16is7xx.c:1310:31: warning: array subscript i is outside array bounds of 'struct sc16is7xx_one[0]' [-Warray-bounds=] 1310 | clear_bit(s->p[i].port.line, &sc16is7xx_lines); | ~~~~^~~ drivers/tty/serial/sc16is7xx.c:331:41: note: while referencing 'p' 331 | struct sc16is7xx_one p[0]; | ^ drivers/tty/serial/sc16is7xx.c:1309:60: warning: array subscript i is outside array bounds of 'struct sc16is7xx_one[0]' [-Warray-bounds=] 1309 | uart_remove_one_port(&sc16is7xx_uart, &s->p[i].port); | ~~~~^~~ drivers/tty/serial/sc16is7xx.c:331:41: note: while referencing 'p' 331 | struct sc16is7xx_one p[0]; | ^ In function 'sc16is7xx_port_irq', inlined from 'sc16is7xx_ist' at drivers/tty/serial/sc16is7xx.c:704:20: drivers/tty/serial/sc16is7xx.c:662:34: warning: array subscript i is outside array bounds of 'struct sc16is7xx_one[0]' [-Warray-bounds=] 662 | struct uart_port *port = &s->p[portno].port; | ^~~~~~~~~~~~~~~~~~ drivers/tty/serial/sc16is7xx.c: In function 'sc16is7xx_ist': drivers/tty/serial/sc16is7xx.c:331:41: note: while referencing 'p' 331 | struct sc16is7xx_one p[0]; | ^ In function 'sc16is7xx_port_irq', inlined from 'sc16is7xx_ist' at drivers/tty/serial/sc16is7xx.c:704:20: drivers/tty/serial/sc16is7xx.c:662:39: warning: array subscript i is outside array bounds of 'struct sc16is7xx_one[0]' [-Warray-bounds=] 662 | struct uart_port *port = &s->p[portno].port; | ~~~~^~~~~~~~ drivers/tty/serial/sc16is7xx.c: In function 'sc16is7xx_ist': drivers/tty/serial/sc16is7xx.c:331:41: note: while referencing 'p' 331 | struct sc16is7xx_one p[0]; | ^ In function 'sc16is7xx_port_irq', inlined from 'sc16is7xx_ist' at drivers/tty/serial/sc16is7xx.c:704:20: drivers/tty/serial/sc16is7xx.c:662:39: warning: array subscript i is outside array bounds of 'struct sc16is7xx_one[0]' [-Warray-bounds=] 662 | struct uart_port *port = &s->p[portno].port; | ~~~~^~~~~~~~ drivers/tty/serial/sc16is7xx.c: In function 'sc16is7xx_ist': drivers/tty/serial/sc16is7xx.c:331:41: note: while referencing 'p' 331 | struct sc16is7xx_one p[0]; | ^ In function 'sc16is7xx_port_irq', inlined from 'sc16is7xx_ist' at drivers/tty/serial/sc16is7xx.c:704:20: drivers/tty/serial/sc16is7xx.c:662:39: warning: array subscript i is outside array bounds of 'struct sc16is7xx_one[0]' [-Warray-bounds=] 662 | struct uart_port *port = &s->p[portno].port; | ~~~~^~~~~~~~ drivers/tty/serial/sc16is7xx.c: In function 'sc16is7xx_ist': drivers/tty/serial/sc16is7xx.c:331:41: note: while referencing 'p' 331 | struct sc16is7xx_one p[0]; | ^ In function 'sc16is7xx_port_irq', inlined from 'sc16is7xx_ist' at drivers/tty/serial/sc16is7xx.c:704:20: drivers/tty/serial/sc16is7xx.c:662:39: warning: array subscript i is outside array bounds of 'struct sc16is7xx_one[0]' [-Warray-bounds=] 662 | struct uart_port *port = &s->p[portno].port; | ~~~~^~~~~~~~ drivers/tty/serial/sc16is7xx.c: In function 'sc16is7xx_ist': drivers/tty/serial/sc16is7xx.c:331:41: note: while referencing 'p' 331 | struct sc16is7xx_one p[0]; | ^ drivers/tty/serial/sc16is7xx.c: In function 'sc16is7xx_probe': drivers/tty/serial/sc16is7xx.c:1223:21: warning: array subscript i is outside array bounds of 'struct sc16is7xx_one[0]' [-Warray-bounds=] 1223 | s->p[i].line = i; | ~~~~^~~ drivers/tty/serial/sc16is7xx.c:331:41: note: while referencing 'p' 331 | struct sc16is7xx_one p[0]; | ^ drivers/tty/serial/sc16is7xx.c:1225:21: warning: array subscript i is outside array bounds of 'struct sc16is7xx_one[0]' [-Warray-bounds=] 1225 | s->p[i].port.dev = dev; | ~~~~^~~ drivers/tty/serial/sc16is7xx.c:331:41: note: while referencing 'p' 331 | struct sc16is7xx_one p[0]; | ^ drivers/tty/serial/sc16is7xx.c:1226:21: warning: array subscript i is outside array bounds of 'struct sc16is7xx_one[0]' [-Warray-bounds=]
vim +/err_i2c +1501 drivers/tty/serial/sc16is7xx.c
1487 1488 #ifdef CONFIG_SERIAL_SC16IS7XX_SPI 1489 ret = spi_register_driver(&sc16is7xx_spi_uart_driver); 1490 if (ret < 0) { 1491 pr_err("failed to init sc16is7xx spi --> %d\n", ret); 1492 goto err_spi; 1493 } 1494 #endif 1495 return ret; 1496 1497 err_spi: 1498 #ifdef CONFIG_SERIAL_SC16IS7XX_I2C 1499 i2c_del_driver(&sc16is7xx_i2c_uart_driver); 1500 #endif
1501 err_i2c:
1502 uart_unregister_driver(&sc16is7xx_uart); 1503 return ret; 1504 } 1505 module_init(sc16is7xx_init); 1506