Messages in this thread | | | Date | Fri, 28 Jan 2011 09:56:55 +0100 | From | Alexander Holler <> | Subject | Re: [PATCH 02/02] ath3k: Avoid duplication of code |
| |
Hello Rogério,
Am 28.01.2011 00:24, schrieb Rogério Brito:
> The resuting code has some redundancy and the compiler can potentially > produce better code if we omit a function call that is unconditionally > executed in
> diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c > index a126e61..d51c5a3 100644 > --- a/drivers/bluetooth/ath3k.c > +++ b/drivers/bluetooth/ath3k.c > @@ -116,13 +116,10 @@ static int ath3k_probe(struct usb_interface *intf, > return -EIO; > } > > - if (ath3k_load_firmware(udev, firmware)) { > - release_firmware(firmware); > - return -EIO; > - } > + ret = ath3k_load_firmware(udev, firmware); > release_firmware(firmware); > > - return 0; > + return ret ? -EIO : 0; > }
Looks nice, but doesn't compile. I assume you should at least try to compile the stuff you want to change. ;)
Regards,
Alexander
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |