]> git.baikalelectronics.ru Git - kernel.git/commit
USB: gadget: udc: s3c2410_udc: Remove pointless NULL check in s3c2410_udc_nuke
authorNathan Chancellor <natechancellor@gmail.com>
Thu, 23 Apr 2020 16:29:24 +0000 (09:29 -0700)
committerFelipe Balbi <balbi@kernel.org>
Mon, 25 May 2020 08:09:39 +0000 (11:09 +0300)
commitb7674f1b16c40a86a56844c95ab6d7c099d8ec46
tree15200de81dd12f9b704d74e91a58e9f1850fdd04
parent49c95d28726fe83adc98a82fe647adc368e01f4d
USB: gadget: udc: s3c2410_udc: Remove pointless NULL check in s3c2410_udc_nuke

Clang warns:

drivers/usb/gadget/udc/s3c2410_udc.c:255:11: warning: comparison of
address of 'ep->queue' equal to a null pointer is always false
[-Wtautological-pointer-compare]
        if (&ep->queue == NULL)
             ~~~~^~~~~    ~~~~
1 warning generated.

It is not wrong, queue is not a pointer so if ep is not NULL, the
address of queue cannot be NULL. No other driver does a check like this
and this check has been around since the driver was first introduced,
presumably with no issues so it does not seem like this check should be
something else. Just remove it.

Commit 115c075d80d3e ("kbuild: Enable -Wtautological-compare") exposed
this but it is not the root cause of the warning.

Fixes: 9ade8ff3e2626 ("USB Gadget driver for Samsung s3c2410 ARM SoC")
Link: https://github.com/ClangBuiltLinux/linux/issues/1004
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/gadget/udc/s3c2410_udc.c