lkml.org 
[lkml]   [2011]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2011-01-28 09:59    [W:0.062 / U:37.592 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site