From: Greg KH <greg@kroah.com>
To: Zheng Yongjun <zhengyongjun3@huawei.com>
Cc: davem@davemloft.net, UNGLinuxDriver@microchip.com,
kuba@kernel.org, netdev@vger.kernel.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] rapidio: Remove set but not used variable 'rc'
Date: Fri, 18 Sep 2020 09:47:54 +0200 [thread overview]
Message-ID: <20200918074754.GA979569@kroah.com> (raw)
In-Reply-To: <20200918071844.19772-1-zhengyongjun3@huawei.com>
On Fri, Sep 18, 2020 at 03:18:44PM +0800, Zheng Yongjun wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/rapidio/rio_cm.c: In function rio_txcq_handler:
> drivers/rapidio/rio_cm.c:673:7: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
>
> rc is never used, so remove it.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
> drivers/rapidio/rio_cm.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/rapidio/rio_cm.c b/drivers/rapidio/rio_cm.c
> index 50ec53d67a4c..545693bd86a3 100644
> --- a/drivers/rapidio/rio_cm.c
> +++ b/drivers/rapidio/rio_cm.c
> @@ -670,12 +670,11 @@ static void rio_txcq_handler(struct cm_dev *cm, int slot)
> */
> if (!list_empty(&cm->tx_reqs) && (cm->tx_cnt < RIOCM_TX_RING_SIZE)) {
> struct tx_req *req, *_req;
> - int rc;
>
> list_for_each_entry_safe(req, _req, &cm->tx_reqs, node) {
> list_del(&req->node);
> cm->tx_buf[cm->tx_slot] = req->buffer;
> - rc = rio_add_outb_message(cm->mport, req->rdev, cmbox,
> + rio_add_outb_message(cm->mport, req->rdev, cmbox,
> req->buffer, req->len);
That's not the only place in this file where this call is made, and the
return value is ignored.
It should be fixed up to properly check that return value, not ignore
it. Can you do that instead for the places this is called?
thanks,
greg k-h
prev parent reply other threads:[~2020-09-18 7:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-18 7:18 [PATCH -next] rapidio: Remove set but not used variable 'rc' Zheng Yongjun
2020-09-18 7:47 ` Greg KH [this message]
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=20200918074754.GA979569@kroah.com \
--to=greg@kroah.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=zhengyongjun3@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).