diff options
Diffstat (limited to 'drivers/ata/pata_serverworks.c')
-rw-r--r-- | drivers/ata/pata_serverworks.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c index bf9452728d19..4b8c2352cdca 100644 --- a/drivers/ata/pata_serverworks.c +++ b/drivers/ata/pata_serverworks.c | |||
@@ -218,25 +218,18 @@ static unsigned long serverworks_osb4_filter(const struct ata_port *ap, struct a | |||
218 | static unsigned long serverworks_csb_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask) | 218 | static unsigned long serverworks_csb_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask) |
219 | { | 219 | { |
220 | const char *p; | 220 | const char *p; |
221 | char model_num[ATA_ID_PROD_LEN]; | 221 | char model_num[ATA_ID_PROD_LEN + 1]; |
222 | int len, i; | 222 | int i; |
223 | 223 | ||
224 | /* Disk, UDMA */ | 224 | /* Disk, UDMA */ |
225 | if (adev->class != ATA_DEV_ATA) | 225 | if (adev->class != ATA_DEV_ATA) |
226 | return ata_pci_default_filter(ap, adev, mask); | 226 | return ata_pci_default_filter(ap, adev, mask); |
227 | 227 | ||
228 | /* Actually do need to check */ | 228 | /* Actually do need to check */ |
229 | ata_id_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num)); | 229 | ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num)); |
230 | /* Precuationary - why not do this in the libata core ?? */ | ||
231 | 230 | ||
232 | len = strlen(model_num); | 231 | for (i = 0; (p = csb_bad_ata100[i]) != NULL; i++) { |
233 | while ((len > 0) && (model_num[len - 1] == ' ')) { | 232 | if (!strcmp(p, model_num)) |
234 | len--; | ||
235 | model_num[len] = 0; | ||
236 | } | ||
237 | |||
238 | for(i = 0; (p = csb_bad_ata100[i]) != NULL; i++) { | ||
239 | if (!strncmp(p, model_num, len)) | ||
240 | mask &= ~(0x1F << ATA_SHIFT_UDMA); | 233 | mask &= ~(0x1F << ATA_SHIFT_UDMA); |
241 | } | 234 | } |
242 | return ata_pci_default_filter(ap, adev, mask); | 235 | return ata_pci_default_filter(ap, adev, mask); |