linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] infiniband: siw: remove set but not used variables 'rv'
@ 2019-07-19  1:29 Mao Wenan
  2019-07-20  8:01 ` Bernard Metzler
  2019-07-22 18:36 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Mao Wenan @ 2019-07-19  1:29 UTC (permalink / raw)
  To: bmt, dledford, jgg; +Cc: linux-rdma, linux-kernel, kernel-janitors, Mao Wenan

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/infiniband/sw/siw/siw_cm.c: In function siw_cep_set_inuse:
drivers/infiniband/sw/siw/siw_cm.c:223:6: warning: variable rv set but not used [-Wunused-but-set-variable]

It is not used since commit 6c52fdc244b5("rdma/siw: connection management")

Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
 drivers/infiniband/sw/siw/siw_cm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c
index a7cde98..9ce8a1b 100644
--- a/drivers/infiniband/sw/siw/siw_cm.c
+++ b/drivers/infiniband/sw/siw/siw_cm.c
@@ -220,13 +220,12 @@ static void siw_put_work(struct siw_cm_work *work)
 static void siw_cep_set_inuse(struct siw_cep *cep)
 {
 	unsigned long flags;
-	int rv;
 retry:
 	spin_lock_irqsave(&cep->lock, flags);
 
 	if (cep->in_use) {
 		spin_unlock_irqrestore(&cep->lock, flags);
-		rv = wait_event_interruptible(cep->waitq, !cep->in_use);
+		wait_event_interruptible(cep->waitq, !cep->in_use);
 		if (signal_pending(current))
 			flush_signals(current);
 		goto retry;
-- 
2.7.4


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

* Re: [PATCH -next] infiniband: siw: remove set but not used variables 'rv'
  2019-07-19  1:29 [PATCH -next] infiniband: siw: remove set but not used variables 'rv' Mao Wenan
@ 2019-07-20  8:01 ` Bernard Metzler
  2019-07-22 18:36 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Bernard Metzler @ 2019-07-20  8:01 UTC (permalink / raw)
  To: Mao Wenan; +Cc: dledford, jgg, linux-rdma, linux-kernel, kernel-janitors

-----"Mao Wenan" <maowenan@huawei.com> wrote: -----

>To: <bmt@zurich.ibm.com>, <dledford@redhat.com>, <jgg@ziepe.ca>
>From: "Mao Wenan" <maowenan@huawei.com>
>Date: 07/19/2019 03:24AM
>Cc: <linux-rdma@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
><kernel-janitors@vger.kernel.org>, "Mao Wenan" <maowenan@huawei.com>
>Subject: [EXTERNAL] [PATCH -next] infiniband: siw: remove set but not
>used variables 'rv'
>
>Fixes gcc '-Wunused-but-set-variable' warning:
>
>drivers/infiniband/sw/siw/siw_cm.c: In function siw_cep_set_inuse:
>drivers/infiniband/sw/siw/siw_cm.c:223:6: warning: variable rv set
>but not used [-Wunused-but-set-variable]
>
>It is not used since commit 6c52fdc244b5("rdma/siw: connection
>management")
>
>Signed-off-by: Mao Wenan <maowenan@huawei.com>
>---
> drivers/infiniband/sw/siw/siw_cm.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/drivers/infiniband/sw/siw/siw_cm.c
>b/drivers/infiniband/sw/siw/siw_cm.c
>index a7cde98..9ce8a1b 100644
>--- a/drivers/infiniband/sw/siw/siw_cm.c
>+++ b/drivers/infiniband/sw/siw/siw_cm.c
>@@ -220,13 +220,12 @@ static void siw_put_work(struct siw_cm_work
>*work)
> static void siw_cep_set_inuse(struct siw_cep *cep)
> {
> 	unsigned long flags;
>-	int rv;
> retry:
> 	spin_lock_irqsave(&cep->lock, flags);
> 
> 	if (cep->in_use) {
> 		spin_unlock_irqrestore(&cep->lock, flags);
>-		rv = wait_event_interruptible(cep->waitq, !cep->in_use);
>+		wait_event_interruptible(cep->waitq, !cep->in_use);
> 		if (signal_pending(current))
> 			flush_signals(current);
> 		goto retry;
>-- 
>2.7.4
>
>

Mao, many thanks for finding that. So, yes, 'rv'  shall be removed.

Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com>


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

* Re: [PATCH -next] infiniband: siw: remove set but not used variables 'rv'
  2019-07-19  1:29 [PATCH -next] infiniband: siw: remove set but not used variables 'rv' Mao Wenan
  2019-07-20  8:01 ` Bernard Metzler
@ 2019-07-22 18:36 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2019-07-22 18:36 UTC (permalink / raw)
  To: Mao Wenan; +Cc: bmt, dledford, linux-rdma, linux-kernel, kernel-janitors

On Fri, Jul 19, 2019 at 09:29:38AM +0800, Mao Wenan wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/infiniband/sw/siw/siw_cm.c: In function siw_cep_set_inuse:
> drivers/infiniband/sw/siw/siw_cm.c:223:6: warning: variable rv set but not used [-Wunused-but-set-variable]
> 
> It is not used since commit 6c52fdc244b5("rdma/siw: connection management")
> 
> Signed-off-by: Mao Wenan <maowenan@huawei.com>
> ---
>  drivers/infiniband/sw/siw/siw_cm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied to for-rc

Thanks,
Jason

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

end of thread, other threads:[~2019-07-22 18:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-19  1:29 [PATCH -next] infiniband: siw: remove set but not used variables 'rv' Mao Wenan
2019-07-20  8:01 ` Bernard Metzler
2019-07-22 18:36 ` Jason Gunthorpe

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