Commit 7a0fbcf7 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Felipe Balbi

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 afe956c5 ("kbuild: Enable -Wtautological-compare") exposed
this but it is not the root cause of the warning.

Fixes: 3fc154b6 ("USB Gadget driver for Samsung s3c2410 ARM SoC")
Link: https://github.com/ClangBuiltLinux/linux/issues/1004Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
parent 3affccdd
...@@ -251,10 +251,6 @@ static void s3c2410_udc_done(struct s3c2410_ep *ep, ...@@ -251,10 +251,6 @@ static void s3c2410_udc_done(struct s3c2410_ep *ep,
static void s3c2410_udc_nuke(struct s3c2410_udc *udc, static void s3c2410_udc_nuke(struct s3c2410_udc *udc,
struct s3c2410_ep *ep, int status) struct s3c2410_ep *ep, int status)
{ {
/* Sanity check */
if (&ep->queue == NULL)
return;
while (!list_empty(&ep->queue)) { while (!list_empty(&ep->queue)) {
struct s3c2410_request *req; struct s3c2410_request *req;
req = list_entry(ep->queue.next, struct s3c2410_request, req = list_entry(ep->queue.next, struct s3c2410_request,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment