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

Commit 0fcf12d5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6:
  tx493xide: use min_t() macro instead of min()
  drivers/ide: Use memdup_user
  via82cxxx: fix typo for VT6415 PCIE PATA IDE Host Controller support.
  ide-cd: Do not access completed requests in the irq handler
parents 4d15393d cd078af6
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -506,15 +506,22 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
	return (flags & REQ_FAILED) ? -EIO : 0;
}

static void ide_cd_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd)
/*
 * returns true if rq has been completed
 */
static bool ide_cd_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd)
{
	unsigned int nr_bytes = cmd->nbytes - cmd->nleft;

	if (cmd->tf_flags & IDE_TFLAG_WRITE)
		nr_bytes -= cmd->last_xfer_len;

	if (nr_bytes > 0)
	if (nr_bytes > 0) {
		ide_complete_rq(drive, 0, nr_bytes);
		return true;
	}

	return false;
}

static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
@@ -679,7 +686,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
		}

		if (uptodate == 0 && rq->bio)
			ide_cd_error_cmd(drive, cmd);
			if (ide_cd_error_cmd(drive, cmd))
				return ide_stopped;

		/* make sure it's fully ended */
		if (blk_fs_request(rq) == 0) {
+3 −7
Original line number Diff line number Diff line
@@ -480,13 +480,9 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
	u16 nsect		= 0;
	char __user *buf = (char __user *)arg;

	req_task = kzalloc(tasksize, GFP_KERNEL);
	if (req_task == NULL)
		return -ENOMEM;
	if (copy_from_user(req_task, buf, tasksize)) {
		kfree(req_task);
		return -EFAULT;
	}
	req_task = memdup_user(buf, tasksize);
	if (IS_ERR(req_task))
		return PTR_ERR(req_task);

	taskout = req_task->out_size;
	taskin  = req_task->in_size;
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ static void tx4938ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)

	pair = ide_get_pair_dev(drive);
	if (pair)
		safe = min(safe, pair->pio_mode - XFER_PIO_0);
		safe = min_t(u8, safe, pair->pio_mode - XFER_PIO_0);
	tx4938ide_tune_ebusc(pdata->ebus_ch, pdata->gbus_clock, safe);
}

+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ static void tx4939ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)

	pair = ide_get_pair_dev(drive);
	if (pair)
		safe = min(safe, pair->pio_mode - XFER_PIO_0);
		safe = min_t(u8, safe, pair->pio_mode - XFER_PIO_0);
	/*
	 * Update Command Transfer Mode for master/slave and Data
	 * Transfer Mode for this drive.
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ static struct via_isa_bridge {
	{ "vt8261",	PCI_DEVICE_ID_VIA_8261,     0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
	{ "vt8237s",	PCI_DEVICE_ID_VIA_8237S,    0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
	{ "vt6410",	PCI_DEVICE_ID_VIA_6410,     0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
	{ "vt6415",	PCI_DEVICE_ID_VIA_6410,     0x00, 0xff, ATA_UDMA6, VIA_BAD_AST },
	{ "vt6415",	PCI_DEVICE_ID_VIA_6415,     0x00, 0xff, ATA_UDMA6, VIA_BAD_AST },
	{ "vt8251",	PCI_DEVICE_ID_VIA_8251,     0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
	{ "vt8237",	PCI_DEVICE_ID_VIA_8237,     0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
	{ "vt8237a",	PCI_DEVICE_ID_VIA_8237A,    0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },