2019-07-11 07:14:51

by Yue Haibing

[permalink] [raw]
Subject: [PATCH -next] rdma/siw: remove set but not used variable 's'

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

drivers/infiniband/sw/siw/siw_cm.c: In function siw_cm_llp_state_change:
drivers/infiniband/sw/siw/siw_cm.c:1278:17: warning: variable s set but not used [-Wunused-but-set-variable]

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: YueHaibing <[email protected]>
---
drivers/infiniband/sw/siw/siw_cm.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c
index c883bf5..7d87a78 100644
--- a/drivers/infiniband/sw/siw/siw_cm.c
+++ b/drivers/infiniband/sw/siw/siw_cm.c
@@ -1275,7 +1275,6 @@ static void siw_cm_llp_error_report(struct sock *sk)
static void siw_cm_llp_state_change(struct sock *sk)
{
struct siw_cep *cep;
- struct socket *s;
void (*orig_state_change)(struct sock *s);

read_lock(&sk->sk_callback_lock);
@@ -1288,8 +1287,6 @@ static void siw_cm_llp_state_change(struct sock *sk)
}
orig_state_change = cep->sk_state_change;

- s = sk->sk_socket;
-
siw_dbg_cep(cep, "state: %d\n", cep->state);

switch (sk->sk_state) {
--
2.7.4



2019-07-11 08:49:04

by Bernard Metzler

[permalink] [raw]
Subject: Re: [PATCH -next] rdma/siw: remove set but not used variable 's'

-----"YueHaibing" <[email protected]> wrote: -----

>To: <[email protected]>, <[email protected]>, <[email protected]>
>From: "YueHaibing" <[email protected]>
>Date: 07/11/2019 09:13AM
>Cc: <[email protected]>, <[email protected]>,
>"YueHaibing" <[email protected]>
>Subject: [EXTERNAL] [PATCH -next] rdma/siw: remove set but not used
>variable 's'
>
>Fixes gcc '-Wunused-but-set-variable' warning:
>
>drivers/infiniband/sw/siw/siw_cm.c: In function
>siw_cm_llp_state_change:
>drivers/infiniband/sw/siw/siw_cm.c:1278:17: warning: variable s set
>but not used [-Wunused-but-set-variable]
>
>Reported-by: Hulk Robot <[email protected]>
>Signed-off-by: YueHaibing <[email protected]>
>---
> drivers/infiniband/sw/siw/siw_cm.c | 3 ---
> 1 file changed, 3 deletions(-)
>
>diff --git a/drivers/infiniband/sw/siw/siw_cm.c
>b/drivers/infiniband/sw/siw/siw_cm.c
>index c883bf5..7d87a78 100644
>--- a/drivers/infiniband/sw/siw/siw_cm.c
>+++ b/drivers/infiniband/sw/siw/siw_cm.c
>@@ -1275,7 +1275,6 @@ static void siw_cm_llp_error_report(struct sock
>*sk)
> static void siw_cm_llp_state_change(struct sock *sk)
> {
> struct siw_cep *cep;
>- struct socket *s;
> void (*orig_state_change)(struct sock *s);
>
> read_lock(&sk->sk_callback_lock);
>@@ -1288,8 +1287,6 @@ static void siw_cm_llp_state_change(struct sock
>*sk)
> }
> orig_state_change = cep->sk_state_change;
>
>- s = sk->sk_socket;
>-
> siw_dbg_cep(cep, "state: %d\n", cep->state);
>
> switch (sk->sk_state) {
>--
>2.7.4
>
>
>

Another bad leftover from excessive debugging times...

Thanks alot Yue!
Bernard.

2019-07-11 15:27:20

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: [PATCH -next] rdma/siw: remove set but not used variable 's'

On Thu, Jul 11, 2019 at 03:12:13PM +0800, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/infiniband/sw/siw/siw_cm.c: In function siw_cm_llp_state_change:
> drivers/infiniband/sw/siw/siw_cm.c:1278:17: warning: variable s set but not used [-Wunused-but-set-variable]
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: YueHaibing <[email protected]>
> ---
> drivers/infiniband/sw/siw/siw_cm.c | 3 ---
> 1 file changed, 3 deletions(-)

Applied to for-next, thanks

Jason