Skip to contentSkip to conversation

ide: remove redundant BUG_ON() from [atapi_]reset_pollfunc()

PATCH In review Bartlomiej Zolnierkiewicz 2 participants 4 messages Feb 2, 2008 – Feb 7, 2008 libata

lore
Share & tools
lore
#0 lore raw

PATCH 2/5 ide: remove redundant BUG_ON() from [atapi_]reset_pollfunc()

Same BUG_ON() is present inside ide_set_handler().

---
 drivers/ide/ide-iops.c |    2 --
 1 file changed, 2 deletions(-)
drivers/ide/ide-iops.c +0 -2
Index: b/drivers/ide/ide-iops.c
===================================================================
@@ -860,7 +860,6 @@ static ide_startstop_t atapi_reset_pollf
 		printk("%s: ATAPI reset complete\n", drive->name);
 	} else {
 		if (time_before(jiffies, hwgroup->poll_timeout)) {
-			BUG_ON(HWGROUP(drive)->handler != NULL);
 			ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20, NULL);
 			/* continue polling */
 			return ide_started;
@@ -900,7 +899,6 @@ static ide_startstop_t reset_pollfunc (i
 
 	if (!OK_STAT(tmp = hwif->INB(IDE_STATUS_REG), 0, BUSY_STAT)) {
 		if (time_before(jiffies, hwgroup->poll_timeout)) {
-			BUG_ON(HWGROUP(drive)->handler != NULL);
 			ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL);
 			/* continue polling */
 			return ide_started;
#2 lore raw
Quoted 6 lines · Sergei Shtylyov
Quoted 1 line · Bartlomiej Zolnierkiewicz

Same BUG_ON() is present inside ide_set_handler().

There is no BUG_ON there -- __ide_set_handler() has a check for the same
condition and a printk(KERN_CRIT)... myabe it should be replaced with BUG_ON()...

Yeah, you're right - care to make a patch?

Quoted 5 lines
Quoted 1 line

MBR, Sergei

#3 lore raw
Quoted 6 lines · Bartlomiej Zolnierkiewicz
Quoted 4 lines
Quoted 1 line

Same BUG_ON() is present inside ide_set_handler().

There is no BUG_ON there -- __ide_set_handler() has a check for the same
condition and a printk(KERN_CRIT)... myabe it should be replaced with BUG_ON()...

Yeah, you're right - care to make a patch?

Replacing printk() with BUG_ON() and also removing BUG_ON() from
ide_execute_command()? OK, will do...

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

MBR, Sergei