Re: [linux-usb-devel] [PATCH 7/9] USB usbfs: destroy submitted urbs only on the disconnected interface

From: Oliver Neukum
Date: Wed Apr 14 2004 - 10:38:24 EST



> > Well, I don't. If you care about it, add a WARN_ON().
> > Checking without consequences is bad.
>
> Hi Oliver, how about this instead?
>
[..]
> - clear_bit(intf->cur_altsetting->desc.bInterfaceNumber, &ps->ifclaimed);
> + if (ifnum < 8*sizeof(ps->ifclaimed))
> + clear_bit(ifnum, &ps->ifclaimed);
> + else
> + warn("interface number %u out of range", ifnum);
> +

I would prefer a real WARN_ON() so that the imbedded people compiling
for size are not affected.

Regards
Oliver

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/