]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/pata_ns87415.c
select: deal with math overflow from borderline valid userland data
[linux-2.6-omap-h63xx.git] / drivers / ata / pata_ns87415.c
index ae92b0049bd55bb6b571e5569987498bc14bb87f..e0aa7eaaee0a4bf86b9174c8ee05b16e8bbff9fa 100644 (file)
@@ -66,8 +66,8 @@ static void ns87415_set_mode(struct ata_port *ap, struct ata_device *adev, u8 mo
 
        ata_timing_compute(adev, adev->pio_mode, &t, T, 0);
 
-       clocking = 17 - FIT(t.active, 2, 17);
-       clocking |= (16 - FIT(t.recover, 1, 16)) << 4;
+       clocking = 17 - clamp_val(t.active, 2, 17);
+       clocking |= (16 - clamp_val(t.recover, 1, 16)) << 4;
        /* Use the same timing for read and write bytes */
        clocking |= (clocking << 8);
        pci_write_config_word(dev, timing, clocking);