[KJ] [Patch] BUG_ON conversion for drivers/media/video/pwc/pwc-if.c

Eric Sesterhenn snakebyte at gmx.de
Mon Sep 18 14:38:56 PDT 2006


hi,

this patch converts a 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/media/video/pwc/pwc-if.c.orig	2006-09-18 23:30:21.000000000 +0200
+++ linux-2.6.18-rc7/drivers/media/video/pwc/pwc-if.c	2006-09-18 23:30:36.000000000 +0200
@@ -1082,8 +1082,7 @@ static int pwc_video_open(struct inode *
 	PWC_DEBUG_OPEN(">> video_open called(vdev = 0x%p).\n", vdev);
 
 	pdev = (struct pwc_device *)vdev->priv;
-	if (pdev == NULL)
-		BUG();
+	BUG_ON(!pdev);
 	if (pdev->vopen) {
 		PWC_DEBUG_OPEN("I'm busy, someone is using the device.\n");
 		return -EBUSY;





More information about the Kernel-janitors mailing list