Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754484Ab0GEJ02 (ORCPT ); Mon, 5 Jul 2010 05:26:28 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:63194 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750831Ab0GEJ00 (ORCPT ); Mon, 5 Jul 2010 05:26:26 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; b=dyNs196kz6x8DM300fcKp1fFCrxDeZg6Xsd/xTUZBNm6criMekn0L5tx6TW/nX6l5c vP+0xjtx8F2kporn9Rz7WBI/D4RVWXp4I6NnUHUtqHtR8TXXMx3NVv11J5fi+ocXeA2R SjurPbGEMhvqJM4PhepPcJnQ66x6Xg/05DkEo= Date: Mon, 5 Jul 2010 11:24:15 +0200 From: Dan Carpenter To: Kulikov Vasiliy Cc: Kernel Janitors , Marcel Holtmann , Bing Zhao , Ben Hutchings , =?iso-8859-1?Q?Andr=E9?= Goddard Rosa , Julia Lawall , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bluetooth: btmrvl_sdio: silence warning Message-ID: <20100705092414.GY19184@bicker> Mail-Followup-To: Dan Carpenter , Kulikov Vasiliy , Kernel Janitors , Marcel Holtmann , Bing Zhao , Ben Hutchings , =?iso-8859-1?Q?Andr=E9?= Goddard Rosa , Julia Lawall , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org References: <1278316883-29784-1-git-send-email-segooon@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1278316883-29784-1-git-send-email-segooon@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1619 Lines: 46 On Mon, Jul 05, 2010 at 12:01:22PM +0400, Kulikov Vasiliy wrote: > Clone checking of ret to simplify the code. > > This patch silences a compiler warning: > drivers/bluetooth/btmrvl_sdio.c: In function ‘btmrvl_sdio_verify_fw_download’: > drivers/bluetooth/btmrvl_sdio.c:80: warning: ‘fws1’ may be used uninitialized in this function > drivers/bluetooth/btmrvl_sdio.c:80: note: ‘fws1’ was declared here > > Signed-off-by: Kulikov Vasiliy > --- > drivers/bluetooth/btmrvl_sdio.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c > index df0773e..47f0f91 100644 > --- a/drivers/bluetooth/btmrvl_sdio.c > +++ b/drivers/bluetooth/btmrvl_sdio.c > @@ -83,10 +83,10 @@ static int btmrvl_sdio_read_fw_status(struct btmrvl_sdio_card *card, u16 *dat) > *dat = 0; > > fws0 = sdio_readb(card->func, CARD_FW_STATUS0_REG, &ret); > + if (ret) > + return -EIO; Normally it would be better to just "return ret;" here. But the caller doesn't use the return code so it doesn't really matter... Reviewed-by: Dan Carpenter regards, dan carpenter > > - if (!ret) > - fws1 = sdio_readb(card->func, CARD_FW_STATUS1_REG, &ret); > - > + fws1 = sdio_readb(card->func, CARD_FW_STATUS1_REG, &ret); > if (ret) > return -EIO; > -- 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/