staging: greybus: Remove unused local variable
PATCH 1/1 staging: greybus: Remove unused local variable
Fixes the following W=1 warning: variable ‘intf_id’ set but not used [-Wunused-but-set-variable]
--- drivers/staging/greybus/svc.c | 3 --- 1 file changed, 3 deletions(-)
drivers/staging/greybus/svc.c +0 -3
@@ -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 ;
Signature · 6 lines
2.17.0 _______________________________________________ devel mailing list [email protected] http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Quoted 21 lines · Nathan Chancellor
Fixes the following W=1 warning: variable ‘intf_id’ set but not used [-Wunused-but-set-variable]
Signed-off-by Nathan Chancellor <[email protected]>--- drivers/staging/greybus/svc.c | 3 --- 1 file changed, 3 deletions(-)drivers/staging/greybus/svc.c +0
-1@@ -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",
drivers/staging/greybus/svc.c static int gb_svc_intf_reset_recv(struct gb_operation *op) · line 1150
Quoted 8 lines
drivers/staging/greybus/svc.c +0
-2@@ -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 ..
Signature · 1 line
viresh
Quoted 25 lines · Viresh Kumar
Quoted 24 lines · Nathan Chancellor
Fixes the following W=1 warning: variable ‘intf_id’ set but not used [-Wunused-but-set-variable]
Signed-off-by Nathan Chancellor <[email protected]>--- drivers/staging/greybus/svc.c | 3 --- 1 file changed, 3 deletions(-)drivers/staging/greybus/svc.c +0
-1@@ -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;
Quoted 8 lines
drivers/staging/greybus/svc.c static int gb_svc_intf_reset_recv(struct gb_operation *op) · line 1150
Quoted 5 lines
drivers/staging/greybus/svc.c +0
-2- 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.
Quoted 1 line
Acked-by Viresh Kumar <[email protected]>
Thanks,
Johan