All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Larry.Finger@lwfinger.net
Cc: linux-wireless@vger.kernel.org
Subject: [bug report] rtlwifi: Remove some redundant code
Date: Thu, 5 Jan 2017 14:11:24 +0300	[thread overview]
Message-ID: <20170105111124.GA4548@elgon.mountain> (raw)

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

             reply	other threads:[~2017-01-05 11:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05 11:11 Dan Carpenter [this message]
2017-01-10 13:43 ` [bug report] rtlwifi: Remove some redundant code Kalle Valo
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=20170105111124.GA4548@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=Larry.Finger@lwfinger.net \
    --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.