Message ID | 20220508204139.4961-4-s.shtylyov@omp.ru |
---|---|
State | New |
Headers | show |
Series | Make PATA transfer mode masks always being 32-bit | expand |
diff --git a/include/linux/libata.h b/include/linux/libata.h index f6fc482d767a..6417f1fd4852 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -979,9 +979,9 @@ struct ata_port_operations { struct ata_port_info { unsigned long flags; unsigned long link_flags; - unsigned long pio_mask; - unsigned long mwdma_mask; - unsigned long udma_mask; + unsigned int pio_mask; + unsigned int mwdma_mask; + unsigned int udma_mask; struct ata_port_operations *port_ops; void *private_data; };
The {pio|mwdma|udma}_mask fields of the *struct* ata_port_info are declared as *unsigned long* (which is a 64-bit type on 64-bit architectures) while the actual masks should easily fit into just 8 bits. The alike fields in the *struct* ata_port are declared as *unsigned int*, so there are silent truncations going on in ata_host_alloc_pinfo() anyway... Using *unsigned* *int* fields instead saves some object code in many LLDDs too... Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> --- include/linux/libata.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)