Skip to content

Commit 09b04ab

Browse files
nathanchancefelipebalbi
authored andcommitted
usb: gadget: udc: bdc: Remove unnecessary NULL checks in bdc_req_complete
When building with Clang + -Wtautological-pointer-compare: drivers/usb/gadget/udc/bdc/bdc_ep.c:543:28: warning: comparison of address of 'req->queue' equal to a null pointer is always false [-Wtautological-pointer-compare] if (req == NULL || &req->queue == NULL || &req->usb_req == NULL) ~~~~~^~~~~ ~~~~ drivers/usb/gadget/udc/bdc/bdc_ep.c:543:51: warning: comparison of address of 'req->usb_req' equal to a null pointer is always false [-Wtautological-pointer-compare] if (req == NULL || &req->queue == NULL || &req->usb_req == NULL) ~~~~~^~~~~~~ ~~~~ 2 warnings generated. As it notes, these statements will always evaluate to false so remove them. Fixes: efed421 ("usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC") Link: ClangBuiltLinux#749 Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 8f3d9f3 commit 09b04ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/gadget/udc/bdc/bdc_ep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ static void bdc_req_complete(struct bdc_ep *ep, struct bdc_req *req,
540540
{
541541
struct bdc *bdc = ep->bdc;
542542

543-
if (req == NULL || &req->queue == NULL || &req->usb_req == NULL)
543+
if (req == NULL)
544544
return;
545545

546546
dev_dbg(bdc->dev, "%s ep:%s status:%d\n", __func__, ep->name, status);

0 commit comments

Comments
 (0)