diff mbox series

usb: remove useless condition _ep_queue()

Message ID 20220711152503.17657-1-strochuk@ispras.ru
State New
Headers show
Series usb: remove useless condition _ep_queue() | expand

Commit Message

Andrey Strachuk July 11, 2022, 3:25 p.m. UTC
Comparison of 'ep' with NULL is useless since
'ep' is a result of container_of and cannot be NULL
in any reasonable scenario.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Andrey Strachuk <strochuk@ispras.ru>
Fixes: 2dbc5c4c8314 ("usb: chipidea: get rid of camelcase names")
---
 drivers/usb/chipidea/udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg Kroah-Hartman July 14, 2022, 2:09 p.m. UTC | #1
On Mon, Jul 11, 2022 at 06:25:03PM +0300, Andrey Strachuk wrote:
> Comparison of 'ep' with NULL is useless since
> 'ep' is a result of container_of and cannot be NULL
> in any reasonable scenario.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Andrey Strachuk <strochuk@ispras.ru>
> Fixes: 2dbc5c4c8314 ("usb: chipidea: get rid of camelcase names")
> ---
>  drivers/usb/chipidea/udc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Subject line is wrong :(

Also this is not a "Fix".
diff mbox series

Patch

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 3b8bf6daf7d0..8ce31f9933e1 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -933,7 +933,7 @@  static int _ep_queue(struct usb_ep *ep, struct usb_request *req,
 	struct ci_hdrc *ci = hwep->ci;
 	int retval = 0;
 
-	if (ep == NULL || req == NULL || hwep->ep.desc == NULL)
+	if (req == NULL || hwep->ep.desc == NULL)
 		return -EINVAL;
 
 	if (hwep->type == USB_ENDPOINT_XFER_CONTROL) {