From: Hariprasad Kelam Date: Mon, 1 Jul 2019 18:32:41 +0000 (+0530) Subject: USB: gadget: function: fix issue Unneeded variable: "value" X-Git-Tag: v5.15~5975^2~17^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2d06c18d78ed4aa969ceac33bcfdcc524668424;p=platform%2Fkernel%2Flinux-starfive.git USB: gadget: function: fix issue Unneeded variable: "value" 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 registered with callback function Signed-off-by: Hariprasad Kelam Signed-off-by: Felipe Balbi --- 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; }