All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: gadget: function: fix issue Unneeded variable: "value"
@ 2019-07-01 18:20 Hariprasad Kelam
  2019-07-01 18:22 ` Sergei Shtylyov
  0 siblings, 1 reply; 2+ messages in thread
From: Hariprasad Kelam @ 2019-07-01 18:20 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Hariprasad Kelam, linux-usb,
	linux-kernel

fix below issue reported by coccicheck
drivers/usb/gadget/function/f_eem.c:169:7-12: Unneeded variable:
"value". Return "- EOPNOTSUPP" on line 179

We can not change return type of eem_setup as its registed with callback
function

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
 drivers/usb/gadget/function/f_eem.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/function/f_eem.c b/drivers/usb/gadget/function/f_eem.c
index c13befa..b81a91d 100644
--- a/drivers/usb/gadget/function/f_eem.c
+++ b/drivers/usb/gadget/function/f_eem.c
@@ -166,7 +166,6 @@ static struct usb_gadget_strings *eem_strings[] = {
 static int eem_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
 {
 	struct usb_composite_dev *cdev = f->config->cdev;
-	int			value = -EOPNOTSUPP;
 	u16			w_index = le16_to_cpu(ctrl->wIndex);
 	u16			w_value = le16_to_cpu(ctrl->wValue);
 	u16			w_length = le16_to_cpu(ctrl->wLength);
@@ -176,7 +175,7 @@ static int eem_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
 		w_value, w_index, w_length);
 
 	/* device either stalls (value < 0) or reports success */
-	return value;
+	return -EOPNOTSUPP;
 }
 
 
-- 
2.7.4


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

* Re: [PATCH] USB: gadget: function: fix issue Unneeded variable: "value"
  2019-07-01 18:20 [PATCH] USB: gadget: function: fix issue Unneeded variable: "value" Hariprasad Kelam
@ 2019-07-01 18:22 ` Sergei Shtylyov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2019-07-01 18:22 UTC (permalink / raw)
  To: Hariprasad Kelam, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-kernel

Hello!

On 07/01/2019 09:20 PM, Hariprasad Kelam wrote:

> fix below issue reported by coccicheck
> drivers/usb/gadget/function/f_eem.c:169:7-12: Unneeded variable:
> "value". Return "- EOPNOTSUPP" on line 179
> 
> We can not change return type of eem_setup as its registed with callback

   Registered.

> function
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
[...]

MBR, Sergei


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-01 18:20 [PATCH] USB: gadget: function: fix issue Unneeded variable: "value" Hariprasad Kelam
2019-07-01 18:22 ` Sergei Shtylyov

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.