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@xxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx> >> Reported-by: Kalle Valo <kvalo@xxxxxxxxxxxxxx> >> Signed-off-by: Arend van Spriel <arend.vanspriel@xxxxxxxxxxxx> >> --- >> 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