Skip to content

Commit d0e236d

Browse files
committed
8250_ni16550: fix compiler warning about mixed declarations and code
During the build the following compiler warning is printed: drivers/tty/serial/8250/8250_ni16550.c: In function ‘ni16550_config_prescaler’: drivers/tty/serial/8250/8250_ni16550.c:181:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] 181 | uint8_t efr_value; Fix it by moving the declaration of 'efr_value' at the beginning of the function. Signed-off-by: Gratian Crisan <gratian.crisan@ni.com>
1 parent 84c7e19 commit d0e236d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/tty/serial/8250/8250_ni16550.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,11 @@ void ni16550_config_prescaler(unsigned long iobase, uint8_t prescaler)
174174
* Sets EFR[4] for Enhanced Mode.
175175
*/
176176
uint8_t lcr_value;
177+
uint8_t efr_value;
177178

178179
lcr_value = inb(iobase + UART_LCR);
179180
outb(UART_LCR_CONF_MODE_B, iobase + UART_LCR);
180181

181-
uint8_t efr_value;
182-
183182
efr_value = inb(iobase + UART_EFR);
184183
efr_value |= UART_EFR_ECB;
185184

0 commit comments

Comments
 (0)