[KJ] [Patch] BUG_ON conversion for drivers/usb/input/wacom.c

Eric Sesterhenn snakebyte at gmx.de
Mon Sep 18 15:34:12 PDT 2006


hi,

this patch converts two if () BUG(); construct to BUG_ON();
which occupies less space, uses unlikely and is safer when
BUG() is disabled.

Signed-off-by: Eric Sesterhenn <snakebyte at gmx.de>

--- linux-2.6.18-rc7/drivers/usb/input/wacom.c.orig	2006-09-18 23:45:10.000000000 +0200
+++ linux-2.6.18-rc7/drivers/usb/input/wacom.c	2006-09-18 23:45:37.000000000 +0200
@@ -870,8 +870,7 @@ static int wacom_probe(struct usb_interf
 	strlcat(wacom->phys, "/input0", sizeof(wacom->phys));
 
 	wacom->features = wacom_features + (id - wacom_ids);
-	if (wacom->features->pktlen > 10)
-		BUG();
+	BUG_ON(wacom->features->pktlen > 10);
 
 	input_dev->name = wacom->features->name;
 	usb_to_input_id(dev, &input_dev->id);
@@ -936,8 +935,7 @@ static int wacom_probe(struct usb_interf
 
 	endpoint = &intf->cur_altsetting->endpoint[0].desc;
 
-	if (wacom->features->pktlen > 10)
-		BUG();
+	BUG_ON(wacom->features->pktlen > 10);
 
 	usb_fill_int_urb(wacom->irq, dev,
 			 usb_rcvintpipe(dev, endpoint->bEndpointAddress),





More information about the Kernel-janitors mailing list