USB: EHCI: remove useless test
authorAlan Stern <stern@rowland.harvard.edu>
Wed, 19 Sep 2012 21:00:55 +0000 (17:00 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Sep 2012 16:37:53 +0000 (09:37 -0700)
This patch (as1605) removes a useless test from the EHCI debugfs
code.  There's no point checking whether p.qh is non-NULL; we already
know it is and in any case it gets dereferenced aerlier in the
function.

The useless test was identified by smatch.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-dbg.c

index f0c00de035efffedea7d550376ce2420cc82f26c..1599806e3d47cddd7de228a4bb779b2a5e11fdd9 100644 (file)
@@ -653,10 +653,8 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
                                                seen [seen_count++].qh = p.qh;
                                } else
                                        temp = 0;
-                               if (p.qh) {
-                                       tag = Q_NEXT_TYPE(ehci, hw->hw_next);
-                                       p = p.qh->qh_next;
-                               }
+                               tag = Q_NEXT_TYPE(ehci, hw->hw_next);
+                               p = p.qh->qh_next;
                                break;
                        case Q_TYPE_FSTN:
                                temp = scnprintf (next, size,