From: Brian Norris <briannorris@chromium.org>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Amitkumar Karwar <amitkarwar@gmail.com>,
Kalle Valo <kvalo@codeaurora.org>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
Nishant Sarmukadam <nishants@marvell.com>,
Xinming Hu <huxm@marvell.com>
Subject: Re: [PATCH] mwifiex: fix compile warning of unused variable
Date: Thu, 6 Jul 2017 10:11:53 -0700 [thread overview]
Message-ID: <20170706171152.GA120202@google.com> (raw)
In-Reply-To: <1499327433-70786-1-git-send-email-shawn.lin@rock-chips.com>
On Thu, Jul 06, 2017 at 03:50:33PM +0800, Shawn Lin wrote:
> We got a compile warning shows below:
>
> drivers/net/wireless/marvell/mwifiex/sdio.c: In function
> 'mwifiex_sdio_remove':
> drivers/net/wireless/marvell/mwifiex/sdio.c:377:6: warning: variable
> 'ret' set but not used [-Wunused-but-set-variable]
It's probably worth noting that this is not a default warning [1],
especially if you resend. It already confused Kalle.
[1] In Makefile:
# These warnings generated too much noise in a regular build.
# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
> Per the code, it didn't check if mwifiex_sdio_read_fw_status
> finish successfully. We should at least check the return of
> mwifiex_sdio_read_fw_status, otherwise the following check of
> firmware_stat and adapter->mfg_mode is pointless as the device
> is probably dead.
>
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
> ---
>
> drivers/net/wireless/marvell/mwifiex/sdio.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
> index f81a006..fd5183c 100644
> --- a/drivers/net/wireless/marvell/mwifiex/sdio.c
> +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
> @@ -390,7 +390,8 @@ static int mwifiex_check_winner_status(struct mwifiex_adapter *adapter)
> mwifiex_dbg(adapter, INFO, "info: SDIO func num=%d\n", func->num);
>
> ret = mwifiex_sdio_read_fw_status(adapter, &firmware_stat);
> - if (firmware_stat == FIRMWARE_READY_SDIO && !adapter->mfg_mode) {
> + if (!ret && firmware_stat == FIRMWARE_READY_SDIO &&
> + !adapter->mfg_mode) {
The PCIe driver has the same code structure. Might change both, if
you're changing one of them? The PCIe one is technically safe I guess,
since it will write to the 'firmware_stat' variable regardless of
success or failure, whereas this SDIO one will not. But it would keep
things clear and obvious.
With (or without) that change:
Reviewed-by: Brian Norris <briannorris@chromium.org>
Brian
> mwifiex_deauthenticate_all(adapter);
>
> priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
> --
> 1.9.1
>
>
next prev parent reply other threads:[~2017-07-06 17:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-06 7:50 [PATCH] mwifiex: fix compile warning of unused variable Shawn Lin
2017-07-06 7:57 ` Kalle Valo
2017-07-06 8:18 ` Shawn Lin
2017-07-06 17:11 ` Brian Norris [this message]
2017-07-25 12:33 ` Kalle Valo
2017-07-28 14:50 ` Kalle Valo
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=20170706171152.GA120202@google.com \
--to=briannorris@chromium.org \
--cc=amitkarwar@gmail.com \
--cc=huxm@marvell.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nishants@marvell.com \
--cc=shawn.lin@rock-chips.com \
/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).