]> git.baikalelectronics.ru Git - kernel.git/commit
ata: make transfer mode masks *unsigned int*
authorSergey Shtylyov <s.shtylyov@omp.ru>
Tue, 14 Jun 2022 19:51:47 +0000 (22:51 +0300)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Fri, 17 Jun 2022 07:35:02 +0000 (16:35 +0900)
commitcf71c0be319b9025d935721f5e5de7abaca83ee5
tree1e232bf4b52162f14bd05ab62b6c2651d03ce4bc
parentd7fe323177ad1a3a7d219729322afd0613768324
ata: make transfer mode masks *unsigned int*

The packed transfer mode masks and also the {pio|mwdma|udma}_mask fields
of *struct*s ata_device and ata_port_info are declared as *unsigned long*
(which is a 64-bit type on 64-bit architectures) but actually the packed
masks occupy only 20 bits (7 PIO modes, 5 MWDMA modes, and 8 UDMA modes)
and the PIO/MWDMA/UDMA masks easily fit into just 8 bits each, so we can
safely use (always 32-bit) *unsigned int* variables instead.  This saves
745 bytes of object code in libata-core.o alone, not to mention LLDDs...

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
13 files changed:
drivers/ata/libata-acpi.c
drivers/ata/libata-core.c
drivers/ata/pata_acpi.c
drivers/ata/pata_ali.c
drivers/ata/pata_amd.c
drivers/ata/pata_hpt366.c
drivers/ata/pata_hpt37x.c
drivers/ata/pata_hpt3x2n.c
drivers/ata/pata_pdc2027x.c
drivers/ata/pata_serverworks.c
drivers/ata/pata_sis.c
drivers/ata/pata_via.c
include/linux/libata.h