Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [jirislaby:devel 68/87] drivers/tty/serial/8250/8250_port.c:2127:2: error: cannot jump from switch statement to this case label
@ 2025-05-07  5:26 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-05-07  5:26 UTC (permalink / raw)
  To: Jiri Slaby (SUSE); +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git devel
head:   6c308d0b04c8c17ab39fcf6d4ed9a9033efc363f
commit: 5727d6ba3d1a5c4a4a0c0f33f5fe6f1bc3654579 [68/87] serial: 8250: use GUARDs
config: riscv-randconfig-002-20250429 (https://download.01.org/0day-ci/archive/20250507/202505071319.0FHbxPh7-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/20250507/202505071319.0FHbxPh7-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/202505071319.0FHbxPh7-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> drivers/tty/serial/8250/8250_port.c:2098:3: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
    2098 |                 guard(uart_port_lock_irqsave)(port);
         |                 ^
   include/linux/cleanup.h:338:2: note: expanded from macro 'guard'
     338 |         CLASS(_name, __UNIQUE_ID(guard))
         |         ^
   include/linux/cleanup.h:277:2: note: expanded from macro 'CLASS'
     277 |         class_##_name##_t var __cleanup(class_##_name##_destructor) =   \
         |         ^
   <scratch space>:100:1: note: expanded from here
     100 | class_uart_port_lock_irqsave_t
         | ^
>> drivers/tty/serial/8250/8250_port.c:2127:2: error: cannot jump from switch statement to this case label
    2127 |         case PORT_RSA:
         |         ^
   drivers/tty/serial/8250/8250_port.c:2098:3: note: jump bypasses initialization of variable with __attribute__((cleanup))
    2098 |                 guard(uart_port_lock_irqsave)(port);
         |                 ^
   include/linux/cleanup.h:338:15: note: expanded from macro 'guard'
     338 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:166:29: note: expanded from macro '__UNIQUE_ID'
     166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:98:1: note: expanded from here
      98 | __UNIQUE_ID_guard499
         | ^
   drivers/tty/serial/8250/8250_port.c:2109:2: error: cannot jump from switch statement to this case label
    2109 |         case PORT_DA830:
         |         ^
   drivers/tty/serial/8250/8250_port.c:2098:3: note: jump bypasses initialization of variable with __attribute__((cleanup))
    2098 |                 guard(uart_port_lock_irqsave)(port);
         |                 ^
   include/linux/cleanup.h:338:15: note: expanded from macro 'guard'
     338 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:166:29: note: expanded from macro '__UNIQUE_ID'
     166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:98:1: note: expanded from here
      98 | __UNIQUE_ID_guard499
         | ^
   1 warning and 2 errors generated.


vim +2127 drivers/tty/serial/8250/8250_port.c

b6830f6df8914fa Peter Hurley      2015-06-27  2086  
8706f4b8fda1175 Jiri Slaby (SUSE  2025-04-28  2087) static void serial8250_startup_special(struct uart_port *port)
b6830f6df8914fa Peter Hurley      2015-06-27  2088  {
b6830f6df8914fa Peter Hurley      2015-06-27  2089  	struct uart_8250_port *up = up_to_u8250p(port);
b6830f6df8914fa Peter Hurley      2015-06-27  2090  
8706f4b8fda1175 Jiri Slaby (SUSE  2025-04-28  2091) 	switch (port->type) {
8706f4b8fda1175 Jiri Slaby (SUSE  2025-04-28  2092) 	case PORT_16C950:
b1207d86169d165 John Ogness       2023-05-25  2093  		/*
b1207d86169d165 John Ogness       2023-05-25  2094  		 * Wake up and initialize UART
b1207d86169d165 John Ogness       2023-05-25  2095  		 *
b1207d86169d165 John Ogness       2023-05-25  2096  		 * Synchronize UART_IER access against the console.
b1207d86169d165 John Ogness       2023-05-25  2097  		 */
5727d6ba3d1a5c4 Jiri Slaby (SUSE  2025-04-14 @2098) 		guard(uart_port_lock_irqsave)(port);
b6830f6df8914fa Peter Hurley      2015-06-27  2099  		up->acr = 0;
b6830f6df8914fa Peter Hurley      2015-06-27  2100  		serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B);
b6830f6df8914fa Peter Hurley      2015-06-27  2101  		serial_port_out(port, UART_EFR, UART_EFR_ECB);
b6830f6df8914fa Peter Hurley      2015-06-27  2102  		serial_port_out(port, UART_IER, 0);
b6830f6df8914fa Peter Hurley      2015-06-27  2103  		serial_port_out(port, UART_LCR, 0);
b6830f6df8914fa Peter Hurley      2015-06-27  2104  		serial_icr_write(up, UART_CSR, 0); /* Reset the UART */
b6830f6df8914fa Peter Hurley      2015-06-27  2105  		serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B);
b6830f6df8914fa Peter Hurley      2015-06-27  2106  		serial_port_out(port, UART_EFR, UART_EFR_ECB);
b6830f6df8914fa Peter Hurley      2015-06-27  2107  		serial_port_out(port, UART_LCR, 0);
8706f4b8fda1175 Jiri Slaby (SUSE  2025-04-28  2108) 		break;
8706f4b8fda1175 Jiri Slaby (SUSE  2025-04-28  2109) 	case PORT_DA830:
b1207d86169d165 John Ogness       2023-05-25  2110  		/*
b1207d86169d165 John Ogness       2023-05-25  2111  		 * Reset the port
b1207d86169d165 John Ogness       2023-05-25  2112  		 *
b1207d86169d165 John Ogness       2023-05-25  2113  		 * Synchronize UART_IER access against the console.
b1207d86169d165 John Ogness       2023-05-25  2114  		 */
5727d6ba3d1a5c4 Jiri Slaby (SUSE  2025-04-14  2115) 		scoped_guard(uart_port_lock_irqsave, port) {
a2d6a987bfe4a2e David Lechner     2017-01-05  2116  			serial_port_out(port, UART_IER, 0);
a2d6a987bfe4a2e David Lechner     2017-01-05  2117  			serial_port_out(port, UART_DA830_PWREMU_MGMT, 0);
5727d6ba3d1a5c4 Jiri Slaby (SUSE  2025-04-14  2118) 		}
a2d6a987bfe4a2e David Lechner     2017-01-05  2119  		mdelay(10);
a2d6a987bfe4a2e David Lechner     2017-01-05  2120  
a2d6a987bfe4a2e David Lechner     2017-01-05  2121  		/* Enable Tx, Rx and free run mode */
a2d6a987bfe4a2e David Lechner     2017-01-05  2122  		serial_port_out(port, UART_DA830_PWREMU_MGMT,
a2d6a987bfe4a2e David Lechner     2017-01-05  2123  				UART_DA830_PWREMU_MGMT_UTRST |
a2d6a987bfe4a2e David Lechner     2017-01-05  2124  				UART_DA830_PWREMU_MGMT_URRST |
a2d6a987bfe4a2e David Lechner     2017-01-05  2125  				UART_DA830_PWREMU_MGMT_FREE);
8706f4b8fda1175 Jiri Slaby (SUSE  2025-04-28  2126) 		break;
8706f4b8fda1175 Jiri Slaby (SUSE  2025-04-28 @2127) 	case PORT_RSA:
8706f4b8fda1175 Jiri Slaby (SUSE  2025-04-28  2128) 		rsa_enable(up);
8706f4b8fda1175 Jiri Slaby (SUSE  2025-04-28  2129) 		break;
8706f4b8fda1175 Jiri Slaby (SUSE  2025-04-28  2130) 	}
a2d6a987bfe4a2e David Lechner     2017-01-05  2131  }
a2d6a987bfe4a2e David Lechner     2017-01-05  2132  

:::::: The code at line 2127 was first introduced by commit
:::::: 8706f4b8fda1175107a231142232ac54f03e3229 serial8250_startup_special

:::::: TO: Jiri Slaby (SUSE) <jirislaby@kernel.org>
:::::: CC: Jiri Slaby (SUSE) <jirislaby@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-05-07  5:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07  5:26 [jirislaby:devel 68/87] drivers/tty/serial/8250/8250_port.c:2127:2: error: cannot jump from switch statement to this case label kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox