linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Julian Calaby <julian.calaby@gmail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] brcmfmac: fix uninitialized warning in brcmf_usb_probe_phase2()
Date: Sun, 18 Jun 2017 15:01:40 +0200	[thread overview]
Message-ID: <521530e3-63b0-0720-a290-e4a73bcdc65b@broadcom.com> (raw)
In-Reply-To: <CAGRGNgU8=i6Nox1k2c3RozPncm92Z9Gd85f=wgzwaSDmavbA4A@mail.gmail.com>

On 18-06-17 06:26, Julian Calaby wrote:
> Hi Arend,
> 
> On Fri, Jun 16, 2017 at 6:36 PM, Arend van Spriel
> <arend.vanspriel@broadcom.com> wrote:
>> This fixes the following warning:
>>
>>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c: In function
>>   'brcmf_usb_probe_phase2':
>>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c:1198:2:
>>   warning: 'devinfo' may be used uninitialized in this function
>>   [-Wmaybe-uninitialized]
>>     mutex_unlock(&devinfo->dev_init_lock);
>>
>> Fixes: 6d0507a777fb ("brcmfmac: add parameter to pass error code in firmware callback")
>> Cc: Stephen Rothwell <sfr@canb.auug.org.au>
>> Reported-by: Kalle Valo <kvalo@codeaurora.org>
>> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
>> ---
>>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
>> index 9ce3b55..8b16387 100644
>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
>> @@ -1164,14 +1164,13 @@ static void brcmf_usb_probe_phase2(struct device *dev, int ret,
>>                                    void *nvram, u32 nvlen)
>>  {
>>         struct brcmf_bus *bus = dev_get_drvdata(dev);
>> -       struct brcmf_usbdev_info *devinfo;
>> +       struct brcmf_usbdev_info *devinfo = bus->bus_priv.usb->devinfo;;
>>
>>         if (ret)
>>                 goto error;
> 
> Completely unrelated to this specific patch, I just want to point out
> that this construct looks _really_ weird.

Guess it might. This is a callback function in which the caller passes
the result. Could have chosen a better name than 'ret'. Other option
would have been a separate callback for the error handling, but I
decided that to be overkill.

Regards,
Arend

      reply	other threads:[~2017-06-18 13:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16  8:36 [PATCH] brcmfmac: fix uninitialized warning in brcmf_usb_probe_phase2() Arend van Spriel
2017-06-16  8:44 ` Kalle Valo
2017-06-16 10:12   ` Arend van Spriel
2017-06-16  8:53 ` Kalle Valo
2017-06-18  4:26 ` [PATCH] " Julian Calaby
2017-06-18 13:01   ` Arend van Spriel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=521530e3-63b0-0720-a290-e4a73bcdc65b@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=julian.calaby@gmail.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).