diff options
author | Sergey Shtylyov <s.shtylyov@omp.ru> | 2022-06-14 21:51:47 +0200 |
---|---|---|
committer | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2022-06-17 09:35:02 +0200 |
commit | f0a6d77b351c18c122fc1638ac9e58f5e0346f64 (patch) | |
tree | 1e232bf4b52162f14bd05ab62b6c2651d03ce4bc /drivers/ata/pata_hpt3x2n.c | |
parent | ata: libata-core: get rid of *else* branches in ata_id_n_sectors() (diff) | |
download | linux-f0a6d77b351c18c122fc1638ac9e58f5e0346f64.tar.xz linux-f0a6d77b351c18c122fc1638ac9e58f5e0346f64.zip |
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>
Diffstat (limited to 'drivers/ata/pata_hpt3x2n.c')
-rw-r--r-- | drivers/ata/pata_hpt3x2n.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c index d1595e17dca2..617c95522f43 100644 --- a/drivers/ata/pata_hpt3x2n.c +++ b/drivers/ata/pata_hpt3x2n.c @@ -113,7 +113,7 @@ static u32 hpt3x2n_find_mode(struct ata_port *ap, int speed) * The Marvell bridge chips used on the HighPoint SATA cards do not seem * to support the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes... */ -static unsigned long hpt372n_filter(struct ata_device *adev, unsigned long mask) +static unsigned int hpt372n_filter(struct ata_device *adev, unsigned int mask) { if (ata_id_is_sata(adev->id)) mask &= ~((0xE << ATA_SHIFT_UDMA) | ATA_MASK_MWDMA); |