Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 125e1874 authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by Linus Torvalds
Browse files

[PATCH] More BUG_ON conversion



Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Acked-by: default avatar"Salyzyn, Mark" <mark_salyzyn@adaptec.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 78ce89c9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -814,7 +814,7 @@ void __init setup_arch(char **cmdline_p)
	 * - by now the stack is part of the init task */
	printk("Memory %08lx-%08lx\n", memory_start, memory_end);

	if (memory_start == memory_end) BUG();
	BUG_ON(memory_start == memory_end);

	init_mm.start_code = (unsigned long) &_stext;
	init_mm.end_code = (unsigned long) &_etext;
+1 −2
Original line number Diff line number Diff line
@@ -1725,8 +1725,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
		}
	}

	if (HWGROUP(drive)->handler != NULL)
		BUG();
	BUG_ON(HWGROUP(drive)->handler != NULL);

	ide_set_handler(drive, cdrom_newpc_intr, rq->timeout, NULL);
	return ide_started;
+2 −4
Original line number Diff line number Diff line
@@ -206,8 +206,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)
	ide_hwif_t *hwif = HWIF(drive);
	struct scatterlist *sg = hwif->sg_table;

	if ((rq->flags & REQ_DRIVE_TASKFILE) && rq->nr_sectors > 256)
		BUG();
	BUG_ON((rq->flags & REQ_DRIVE_TASKFILE) && rq->nr_sectors > 256);

	ide_map_sg(drive, rq);

@@ -947,8 +946,7 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
	}
	printk("\n");

	if (!(hwif->dma_master))
		BUG();
	BUG_ON(!hwif->dma_master);
}

EXPORT_SYMBOL_GPL(ide_setup_dma);
+4 −8
Original line number Diff line number Diff line
@@ -898,8 +898,7 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive)
					"to send us more data than expected "
					"- discarding data\n");
				idefloppy_discard_data(drive,bcount.all);
				if (HWGROUP(drive)->handler != NULL)
					BUG();
				BUG_ON(HWGROUP(drive)->handler != NULL);
				ide_set_handler(drive,
						&idefloppy_pc_intr,
						IDEFLOPPY_WAIT_CMD,
@@ -932,8 +931,7 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive)
	pc->actually_transferred += bcount.all;
	pc->current_position += bcount.all;

	if (HWGROUP(drive)->handler != NULL)
		BUG();
	BUG_ON(HWGROUP(drive)->handler != NULL);
	ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL);		/* And set the interrupt handler again */
	return ide_started;
}
@@ -960,8 +958,7 @@ static ide_startstop_t idefloppy_transfer_pc (ide_drive_t *drive)
				"issuing a packet command\n");
		return ide_do_reset(drive);
	}
	if (HWGROUP(drive)->handler != NULL)
		BUG();
	BUG_ON(HWGROUP(drive)->handler != NULL);
	/* Set the interrupt routine */
	ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL);
	/* Send the actual packet */
@@ -1017,8 +1014,7 @@ static ide_startstop_t idefloppy_transfer_pc1 (ide_drive_t *drive)
	 * 40 and 50msec work well. idefloppy_pc_intr will not be actually
	 * used until after the packet is moved in about 50 msec.
	 */
	if (HWGROUP(drive)->handler != NULL)
		BUG();
	BUG_ON(HWGROUP(drive)->handler != NULL);
	ide_set_handler(drive, 
	  &idefloppy_pc_intr, 		/* service routine for packet command */
	  floppy->ticks,		/* wait this long before "failing" */
+4 −8
Original line number Diff line number Diff line
@@ -939,8 +939,7 @@ void ide_execute_command(ide_drive_t *drive, task_ioreg_t cmd, ide_handler_t *ha
	
	spin_lock_irqsave(&ide_lock, flags);
	
	if(hwgroup->handler)
		BUG();
	BUG_ON(hwgroup->handler);
	hwgroup->handler	= handler;
	hwgroup->expiry		= expiry;
	hwgroup->timer.expires	= jiffies + timeout;
@@ -981,8 +980,7 @@ static ide_startstop_t atapi_reset_pollfunc (ide_drive_t *drive)
		printk("%s: ATAPI reset complete\n", drive->name);
	} else {
		if (time_before(jiffies, hwgroup->poll_timeout)) {
			if (HWGROUP(drive)->handler != NULL)
				BUG();
			BUG_ON(HWGROUP(drive)->handler != NULL);
			ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20, NULL);
			/* continue polling */
			return ide_started;
@@ -1021,8 +1019,7 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)

	if (!OK_STAT(tmp = hwif->INB(IDE_STATUS_REG), 0, BUSY_STAT)) {
		if (time_before(jiffies, hwgroup->poll_timeout)) {
			if (HWGROUP(drive)->handler != NULL)
				BUG();
			BUG_ON(HWGROUP(drive)->handler != NULL);
			ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL);
			/* continue polling */
			return ide_started;
@@ -1138,8 +1135,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
	hwgroup = HWGROUP(drive);

	/* We must not reset with running handlers */
	if(hwgroup->handler != NULL)
		BUG();
	BUG_ON(hwgroup->handler != NULL);

	/* For an ATAPI device, first try an ATAPI SRST. */
	if (drive->media != ide_disk && !do_not_try_atapi) {
Loading