Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9b22271d4b8c1be8a81563c322d3f04e7cbe2153 Commit: 9b22271d4b8c1be8a81563c322d3f04e7cbe2153 Parent: 40b36daad0ac704e6d5c1b75789f371ef5b053c1 Author: Bjorn Helgaas <[EMAIL PROTECTED]> AuthorDate: Wed Feb 14 00:33:05 2007 -0800 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Wed Feb 14 08:09:52 2007 -0800
[PATCH] serial: trivial code flow simplification Return failure immediately, so we don't have to test it twice. Signed-off-by: Bjorn Helgaas <[EMAIL PROTECTED]> Cc: Adam Belay <[EMAIL PROTECTED]> Cc: Russell King <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- drivers/serial/8250_pnp.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c index d3d6b82..cde5db4 100644 --- a/drivers/serial/8250_pnp.c +++ b/drivers/serial/8250_pnp.c @@ -450,11 +450,11 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) 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) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html