History

ata: start separating SATA specific code from libata-scsi.c

Start separating SATA specific code from libata-scsi.c: * un-static ata_scsi_find_dev() * move following code to libata-sata.c: - SATA only sysfs device attributes handling - __ata_change_queue_depth() - ata_scsi_change_queue_depth() * cover with CONFIG_SATA_HOST ifdef SATA only sysfs device attributes handling code and ATA_SHT_NCQ() macro in <linux/libata.h> Code size savings on m68k arch using (modified) atari_defconfig: text data bss dec hex filename before: 20702 105 576 21383 5387 drivers/ata/libata-scsi.o after: 19137 23 576 19736 4d18 drivers/ata/libata-scsi.o

Bartlomiej Zolnierkiewicz committed 6 years ago

Commit ec811a91 parent 2b384ed4 files · +308 −302Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/libata.h+7−2
@@ -530,12 +530,14 @@ typedef int (*ata_reset_fn_t)(struct ata_link *link, unsigned int *classes, · 529 unmodified lines
530530 unsigned long deadline);
531531 typedef void (*ata_postreset_fn_t)(struct ata_link *link, unsigned int *classes);
532532
533−extern struct device_attribute dev_attr_link_power_management_policy;
534533 extern struct device_attribute dev_attr_unload_heads;
534+#ifdef CONFIG_SATA_HOST
535+extern struct device_attribute dev_attr_link_power_management_policy;
535536 extern struct device_attribute dev_attr_ncq_prio_enable;
536537 extern struct device_attribute dev_attr_em_message_type;
537538 extern struct device_attribute dev_attr_em_message;
538539 extern struct device_attribute dev_attr_sw_activity;
540+#endif
539541
540542 enum sw_activity {
541543 OFF,
@@ -1371,7 +1373,6 @@ extern int ata_link_nr_enabled(struct ata_link *link); · 829 unmodified lines
13711373 extern const struct ata_port_operations ata_base_port_ops;
13721374 extern const struct ata_port_operations sata_port_ops;
13731375 extern struct device_attribute *ata_common_sdev_attrs[];
1374−extern struct device_attribute *ata_ncq_sdev_attrs[];
13751376
13761377 /*
13771378 * All sht initializers (BASE, PIO, BMDMA, NCQ) must be instantiated
@@ -1399,10 +1400,14 @@ extern struct device_attribute *ata_ncq_sdev_attrs[]; · 21 unmodified lines
13991400 __ATA_BASE_SHT(drv_name), \
14001401 .sdev_attrs = ata_common_sdev_attrs
14011402
1403+#ifdef CONFIG_SATA_HOST
1404+extern struct device_attribute *ata_ncq_sdev_attrs[];
1405+
14021406 #define ATA_NCQ_SHT(drv_name) \
14031407 __ATA_BASE_SHT(drv_name), \
14041408 .sdev_attrs = ata_ncq_sdev_attrs, \
14051409 .change_queue_depth = ata_scsi_change_queue_depth
1410+#endif
14061411
14071412 /*
14081413 * PMP helpers