From: Bjorn Helgaas Return failure immediately, so we don't have to test it twice. Signed-off-by: Bjorn Helgaas Cc: Adam Belay Cc: Russell King Signed-off-by: Andrew Morton --- drivers/serial/8250_pnp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff -puN drivers/serial/8250_pnp.c~serial-trivial-code-flow-simplification drivers/serial/8250_pnp.c --- a/drivers/serial/8250_pnp.c~serial-trivial-code-flow-simplification +++ a/drivers/serial/8250_pnp.c @@ -450,11 +450,11 @@ serial_pnp_probe(struct pnp_dev *dev, co port.dev = &dev->dev; line = serial8250_register_port(&port); + if (line < 0) + return -ENODEV; - if (line >= 0) - pnp_set_drvdata(dev, (void *)((long)line + 1)); - return line >= 0 ? 0 : -ENODEV; - + pnp_set_drvdata(dev, (void *)((long)line + 1)); + return 0; } static void __devexit serial_pnp_remove(struct pnp_dev *dev) _