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
Showing the changes to include/linux (1 of 4 files). Show all
Unified · Split
| @@ -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); |
| 531 | typedef void (*ata_postreset_fn_t)(struct ata_link *link, unsigned int *classes); | 531 | typedef void (*ata_postreset_fn_t)(struct ata_link *link, unsigned int *classes); |
| 532 | 532 | ||
| 533 | extern struct device_attribute dev_attr_link_power_management_policy; | ||
| 534 | extern struct device_attribute dev_attr_unload_heads; | 533 | extern struct device_attribute dev_attr_unload_heads; |
| 534 | #ifdef CONFIG_SATA_HOST | ||
| 535 | extern struct device_attribute dev_attr_link_power_management_policy; | ||
| 535 | extern struct device_attribute dev_attr_ncq_prio_enable; | 536 | extern struct device_attribute dev_attr_ncq_prio_enable; |
| 536 | extern struct device_attribute dev_attr_em_message_type; | 537 | extern struct device_attribute dev_attr_em_message_type; |
| 537 | extern struct device_attribute dev_attr_em_message; | 538 | extern struct device_attribute dev_attr_em_message; |
| 538 | extern struct device_attribute dev_attr_sw_activity; | 539 | extern struct device_attribute dev_attr_sw_activity; |
| 540 | #endif | ||
| 539 | 541 | ||
| 540 | enum sw_activity { | 542 | enum sw_activity { |
| 541 | OFF, | 543 | OFF, |
| @@ -1371,7 +1373,6 @@ extern int ata_link_nr_enabled(struct ata_link *link); · 829 unmodified lines | |||
| 1371 | extern const struct ata_port_operations ata_base_port_ops; | 1373 | extern const struct ata_port_operations ata_base_port_ops; |
| 1372 | extern const struct ata_port_operations sata_port_ops; | 1374 | extern const struct ata_port_operations sata_port_ops; |
| 1373 | extern struct device_attribute *ata_common_sdev_attrs[]; | 1375 | extern struct device_attribute *ata_common_sdev_attrs[]; |
| 1374 | extern struct device_attribute *ata_ncq_sdev_attrs[]; | ||
| 1375 | 1376 | ||
| 1376 | /* | 1377 | /* |
| 1377 | * All sht initializers (BASE, PIO, BMDMA, NCQ) must be instantiated | 1378 | * 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_attrs | 1401 | .sdev_attrs = ata_common_sdev_attrs |
| 1401 | 1402 | ||
| 1403 | #ifdef CONFIG_SATA_HOST | ||
| 1404 | extern 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_depth | 1409 | .change_queue_depth = ata_scsi_change_queue_depth |
| 1410 | #endif | ||
| 1406 | 1411 | ||
| 1407 | /* | 1412 | /* |
| 1408 | * PMP helpers | 1413 | * PMP helpers |