On 28/01/13 13:16, Dan Carpenter wrote:
The patch ae926051d7eb: "staging: ozwpan: Added USB HCD
implementation" from Feb 20, 2012, leads to the following warning:
drivers/staging/ozwpan/ozhcd.c:1094 oz_hcd_heartbeat()
warn: what is this condition about? 'ep->buffered_units * 50'
drivers/staging/ozwpan/ozhcd.c
1088 /* Check the IN isoc endpoints to see if any URBs can be completed.
1089 */
1090 spin_lock_bh(&ozhcd->hcd_lock);
1091 list_for_each(e, &port->isoc_in_ep) {
1092 struct oz_endpoint *ep = ep_from_link(e);
1093 if (ep->flags & OZ_F_EP_BUFFERING) {
1094 if (ep->buffered_units * OZ_IN_BUFFERING_UNITS) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It's not clear what we are testing for here. It would be false if
->buffered_units was zero or if the multiplication overflowed. If it's
testing for integer overflows, there are better ways to write that.
Thanks Dan,
That is certainly a bug. A patch is following this email which should
fix this bug.
Inbetween I am interested to know about tool which have found this warning.
Staging-next tree with gcc version 4.6.1, do not pop out above warning
for me.
--
Regards,
Rupesh Gujare
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel