The mod operation has higher precedence than the divide but the intent
was to divide first.  It's supposed to count through one time for RX
and a second time for TX but instead of doing "0 1 2 0 1 2" it does
"0 0 1 1 2 2".

Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com>
---
Static checker stuff.  Untested.

diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c
index 3bc244d..3cd223c 100644
--- a/drivers/usb/chipidea/debug.c
+++ b/drivers/usb/chipidea/debug.c
@@ -709,7 +709,7 @@ static ssize_t show_requests(struct device *dev, struct 
device_attribute *attr,
 
                        n += scnprintf(buf + n, PAGE_SIZE - n,
                                        "EP=%02i: TD=%08X %s\n",
-                                       i % ci->hw_ep_max/2, (u32)req->dma,
+                                       i % (ci->hw_ep_max / 2), (u32)req->dma,
                                        ((i < ci->hw_ep_max/2) ? "RX" : "TX"));
 
                        for (j = 0; j < qSize; j++)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to