Skip to contentSkip to conversation

BUG_ON() Conversion in drivers/s390/block/dasd.c

PATCH New Eric Sesterhenn / snakebyte 1 participant 1 message Jan 31, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 BUG_ON() Conversion in drivers/s390/block/dasd.c

hi,

this changes if() BUG(); constructs to BUG_ON() which is cleaner, contains unlikely() and can better optimized away.

drivers/s390/block/dasd.c renamed from drivers/s390/block/dasd.c.orig +4 -6
@@ -517,9 +517,8 @@ dasd_kmalloc_request(char *magic, int cp
 	struct dasd_ccw_req *cqr;
 
 	/* Sanity checks */
-	if ( magic == NULL || datasize > PAGE_SIZE ||
-	     (cplength*sizeof(struct ccw1)) > PAGE_SIZE)
-		BUG();
+	BUG_ON( magic == NULL || datasize > PAGE_SIZE ||
+	     (cplength*sizeof(struct ccw1)) > PAGE_SIZE);
 
 	cqr = kmalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC);
 	if (cqr == NULL)
@@ -562,9 +561,8 @@ dasd_smalloc_request(char *magic, int cp
 	int size;
 
 	/* Sanity checks */
-	if ( magic == NULL || datasize > PAGE_SIZE ||
-	     (cplength*sizeof(struct ccw1)) > PAGE_SIZE)
-		BUG();
+	BUG_ON( magic == NULL || datasize > PAGE_SIZE ||
+	     (cplength*sizeof(struct ccw1)) > PAGE_SIZE);
 
 	size = (sizeof(struct dasd_ccw_req) + 7L) & -8L;
 	if (cplength > 0)

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors