summaryrefslogtreecommitdiff
path: root/drivers/ata/pata_amd.c
diff options
context:
space:
mode:
authorSergey Shtylyov <s.shtylyov@omp.ru>2022-06-14 22:51:47 +0300
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>2022-06-17 16:35:02 +0900
commitf0a6d77b351c18c122fc1638ac9e58f5e0346f64 (patch)
tree1e232bf4b52162f14bd05ab62b6c2651d03ce4bc /drivers/ata/pata_amd.c
parent5eb8deb4af56b120c152066ff43a0867267b264b (diff)
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_amd.c')
-rw-r--r--drivers/ata/pata_amd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index 154748cfcc79..f216f9d7b9ec 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -264,8 +264,8 @@ static void amd133_set_dmamode(struct ata_port *ap, struct ata_device *adev)
* cached during driver attach and are consulted to select transfer
* mode.
*/
-static unsigned long nv_mode_filter(struct ata_device *dev,
- unsigned long xfer_mask)
+static unsigned int nv_mode_filter(struct ata_device *dev,
+ unsigned int xfer_mask)
{
static const unsigned int udma_mask_map[] =
{ ATA_UDMA2, ATA_UDMA1, ATA_UDMA0, 0,
@@ -274,7 +274,7 @@ static unsigned long nv_mode_filter(struct ata_device *dev,
char acpi_str[32] = "";
u32 saved_udma, udma;
const struct ata_acpi_gtm *gtm;
- unsigned long bios_limit = 0, acpi_limit = 0, limit;
+ unsigned int bios_limit = 0, acpi_limit = 0, limit;
/* find out what BIOS configured */
udma = saved_udma = (unsigned long)ap->host->private_data;
@@ -310,10 +310,10 @@ static unsigned long nv_mode_filter(struct ata_device *dev,
cable detection result */
limit |= ata_pack_xfermask(ATA_PIO4, ATA_MWDMA2, ATA_UDMA2);
- ata_port_dbg(ap, "nv_mode_filter: 0x%lx&0x%lx->0x%lx, "
- "BIOS=0x%lx (0x%x) ACPI=0x%lx%s\n",
- xfer_mask, limit, xfer_mask & limit, bios_limit,
- saved_udma, acpi_limit, acpi_str);
+ ata_port_dbg(ap,
+ "nv_mode_filter: 0x%x&0x%x->0x%x, BIOS=0x%x (0x%x) ACPI=0x%x%s\n",
+ xfer_mask, limit, xfer_mask & limit, bios_limit,
+ saved_udma, acpi_limit, acpi_str);
return xfer_mask & limit;
}