]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: udc: bdc: Remove unnecessary NULL checks in bdc_req_complete
authorNathan Chancellor <natechancellor@gmail.com>
Sun, 29 Mar 2020 01:12:46 +0000 (18:12 -0700)
committerFelipe Balbi <balbi@kernel.org>
Thu, 16 Apr 2020 08:02:26 +0000 (11:02 +0300)
commit9521802a6923da26aa4728cdd475474095a871e0
tree841c55a4cdd544b7e27dba6d4629429686a6af27
parent9b8057e7f937f20763a90a8fc2333168af101732
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: 437e57c5103d ("usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC")
Link: https://github.com/ClangBuiltLinux/linux/issues/749
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/gadget/udc/bdc/bdc_ep.c