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
530 unsigned long deadline);530 unsigned long deadline);
531typedef void (*ata_postreset_fn_t)(struct ata_link *link, unsigned int *classes);531typedef void (*ata_postreset_fn_t)(struct ata_link *link, unsigned int *classes);
532 532
533extern struct device_attribute dev_attr_link_power_management_policy;
534extern struct device_attribute dev_attr_unload_heads;533extern struct device_attribute dev_attr_unload_heads;
534#ifdef CONFIG_SATA_HOST
535extern struct device_attribute dev_attr_link_power_management_policy;
535extern struct device_attribute dev_attr_ncq_prio_enable;536extern struct device_attribute dev_attr_ncq_prio_enable;
536extern struct device_attribute dev_attr_em_message_type;537extern struct device_attribute dev_attr_em_message_type;
537extern struct device_attribute dev_attr_em_message;538extern struct device_attribute dev_attr_em_message;
538extern struct device_attribute dev_attr_sw_activity;539extern struct device_attribute dev_attr_sw_activity;
540#endif
539 541
540enum sw_activity {542enum sw_activity {
541 OFF,543 OFF,
@@ -1371,7 +1373,6 @@ extern int ata_link_nr_enabled(struct ata_link *link); · 829 unmodified lines
1371extern const struct ata_port_operations ata_base_port_ops;1373extern const struct ata_port_operations ata_base_port_ops;
1372extern const struct ata_port_operations sata_port_ops;1374extern const struct ata_port_operations sata_port_ops;
1373extern struct device_attribute *ata_common_sdev_attrs[];1375extern struct device_attribute *ata_common_sdev_attrs[];
1374extern struct device_attribute *ata_ncq_sdev_attrs[];
1375 1376
1376/*1377/*
1377 * All sht initializers (BASE, PIO, BMDMA, NCQ) must be instantiated1378 * 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
1399 __ATA_BASE_SHT(drv_name), \1400 __ATA_BASE_SHT(drv_name), \
1400 .sdev_attrs = ata_common_sdev_attrs1401 .sdev_attrs = ata_common_sdev_attrs
1401 1402
1403#ifdef CONFIG_SATA_HOST
1404extern struct device_attribute *ata_ncq_sdev_attrs[];
1405
1402#define ATA_NCQ_SHT(drv_name) \1406#define ATA_NCQ_SHT(drv_name) \
1403 __ATA_BASE_SHT(drv_name), \1407 __ATA_BASE_SHT(drv_name), \
1404 .sdev_attrs = ata_ncq_sdev_attrs, \1408 .sdev_attrs = ata_ncq_sdev_attrs, \
1405 .change_queue_depth = ata_scsi_change_queue_depth1409 .change_queue_depth = ata_scsi_change_queue_depth
1410#endif
1406 1411
1407/*1412/*
1408 * PMP helpers1413 * PMP helpers