Skip to content

Commit 5e237e8

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide
Pull IDE updates from David Miller: 1) Fix mem region name in tx4949ide driver, from Christophe JAILLET. 2) Make drive->dn read only, it should not be changeable by users. From Dan Carpenter. 3) Several cast fixups from Krzysztof Kozlowski. There is also going to be a removal of a now unused IDE driver, but that will come via the MIPS tree. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide: ide: make drive->dn read only ide: serverworks: potential overflow in svwks_set_pio_mode() cmd64x: potential buffer overflow in cmd64x_program_timings() ide: remove unneeded header include path to drivers/ide ide: qd65xx: Fix cast to pointer from integer of different size ide: ht6560b: Fix cast to pointer from integer of different size ide: remove set but not used variable 'hwif' ide: remove unnecessary touch_softlockup_watchdog ide: tx4939ide: Fix the name used in a 'devm_request_mem_region()' call ide: Use dev_get_drvdata where possible
2 parents 9ca4c64 + 2fd3c5c commit 5e237e8

File tree

12 files changed

+20
-13
lines changed

12 files changed

+20
-13
lines changed

drivers/ide/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# link order is important here
44
#
55

6-
ccflags-y := -Idrivers/ide
7-
86
ide-core-y += ide.o ide-ioctls.o ide-io.o ide-iops.o ide-lib.o ide-probe.o \
97
ide-taskfile.o ide-pm.o ide-park.o ide-sysfs.o ide-devsets.o \
108
ide-io-std.o ide-eh.o

drivers/ide/cmd64x.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ static void cmd64x_program_timings(ide_drive_t *drive, u8 mode)
6666
struct ide_timing t;
6767
u8 arttim = 0;
6868

69+
if (drive->dn >= ARRAY_SIZE(drwtim_regs))
70+
return;
71+
6972
ide_timing_compute(drive, mode, &t, T, 0);
7073

7174
/*

drivers/ide/ht6560b.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ static void __init ht6560b_init_dev(ide_drive_t *drive)
310310
{
311311
ide_hwif_t *hwif = drive->hwif;
312312
/* Setting default configurations for drives. */
313-
int t = (HT_CONFIG_DEFAULT << 8) | HT_TIMING_DEFAULT;
313+
unsigned long t = (HT_CONFIG_DEFAULT << 8) | HT_TIMING_DEFAULT;
314314

315315
if (hwif->channel)
316316
t |= (HT_SECONDARY_IF << 8);

drivers/ide/ide-iops.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,6 @@ int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout)
530530
*/
531531
if (stat == 0xff)
532532
return -ENODEV;
533-
touch_softlockup_watchdog();
534533
touch_nmi_watchdog();
535534
}
536535
return -EBUSY;

drivers/ide/ide-proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static int set_xfer_rate (ide_drive_t *drive, int arg)
206206
ide_devset_rw(current_speed, xfer_rate);
207207
ide_devset_rw_field(init_speed, init_speed);
208208
ide_devset_rw_flag(nice1, IDE_DFLAG_NICE1);
209-
ide_devset_rw_field(number, dn);
209+
ide_devset_ro_field(number, dn);
210210

211211
static const struct ide_proc_devset ide_generic_settings[] = {
212212
IDE_PROC_DEVSET(current_speed, 0, 70),

drivers/ide/pmac.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,6 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, struct ide_hw *hw)
10191019
struct device_node *np = pmif->node;
10201020
const int *bidp;
10211021
struct ide_host *host;
1022-
ide_hwif_t *hwif;
10231022
struct ide_hw *hws[] = { hw };
10241023
struct ide_port_info d = pmac_port_info;
10251024
int rc;
@@ -1075,7 +1074,7 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, struct ide_hw *hw)
10751074
rc = -ENOMEM;
10761075
goto bail;
10771076
}
1078-
hwif = pmif->hwif = host->ports[0];
1077+
pmif->hwif = host->ports[0];
10791078

10801079
if (on_media_bay(pmif)) {
10811080
/* Fixup bus ID for media bay */

drivers/ide/qd65xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ static void __init qd6500_init_dev(ide_drive_t *drive)
299299
static void __init qd6580_init_dev(ide_drive_t *drive)
300300
{
301301
ide_hwif_t *hwif = drive->hwif;
302-
u16 t1, t2;
302+
unsigned long t1, t2;
303303
u8 base = (hwif->config_data & 0xff00) >> 8;
304304
u8 config = QD_CONFIG(hwif);
305305

drivers/ide/serverworks.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ static void svwks_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
115115
struct pci_dev *dev = to_pci_dev(hwif->dev);
116116
const u8 pio = drive->pio_mode - XFER_PIO_0;
117117

118+
if (drive->dn >= ARRAY_SIZE(drive_pci))
119+
return;
120+
118121
pci_write_config_byte(dev, drive_pci[drive->dn], pio_modes[pio]);
119122

120123
if (svwks_csb_check(dev)) {
@@ -141,6 +144,9 @@ static void svwks_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
141144

142145
u8 ultra_enable = 0, ultra_timing = 0, dma_timing = 0;
143146

147+
if (drive->dn >= ARRAY_SIZE(drive_pci2))
148+
return;
149+
144150
pci_read_config_byte(dev, (0x56|hwif->channel), &ultra_timing);
145151
pci_read_config_byte(dev, 0x54, &ultra_enable);
146152

drivers/ide/siimage.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,7 @@ static void sil_quirkproc(ide_drive_t *drive)
648648

649649
static void init_iops_siimage(ide_hwif_t *hwif)
650650
{
651-
struct pci_dev *dev = to_pci_dev(hwif->dev);
652-
struct ide_host *host = pci_get_drvdata(dev);
651+
struct ide_host *host = dev_get_drvdata(hwif->dev);
653652

654653
hwif->hwif_data = NULL;
655654

drivers/ide/tx4939ide.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ static int __init tx4939ide_probe(struct platform_device *pdev)
549549
return -ENODEV;
550550

551551
if (!devm_request_mem_region(&pdev->dev, res->start,
552-
resource_size(res), "tx4938ide"))
552+
resource_size(res), MODNAME))
553553
return -EBUSY;
554554
mapbase = (unsigned long)devm_ioremap(&pdev->dev, res->start,
555555
resource_size(res));

0 commit comments

Comments
 (0)