* [patch v2] usb: gadget: precedence bug in show_requests()
@ 2013-01-20 17:27 Dan Carpenter
2013-01-24 10:51 ` Alexander Shishkin
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-01-20 17:27 UTC (permalink / raw)
To: kernel-janitors
The intent here was to have parenthesis around the (ci->hw_ep_max / 2)
so that it counts like "0 1 2 0 1 2". In the current code, the mod
operation happens first so it counts like "0 0 1 1 2 2".
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: fixed the changelog. mod and divide have the same precedence
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++)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch v2] usb: gadget: precedence bug in show_requests()
2013-01-20 17:27 [patch v2] usb: gadget: precedence bug in show_requests() Dan Carpenter
@ 2013-01-24 10:51 ` Alexander Shishkin
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Shishkin @ 2013-01-24 10:51 UTC (permalink / raw)
To: kernel-janitors
Dan Carpenter <dan.carpenter@oracle.com> writes:
> The intent here was to have parenthesis around the (ci->hw_ep_max / 2)
> so that it counts like "0 1 2 0 1 2". In the current code, the mod
> operation happens first so it counts like "0 0 1 1 2 2".
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks, I added this one on top of my debug cleanup patchset [1].
[1] http://marc.info/?l=linux-usb&m\x135902438408860&w=2
Regards,
--
Alex
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-24 10:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-20 17:27 [patch v2] usb: gadget: precedence bug in show_requests() Dan Carpenter
2013-01-24 10:51 ` Alexander Shishkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox