Re: [PATCH v2 2/8] serial: stm32: fix code cleaning warnings and checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06. 01. 21, 17:21, Erwan Le Ray wrote:
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
...
@@ -973,18 +971,17 @@ static int stm32_init_port(struct stm32_port *stm32port,
  	struct resource *res;
  	int ret;
+ ret = platform_get_irq(pdev, 0);
+	if (ret <= 0)
+		return ret ? : -ENODEV;
+
  	port->iotype	= UPIO_MEM;
  	port->flags	= UPF_BOOT_AUTOCONF;
  	port->ops	= &stm32_uart_ops;
  	port->dev	= &pdev->dev;
  	port->fifosize	= stm32port->info->cfg.fifosize;
  	port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_STM32_CONSOLE);
-
-	ret = platform_get_irq(pdev, 0);
-	if (ret <= 0)
-		return ret ? : -ENODEV;
  	port->irq = ret;

I would move this set from ret above too. Or introduce a new variable, e.g. "irq".

thanks,
--
js
suse labs



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux