All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: Remove unused local variable
@ 2018-05-06  6:50 Nathan Chancellor
  2018-05-07  5:05 ` [greybus-dev] " Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2018-05-06  6:50 UTC (permalink / raw)
  To: greybus-dev
  Cc: devel, Greg Kroah-Hartman, Johan Hovold, linux-kernel, Nathan Chancellor

Fixes the following W=1 warning: variable ‘intf_id’ set but
not used [-Wunused-but-set-variable]

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/staging/greybus/svc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c
index a874fed761a1..a2bb7e1a3db3 100644
--- a/drivers/staging/greybus/svc.c
+++ b/drivers/staging/greybus/svc.c
@@ -1137,7 +1137,6 @@ static int gb_svc_intf_reset_recv(struct gb_operation *op)
 	struct gb_svc *svc = gb_connection_get_data(op->connection);
 	struct gb_message *request = op->request;
 	struct gb_svc_intf_reset_request *reset;
-	u8 intf_id;
 
 	if (request->payload_size < sizeof(*reset)) {
 		dev_warn(&svc->dev, "short reset request received (%zu < %zu)\n",
@@ -1146,8 +1145,6 @@ static int gb_svc_intf_reset_recv(struct gb_operation *op)
 	}
 	reset = request->payload;
 
-	intf_id = reset->intf_id;
-
 	/* FIXME Reset the interface here */
 
 	return 0;
-- 
2.17.0

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [greybus-dev] [PATCH] staging: greybus: Remove unused local variable
  2018-05-06  6:50 [PATCH] staging: greybus: Remove unused local variable Nathan Chancellor
@ 2018-05-07  5:05 ` Viresh Kumar
  2018-05-07  7:20   ` Johan Hovold
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2018-05-07  5:05 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: greybus-dev, devel, Alex Elder, Johan Hovold, linux-kernel

On 05-05-18, 23:50, Nathan Chancellor wrote:
> Fixes the following W=1 warning: variable ‘intf_id’ set but
> not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>  drivers/staging/greybus/svc.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c
> index a874fed761a1..a2bb7e1a3db3 100644
> --- a/drivers/staging/greybus/svc.c
> +++ b/drivers/staging/greybus/svc.c
> @@ -1137,7 +1137,6 @@ static int gb_svc_intf_reset_recv(struct gb_operation *op)
>  	struct gb_svc *svc = gb_connection_get_data(op->connection);
>  	struct gb_message *request = op->request;
>  	struct gb_svc_intf_reset_request *reset;
> -	u8 intf_id;
>  
>  	if (request->payload_size < sizeof(*reset)) {
>  		dev_warn(&svc->dev, "short reset request received (%zu < %zu)\n",
> @@ -1146,8 +1145,6 @@ static int gb_svc_intf_reset_recv(struct gb_operation *op)
>  	}
>  	reset = request->payload;
>  
> -	intf_id = reset->intf_id;
> -
>  	/* FIXME Reset the interface here */
>  
>  	return 0;

Don't you get a new error after removing this, i.e "reset set but unused" ? Or
the sizeof() operation on that suppresses those warnings ..

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* Re: [greybus-dev] [PATCH] staging: greybus: Remove unused local variable
  2018-05-07  5:05 ` [greybus-dev] " Viresh Kumar
@ 2018-05-07  7:20   ` Johan Hovold
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2018-05-07  7:20 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Nathan Chancellor, greybus-dev, devel, Alex Elder, Johan Hovold,
	linux-kernel

On Mon, May 07, 2018 at 10:35:46AM +0530, Viresh Kumar wrote:
> On 05-05-18, 23:50, Nathan Chancellor wrote:
> > Fixes the following W=1 warning: variable ‘intf_id’ set but
> > not used [-Wunused-but-set-variable]
> > 
> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> > ---
> >  drivers/staging/greybus/svc.c | 3 ---
> >  1 file changed, 3 deletions(-)
> > 
> > diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c
> > index a874fed761a1..a2bb7e1a3db3 100644
> > --- a/drivers/staging/greybus/svc.c
> > +++ b/drivers/staging/greybus/svc.c
> > @@ -1137,7 +1137,6 @@ static int gb_svc_intf_reset_recv(struct gb_operation *op)
> >  	struct gb_svc *svc = gb_connection_get_data(op->connection);
> >  	struct gb_message *request = op->request;
> >  	struct gb_svc_intf_reset_request *reset;
> > -	u8 intf_id;
> >  
> >  	if (request->payload_size < sizeof(*reset)) {
> >  		dev_warn(&svc->dev, "short reset request received (%zu < %zu)\n",
> > @@ -1146,8 +1145,6 @@ static int gb_svc_intf_reset_recv(struct gb_operation *op)
> >  	}
> >  	reset = request->payload;
> >  
> > -	intf_id = reset->intf_id;
> > -
> >  	/* FIXME Reset the interface here */
> >  
> >  	return 0;
> 
> Don't you get a new error after removing this, i.e "reset set but unused" ? Or
> the sizeof() operation on that suppresses those warnings ..

That was my initial reaction as well, but I failed to notice the sizeof
which prevents the new warning.

> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Acked-by: Johan Hovold <johan@kernel.org>

Thanks,
Johan

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

end of thread, other threads:[~2018-05-07  7:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-06  6:50 [PATCH] staging: greybus: Remove unused local variable Nathan Chancellor
2018-05-07  5:05 ` [greybus-dev] " Viresh Kumar
2018-05-07  7:20   ` Johan Hovold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.