All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ide: insert BUG_ON() into __ide_set_handler() (take 2)
@ 2008-02-07 17:20 Sergei Shtylyov
  2008-02-07 20:45 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2008-02-07 17:20 UTC (permalink / raw)
  To: bzolnier; +Cc: linux-ide

Replace the check for hwgroup->handler and printk(KERN_CRIT, ...) at the start
of __ide_set_handler() with mere BUG_ON() while removing such from the caller,
ide_execute_command(). Fix up the code formatting, while at it...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
Oops, forgot to remove no longer needed variable... :-[

 drivers/ide/ide-iops.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

Index: linux-2.6/drivers/ide/ide-iops.c
===================================================================
--- linux-2.6.orig/drivers/ide/ide-iops.c
+++ linux-2.6/drivers/ide/ide-iops.c
@@ -786,15 +786,11 @@ static void __ide_set_handler (ide_drive
 {
 	ide_hwgroup_t *hwgroup = HWGROUP(drive);
 
-	if (hwgroup->handler != NULL) {
-		printk(KERN_CRIT "%s: ide_set_handler: handler not null; "
-			"old=%p, new=%p\n",
-			drive->name, hwgroup->handler, handler);
-	}
+	BUG_ON(hwgroup->handler);
 	hwgroup->handler	= handler;
 	hwgroup->expiry		= expiry;
 	hwgroup->timer.expires	= jiffies + timeout;
-	hwgroup->req_gen_timer = hwgroup->req_gen;
+	hwgroup->req_gen_timer	= hwgroup->req_gen;
 	add_timer(&hwgroup->timer);
 }
 
@@ -827,11 +823,9 @@ void ide_execute_command(ide_drive_t *dr
 			 unsigned timeout, ide_expiry_t *expiry)
 {
 	unsigned long flags;
-	ide_hwgroup_t *hwgroup = HWGROUP(drive);
 	ide_hwif_t *hwif = HWIF(drive);
 
 	spin_lock_irqsave(&ide_lock, flags);
-	BUG_ON(hwgroup->handler);
 	__ide_set_handler(drive, handler, timeout, expiry);
 	hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG);
 	/*


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ide: insert BUG_ON() into __ide_set_handler() (take 2)
  2008-02-07 17:20 [PATCH] ide: insert BUG_ON() into __ide_set_handler() (take 2) Sergei Shtylyov
@ 2008-02-07 20:45 ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-02-07 20:45 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-ide

On Thursday 07 February 2008, Sergei Shtylyov wrote:
> Replace the check for hwgroup->handler and printk(KERN_CRIT, ...) at the start
> of __ide_set_handler() with mere BUG_ON() while removing such from the caller,
> ide_execute_command(). Fix up the code formatting, while at it...
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

thanks, applied

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-07 20:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-07 17:20 [PATCH] ide: insert BUG_ON() into __ide_set_handler() (take 2) Sergei Shtylyov
2008-02-07 20:45 ` Bartlomiej Zolnierkiewicz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.