提交 829b0000 编写于 作者: A Anton Wuerfel 提交者: Greg Kroah-Hartman

tty: serial: 8250: Merge duplicate conditions

This patch refactors a switch case statement by merging an if condition
in the default case into an identical condition right after the switch
statement.
This comes with a slight change in behaviour: If pci_netmos_9900_numports
returns 0, an additional warning is printed.
Signed-off-by: NAnton Würfel <anton.wuerfel@fau.de>
Signed-off-by: NPhillip Raffeck <phillip.raffeck@fau.de>
Suggested-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-kernel@i4.cs.fau.de
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9faef1cb
......@@ -850,13 +850,13 @@ static int pci_netmos_init(struct pci_dev *dev)
break;
default:
if (num_serial == 0 ) {
moan_device("unknown NetMos/Mostech device", dev);
}
break;
}
if (num_serial == 0)
if (num_serial == 0) {
moan_device("unknown NetMos/Mostech device", dev);
return -ENODEV;
}
return num_serial;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册