diff options
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 77138a39eb04..915a55a6cc14 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -870,7 +870,11 @@ static unsigned int ata_id_xfermask(const u16 *id) | |||
870 | * the PIO timing number for the maximum. Turn it into | 870 | * the PIO timing number for the maximum. Turn it into |
871 | * a mask. | 871 | * a mask. |
872 | */ | 872 | */ |
873 | pio_mask = (2 << (id[ATA_ID_OLD_PIO_MODES] & 0xFF)) - 1 ; | 873 | u8 mode = id[ATA_ID_OLD_PIO_MODES] & 0xFF; |
874 | if (mode < 5) /* Valid PIO range */ | ||
875 | pio_mask = (2 << mode) - 1; | ||
876 | else | ||
877 | pio_mask = 1; | ||
874 | 878 | ||
875 | /* But wait.. there's more. Design your standards by | 879 | /* But wait.. there's more. Design your standards by |
876 | * committee and you too can get a free iordy field to | 880 | * committee and you too can get a free iordy field to |
@@ -5953,7 +5957,7 @@ static void __exit ata_exit(void) | |||
5953 | destroy_workqueue(ata_aux_wq); | 5957 | destroy_workqueue(ata_aux_wq); |
5954 | } | 5958 | } |
5955 | 5959 | ||
5956 | module_init(ata_init); | 5960 | subsys_initcall(ata_init); |
5957 | module_exit(ata_exit); | 5961 | module_exit(ata_exit); |
5958 | 5962 | ||
5959 | static unsigned long ratelimit_time; | 5963 | static unsigned long ratelimit_time; |
@@ -6118,7 +6122,6 @@ EXPORT_SYMBOL_GPL(ata_std_prereset); | |||
6118 | EXPORT_SYMBOL_GPL(ata_std_softreset); | 6122 | EXPORT_SYMBOL_GPL(ata_std_softreset); |
6119 | EXPORT_SYMBOL_GPL(sata_std_hardreset); | 6123 | EXPORT_SYMBOL_GPL(sata_std_hardreset); |
6120 | EXPORT_SYMBOL_GPL(ata_std_postreset); | 6124 | EXPORT_SYMBOL_GPL(ata_std_postreset); |
6121 | EXPORT_SYMBOL_GPL(ata_dev_revalidate); | ||
6122 | EXPORT_SYMBOL_GPL(ata_dev_classify); | 6125 | EXPORT_SYMBOL_GPL(ata_dev_classify); |
6123 | EXPORT_SYMBOL_GPL(ata_dev_pair); | 6126 | EXPORT_SYMBOL_GPL(ata_dev_pair); |
6124 | EXPORT_SYMBOL_GPL(ata_port_disable); | 6127 | EXPORT_SYMBOL_GPL(ata_port_disable); |