diff options
Diffstat (limited to 'drivers/ata/pata_hpt366.c')
-rw-r--r-- | drivers/ata/pata_hpt366.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c index 81deb2c3824c..2202c7ec16e3 100644 --- a/drivers/ata/pata_hpt366.c +++ b/drivers/ata/pata_hpt366.c | |||
@@ -151,23 +151,13 @@ static const char *bad_ata66_3[] = { | |||
151 | 151 | ||
152 | static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[]) | 152 | static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[]) |
153 | { | 153 | { |
154 | unsigned char model_num[ATA_ID_PROD_LEN]; | 154 | unsigned char model_num[ATA_ID_PROD_LEN + 1]; |
155 | char *s; | ||
156 | unsigned int len; | ||
157 | int i = 0; | 155 | int i = 0; |
158 | 156 | ||
159 | ata_id_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); | 157 | ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); |
160 | s = &model_num[0]; | ||
161 | len = strnlen(s, sizeof(model_num)); | ||
162 | 158 | ||
163 | /* ATAPI specifies that empty space is blank-filled; remove blanks */ | 159 | while (list[i] != NULL) { |
164 | while ((len > 0) && (s[len - 1] == ' ')) { | 160 | if (!strcmp(list[i], model_num)) { |
165 | len--; | ||
166 | s[len] = 0; | ||
167 | } | ||
168 | |||
169 | while(list[i] != NULL) { | ||
170 | if (!strncmp(list[i], s, len)) { | ||
171 | printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", | 161 | printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", |
172 | modestr, list[i]); | 162 | modestr, list[i]); |
173 | return 1; | 163 | return 1; |