Thread (23 messages) flat view 23 messages, 8 authors, 2012-06-12
STALE5213d

[PATCH 3/7] drivers/usb/gadget/pch_udc.c: adjust suspicious bit operation

From: Julia Lawall <hidden>
Date: 2012-06-06 21:44:05
Also in: lkml
Subsystem: the rest, usb subsystem · Maintainers: Linus Torvalds, Greg Kroah-Hartman

From: Julia Lawall <redacted>

PCH_UDC_DMA_LAST is 0x08000000 so a bit-or with this value always gives a
nonzero result.  The test is rewritten as done elsewhere in the same file.

This problem was found using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <redacted>

---
 drivers/usb/gadget/pch_udc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
index 1cfcc9e..79f7a53 100644
--- a/drivers/usb/gadget/pch_udc.c
+++ b/drivers/usb/gadget/pch_udc.c
@@ -2208,7 +2208,8 @@ static void pch_udc_complete_receiver(struct pch_udc_ep *ep)
 			return;
 		}
 		if ((td->status & PCH_UDC_BUFF_STS) = PCH_UDC_BS_DMA_DONE)
-			if (td->status | PCH_UDC_DMA_LAST) {
+			if ((td_data->status & PCH_UDC_DMA_LAST)
+			    = PCH_UDC_DMA_LAST) {
 				count = td->status & PCH_UDC_RXTX_BYTES;
 				break;
 			}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help