From: Kalle Valo <kvalo@codeaurora.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Larry.Finger@lwfinger.net, linux-wireless@vger.kernel.org
Subject: Re: [bug report] rtlwifi: Remove some redundant code
Date: Tue, 10 Jan 2017 15:43:01 +0200 [thread overview]
Message-ID: <8737grjaje.fsf@purkki.adurom.net> (raw)
In-Reply-To: <20170105111124.GA4548@elgon.mountain> (Dan Carpenter's message of "Thu, 5 Jan 2017 14:11:24 +0300")
Dan Carpenter <dan.carpenter@oracle.com> writes:
> Hello Larry Finger,
>
> The patch c93ac39da006: "rtlwifi: Remove some redundant code" from
> Dec 15, 2016, leads to the following static checker warning:
>
> drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c:326 rtl92d_download_fw()
> warn: curly braces intended?
>
> drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
> 306 /* If 8051 is running in RAM code, driver should
> 307 * inform Fw to reset by itself, or it will cause
> 308 * download Fw fail.*/
> 309 /* 8051 RAM code */
> 310 if (rtl_read_byte(rtlpriv, REG_MCUFWDL) & BIT(7)) {
> 311 rtl92d_firmware_selfreset(hw);
> 312 rtl_write_byte(rtlpriv, REG_MCUFWDL, 0x00);
> 313 }
> 314 _rtl92d_enable_fw_download(hw, true);
> 315 _rtl92d_write_fw(hw, version, pfwdata, fwsize);
> 316 _rtl92d_enable_fw_download(hw, false);
> 317 spin_lock_irqsave(&globalmutex_for_fwdownload, flags);
> 318 err = _rtl92d_fw_free_to_go(hw);
> 319 /* download fw over,clear 0x1f[5] */
> 320 value = rtl_read_byte(rtlpriv, 0x1f);
> 321 value &= (~BIT(5));
> 322 rtl_write_byte(rtlpriv, 0x1f, value);
> 323 spin_unlock_irqrestore(&globalmutex_for_fwdownload, flags);
> 324 if (err)
> 325 pr_err("fw is not ready to run!\n");
> 326 goto exit;
>
> I guess we could add the braces back.
>
> 327 exit:
> 328 err = _rtl92d_fw_init(hw);
>
> Should we even be running _rtl92d_fw_init() if _rtl92d_fw_free_to_go()
> fails? What about preserving the error code?
>
> 329 return err;
> 330 }
A possible fix but which doesn't seem to address all your concerns:
[next] rtlwifi: rtl8192de: fix missing curly braces
https://patchwork.kernel.org/patch/9506837/
--
Kalle Valo
next prev parent reply other threads:[~2017-01-10 13:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-05 11:11 [bug report] rtlwifi: Remove some redundant code Dan Carpenter
2017-01-10 13:43 ` Kalle Valo [this message]
2017-01-10 16:18 ` Larry Finger
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=8737grjaje.fsf@purkki.adurom.net \
--to=kvalo@codeaurora.org \
--cc=Larry.Finger@lwfinger.net \
--cc=dan.carpenter@oracle.com \
--cc=linux-wireless@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.