public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	<linux-ide@vger.kernel.org>
Subject: [PATCH 3/3] ata: make ata_port_info::{pio|mwdma|udma}_mask *unsigned int*
Date: Sun, 8 May 2022 23:41:39 +0300	[thread overview]
Message-ID: <20220508204139.4961-4-s.shtylyov@omp.ru> (raw)
In-Reply-To: <20220508204139.4961-1-s.shtylyov@omp.ru>

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(-)

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;
 };
-- 
2.26.3


  parent reply	other threads:[~2022-05-08 20:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-08 20:41 [PATCH 0/3] Make PATA transfer mode masks always being 32-bit Sergey Shtylyov
2022-05-08 20:41 ` [PATCH 1/3] ata: make packed transfer mode masks *unsigned int* Sergey Shtylyov
2022-05-16 11:17   ` Damien Le Moal
2022-05-19 20:19     ` Sergey Shtylyov
2022-05-20  3:37       ` Damien Le Moal
2022-06-10 20:19         ` Sergey Shtylyov
2022-06-12 23:18           ` Damien Le Moal
2022-05-08 20:41 ` [PATCH 2/3] ata: make ata_device::{pio|mwdma|udma}_mask " Sergey Shtylyov
2022-05-16 11:19   ` Damien Le Moal
2022-05-19 20:58     ` Sergey Shtylyov
2022-05-20  3:31       ` Damien Le Moal
2022-06-10 21:15         ` Sergey Shtylyov
2022-05-08 20:41 ` Sergey Shtylyov [this message]
2022-05-09 17:57 ` [PATCH 0/3] Make PATA transfer mode masks always being 32-bit Sergey Shtylyov
2022-06-08  6:44 ` Damien Le Moal
2022-06-10 21:20   ` Sergey Shtylyov
2022-06-12 23:24     ` Damien Le Moal
2022-06-13 19:20       ` Sergey Shtylyov
2022-06-14  5:43         ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220508204139.4961-4-s.shtylyov@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox