Skip to contentSkip to conversation

BUG_ON() Conversion in

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

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

PATCH 3/5 BUG_ON() Conversion in

hi,

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

drivers/s390/block/dasd_erp.c renamed from drivers/s390/block/dasd_erp.c.orig +3 -5
@@ -33,9 +33,8 @@ dasd_alloc_erp_request(char *magic, int 
 	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)
@@ -126,8 +125,7 @@ dasd_default_erp_postaction(struct dasd_
 	struct dasd_device *device;
 	int success;
 
-	if (cqr->refers == NULL || cqr->function == NULL)
-		BUG();
+	BUG_ON(cqr->refers == NULL || cqr->function == NULL);
 
 	device = cqr->device;
 	success = cqr->status == DASD_CQR_DONE;

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