From: Greg KH <gregkh@linuxfoundation.org>
To: zhengbin <zhengbin13@huawei.com>
Cc: devel@driverdev.osuosl.org, colin.king@canonical.com,
hardiksingh.k@gmail.com, hdegoede@redhat.com
Subject: Re: [PATCH 1/5] staging: rtl8723bs: Remove set but not used variable 'i'
Date: Mon, 7 Oct 2019 12:30:46 +0200 [thread overview]
Message-ID: <20191007103046.GA392903@kroah.com> (raw)
In-Reply-To: <1570352999-45790-2-git-send-email-zhengbin13@huawei.com>
On Sun, Oct 06, 2019 at 05:09:55PM +0800, zhengbin wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/staging/rtl8723bs/core/rtw_xmit.c: In function update_attrib:
> drivers/staging/rtl8723bs/core/rtw_xmit.c:680:7: warning: variable i set but not used [-Wunused-but-set-variable]
>
> It is not used since commit 554c0a3abf21 ("staging:
> Add rtl8723bs sdio wifi driver")
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index b5dcb78..c24b524 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -675,7 +675,6 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)
>
> static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib *pattrib)
> {
> - uint i;
> struct pkt_file pktfile;
> struct sta_info *psta = NULL;
> struct ethhdr etherhdr;
> @@ -689,7 +688,7 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib
> DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib);
>
> _rtw_open_pktfile(pkt, &pktfile);
> - i = _rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
> + (void)_rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
No need for the (void) marking here. If you really are supposed to do
something with the return value, then do something with it, don't ignore
it.
thanks,
greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2019-10-07 10:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-06 9:09 [PATCH 0/5] staging/rtl8723bs/core: Remove some set but not used variables zhengbin
2019-10-06 9:09 ` [PATCH 1/5] staging: rtl8723bs: Remove set but not used variable 'i' zhengbin
2019-10-07 10:30 ` Greg KH [this message]
2019-10-07 14:04 ` Dan Carpenter
2019-10-06 9:09 ` [PATCH 2/5] staging: rtl8723bs: Remove set but not used variable 'tmp_aid' zhengbin
2019-10-06 9:09 ` [PATCH 3/5] staging: rtl8723bs: Remove set but not used variable 'prwskeylen' zhengbin
2019-10-06 9:09 ` [PATCH 4/5] staging: rtl8723bs: Remove set but not used variables 'ppp', 'type', 'data' zhengbin
2019-10-06 9:09 ` [PATCH 5/5] staging: rtl8723bs: Remove set but not used variable 'adapter' zhengbin
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=20191007103046.GA392903@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=colin.king@canonical.com \
--cc=devel@driverdev.osuosl.org \
--cc=hardiksingh.k@gmail.com \
--cc=hdegoede@redhat.com \
--cc=zhengbin13@huawei.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).