On Wednesday 10 September 2003 18:54, Greg KH wrote: > On Wed, Sep 10, 2003 at 12:52:45PM +0200, Duncan Sands wrote: > > speedtch.c | 7 +------ > > 1 files changed, 1 insertion(+), 6 deletions(-) > > > > > > diff -Nru a/drivers/usb/misc/speedtch.c b/drivers/usb/misc/speedtch.c > > --- a/drivers/usb/misc/speedtch.c Wed Sep 10 13:25:09 2003 > > +++ b/drivers/usb/misc/speedtch.c Wed Sep 10 13:25:09 2003 > > @@ -1293,14 +1293,9 @@ > > > > static int __init udsl_usb_init (void) > > { > > - struct sk_buff *skb; /* dummy for sizeof */ > > - > > dbg ("udsl_usb_init: driver version " DRIVER_VERSION); > > > > - if (sizeof (struct udsl_control) > sizeof (skb->cb)) { > > - printk (KERN_ERR __FILE__ ": unusable with this kernel!\n"); > > - return -EIO; > > - } > > + BUG_ON (sizeof (struct udsl_control) > sizeof (((struct sk_buff > > *)0)->cb)); > > No, I will not take a patch that adds any new BUG* calls to the usb > code. I know you already have some in this driver, and that really is > unacceptable. Device drivers should not shut down a system if they can > help it at all. The original code that returns an error code is > correct.
How about the patch below? > I will gladly take patches to remove the other calls to BUG_ON() in this > driver (hint...) What is the right thing to do when an assertion fails? i.e. some condition that should never occur occurs. In such cases it is not always reasonable to muddle on... Duncan. ---------- Neater sanity check. speedtch.c | 4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) diff -Nru a/drivers/usb/misc/speedtch.c b/drivers/usb/misc/speedtch.c --- a/drivers/usb/misc/speedtch.c Thu Sep 11 14:45:22 2003 +++ b/drivers/usb/misc/speedtch.c Thu Sep 11 14:45:22 2003 @@ -1293,11 +1293,9 @@ static int __init udsl_usb_init (void) { - struct sk_buff *skb; /* dummy for sizeof */ - dbg ("udsl_usb_init: driver version " DRIVER_VERSION); - if (sizeof (struct udsl_control) > sizeof (skb->cb)) { + if (sizeof (struct udsl_control) > sizeof (((struct sk_buff *)0)->cb)) { printk (KERN_ERR __FILE__ ": unusable with this kernel!\n"); return -EIO; } ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel