Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6

* 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

+17 -13
+11 -3
drivers/ide/ide-cd.c
··· 506 506 return (flags & REQ_FAILED) ? -EIO : 0; 507 507 } 508 508 509 - static void ide_cd_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd) 509 + /* 510 + * returns true if rq has been completed 511 + */ 512 + static bool ide_cd_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd) 510 513 { 511 514 unsigned int nr_bytes = cmd->nbytes - cmd->nleft; 512 515 513 516 if (cmd->tf_flags & IDE_TFLAG_WRITE) 514 517 nr_bytes -= cmd->last_xfer_len; 515 518 516 - if (nr_bytes > 0) 519 + if (nr_bytes > 0) { 517 520 ide_complete_rq(drive, 0, nr_bytes); 521 + return true; 522 + } 523 + 524 + return false; 518 525 } 519 526 520 527 static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) ··· 686 679 } 687 680 688 681 if (uptodate == 0 && rq->bio) 689 - ide_cd_error_cmd(drive, cmd); 682 + if (ide_cd_error_cmd(drive, cmd)) 683 + return ide_stopped; 690 684 691 685 /* make sure it's fully ended */ 692 686 if (blk_fs_request(rq) == 0) {
+3 -7
drivers/ide/ide-taskfile.c
··· 480 480 u16 nsect = 0; 481 481 char __user *buf = (char __user *)arg; 482 482 483 - req_task = kzalloc(tasksize, GFP_KERNEL); 484 - if (req_task == NULL) 485 - return -ENOMEM; 486 - if (copy_from_user(req_task, buf, tasksize)) { 487 - kfree(req_task); 488 - return -EFAULT; 489 - } 483 + req_task = memdup_user(buf, tasksize); 484 + if (IS_ERR(req_task)) 485 + return PTR_ERR(req_task); 490 486 491 487 taskout = req_task->out_size; 492 488 taskin = req_task->in_size;
+1 -1
drivers/ide/tx4938ide.c
··· 64 64 65 65 pair = ide_get_pair_dev(drive); 66 66 if (pair) 67 - safe = min(safe, pair->pio_mode - XFER_PIO_0); 67 + safe = min_t(u8, safe, pair->pio_mode - XFER_PIO_0); 68 68 tx4938ide_tune_ebusc(pdata->ebus_ch, pdata->gbus_clock, safe); 69 69 } 70 70
+1 -1
drivers/ide/tx4939ide.c
··· 114 114 115 115 pair = ide_get_pair_dev(drive); 116 116 if (pair) 117 - safe = min(safe, pair->pio_mode - XFER_PIO_0); 117 + safe = min_t(u8, safe, pair->pio_mode - XFER_PIO_0); 118 118 /* 119 119 * Update Command Transfer Mode for master/slave and Data 120 120 * Transfer Mode for this drive.
+1 -1
drivers/ide/via82cxxx.c
··· 79 79 { "vt8261", PCI_DEVICE_ID_VIA_8261, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 80 80 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 81 81 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 82 - { "vt6415", PCI_DEVICE_ID_VIA_6410, 0x00, 0xff, ATA_UDMA6, VIA_BAD_AST }, 82 + { "vt6415", PCI_DEVICE_ID_VIA_6415, 0x00, 0xff, ATA_UDMA6, VIA_BAD_AST }, 83 83 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 84 84 { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 85 85 { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },