Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libata: kill dead code paths in reset path

Some code paths which had been made obsolete by recent reset
simplification were still around. Kill them.

* ata_eh_reset() checked for ATA_DEV_UNKNOWN to determine
classification failure. This is no longer applicable.

* ata_do_reset() should convert ATA_DEV_UNKNOWN to ATA_DEV_NONE
regardless of reset result (e.g. -EAGAIN).

* LLDs don't need to convert ATA_DEV_UNKNOWN to ATA_DEV_NONE.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

authored by

Tejun Heo and committed by
Jeff Garzik
2a0c15ca e50e3ce5

+1 -23
+1 -18
drivers/ata/libata-eh.c
··· 2052 2052 classes[dev->devno] = ATA_DEV_UNKNOWN; 2053 2053 2054 2054 rc = reset(link, classes, deadline); 2055 - if (rc) 2056 - return rc; 2057 2055 2058 2056 /* convert all ATA_DEV_UNKNOWN to ATA_DEV_NONE */ 2059 2057 ata_link_for_each_dev(dev, link) 2060 2058 if (classes[dev->devno] == ATA_DEV_UNKNOWN) 2061 2059 classes[dev->devno] = ATA_DEV_NONE; 2062 2060 2063 - return 0; 2061 + return rc; 2064 2062 } 2065 2063 2066 2064 static int ata_eh_followup_srst_needed(struct ata_link *link, ··· 2206 2208 /* -EAGAIN can happen if we skipped followup SRST */ 2207 2209 if (rc && rc != -EAGAIN) 2208 2210 goto fail; 2209 - 2210 - /* was classification successful? */ 2211 - if (classify && classes[0] == ATA_DEV_UNKNOWN && 2212 - !(lflags & ATA_LFLAG_ASSUME_CLASS)) { 2213 - if (try < max_tries) { 2214 - ata_link_printk(link, KERN_WARNING, 2215 - "classification failed\n"); 2216 - rc = -EINVAL; 2217 - goto fail; 2218 - } 2219 - 2220 - ata_link_printk(link, KERN_WARNING, 2221 - "classfication failed, assuming ATA\n"); 2222 - lflags |= ATA_LFLAG_ASSUME_ATA; 2223 - } 2224 2211 2225 2212 done: 2226 2213 ata_link_for_each_dev(dev, link) {
-2
drivers/ata/sata_inic162x.c
··· 428 428 429 429 ata_sff_tf_read(ap, &tf); 430 430 *class = ata_dev_classify(&tf); 431 - if (*class == ATA_DEV_UNKNOWN) 432 - *class = ATA_DEV_NONE; 433 431 } 434 432 435 433 return 0;
-3
drivers/ata/sata_sil24.c
··· 693 693 sil24_read_tf(ap, 0, &tf); 694 694 *class = ata_dev_classify(&tf); 695 695 696 - if (*class == ATA_DEV_UNKNOWN) 697 - *class = ATA_DEV_NONE; 698 - 699 696 out: 700 697 DPRINTK("EXIT, class=%u\n", *class); 701 698 return 0;