Re: [greybus-dev] [PATCH] staging: greybus: Remove unused local variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> > ---
> >  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@xxxxxxxxxx>

Acked-by: Johan Hovold <johan@xxxxxxxxxx>

Thanks,
Johan
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux