linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] rtlwifi: Remove some redundant code
@ 2017-01-05 11:11 Dan Carpenter
  2017-01-10 13:43 ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2017-01-05 11:11 UTC (permalink / raw)
  To: Larry.Finger; +Cc: linux-wireless

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  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-10 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-05 11:11 [bug report] rtlwifi: Remove some redundant code Dan Carpenter
2017-01-10 13:43 ` Kalle Valo
2017-01-10 16:18   ` Larry Finger

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).