* [PATCH v2] pata_falcon: Avoid type warnings from sparse
@ 2021-11-25 22:34 Finn Thain
2021-11-29 7:43 ` Damien Le Moal
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Finn Thain @ 2021-11-25 22:34 UTC (permalink / raw)
To: Damien Le Moal
Cc: Geert Uytterhoeven, Michael Schmitz, Jens Axboe, linux-ide, linux-kernel
The zero day bot reported some sparse complaints in pata_falcon.c. E.g.
drivers/ata/pata_falcon.c:58:41: warning: cast removes address space '__iomem' of expression
drivers/ata/pata_falcon.c:58:41: warning: incorrect type in argument 1 (different address spaces)
drivers/ata/pata_falcon.c:58:41: expected unsigned short volatile [noderef] [usertype] __iomem *port
drivers/ata/pata_falcon.c:58:41: got unsigned short [usertype] *
The same thing shows up in 8 places, all told. Avoid this by removing
unnecessary type casts.
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Michael Schmitz <schmitzmic@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
---
drivers/ata/pata_falcon.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/ata/pata_falcon.c b/drivers/ata/pata_falcon.c
index 121635aa8c00..823c88622e34 100644
--- a/drivers/ata/pata_falcon.c
+++ b/drivers/ata/pata_falcon.c
@@ -55,14 +55,14 @@ static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc,
/* Transfer multiple of 2 bytes */
if (rw == READ) {
if (swap)
- raw_insw_swapw((u16 *)data_addr, (u16 *)buf, words);
+ raw_insw_swapw(data_addr, (u16 *)buf, words);
else
- raw_insw((u16 *)data_addr, (u16 *)buf, words);
+ raw_insw(data_addr, (u16 *)buf, words);
} else {
if (swap)
- raw_outsw_swapw((u16 *)data_addr, (u16 *)buf, words);
+ raw_outsw_swapw(data_addr, (u16 *)buf, words);
else
- raw_outsw((u16 *)data_addr, (u16 *)buf, words);
+ raw_outsw(data_addr, (u16 *)buf, words);
}
/* Transfer trailing byte, if any. */
@@ -74,16 +74,16 @@ static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc,
if (rw == READ) {
if (swap)
- raw_insw_swapw((u16 *)data_addr, (u16 *)pad, 1);
+ raw_insw_swapw(data_addr, (u16 *)pad, 1);
else
- raw_insw((u16 *)data_addr, (u16 *)pad, 1);
+ raw_insw(data_addr, (u16 *)pad, 1);
*buf = pad[0];
} else {
pad[0] = *buf;
if (swap)
- raw_outsw_swapw((u16 *)data_addr, (u16 *)pad, 1);
+ raw_outsw_swapw(data_addr, (u16 *)pad, 1);
else
- raw_outsw((u16 *)data_addr, (u16 *)pad, 1);
+ raw_outsw(data_addr, (u16 *)pad, 1);
}
words++;
}
--
2.26.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] pata_falcon: Avoid type warnings from sparse
2021-11-25 22:34 [PATCH v2] pata_falcon: Avoid type warnings from sparse Finn Thain
@ 2021-11-29 7:43 ` Damien Le Moal
2021-11-29 8:20 ` Geert Uytterhoeven
2021-11-29 11:38 ` Damien Le Moal
2 siblings, 0 replies; 4+ messages in thread
From: Damien Le Moal @ 2021-11-29 7:43 UTC (permalink / raw)
To: Finn Thain
Cc: Geert Uytterhoeven, Michael Schmitz, Jens Axboe, linux-ide, linux-kernel
On 2021/11/26 7:34, Finn Thain wrote:
> The zero day bot reported some sparse complaints in pata_falcon.c. E.g.
>
> drivers/ata/pata_falcon.c:58:41: warning: cast removes address space '__iomem' of expression
> drivers/ata/pata_falcon.c:58:41: warning: incorrect type in argument 1 (different address spaces)
> drivers/ata/pata_falcon.c:58:41: expected unsigned short volatile [noderef] [usertype] __iomem *port
> drivers/ata/pata_falcon.c:58:41: got unsigned short [usertype] *
>
> The same thing shows up in 8 places, all told. Avoid this by removing
> unnecessary type casts.
>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Michael Schmitz <schmitzmic@gmail.com>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Finn Thain <fthain@linux-m68k.org>
> ---
> drivers/ata/pata_falcon.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/ata/pata_falcon.c b/drivers/ata/pata_falcon.c
> index 121635aa8c00..823c88622e34 100644
> --- a/drivers/ata/pata_falcon.c
> +++ b/drivers/ata/pata_falcon.c
> @@ -55,14 +55,14 @@ static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc,
> /* Transfer multiple of 2 bytes */
> if (rw == READ) {
> if (swap)
> - raw_insw_swapw((u16 *)data_addr, (u16 *)buf, words);
> + raw_insw_swapw(data_addr, (u16 *)buf, words);
> else
> - raw_insw((u16 *)data_addr, (u16 *)buf, words);
> + raw_insw(data_addr, (u16 *)buf, words);
> } else {
> if (swap)
> - raw_outsw_swapw((u16 *)data_addr, (u16 *)buf, words);
> + raw_outsw_swapw(data_addr, (u16 *)buf, words);
> else
> - raw_outsw((u16 *)data_addr, (u16 *)buf, words);
> + raw_outsw(data_addr, (u16 *)buf, words);
> }
>
> /* Transfer trailing byte, if any. */
> @@ -74,16 +74,16 @@ static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc,
>
> if (rw == READ) {
> if (swap)
> - raw_insw_swapw((u16 *)data_addr, (u16 *)pad, 1);
> + raw_insw_swapw(data_addr, (u16 *)pad, 1);
> else
> - raw_insw((u16 *)data_addr, (u16 *)pad, 1);
> + raw_insw(data_addr, (u16 *)pad, 1);
> *buf = pad[0];
> } else {
> pad[0] = *buf;
> if (swap)
> - raw_outsw_swapw((u16 *)data_addr, (u16 *)pad, 1);
> + raw_outsw_swapw(data_addr, (u16 *)pad, 1);
> else
> - raw_outsw((u16 *)data_addr, (u16 *)pad, 1);
> + raw_outsw(data_addr, (u16 *)pad, 1);
> }
> words++;
> }
>
Geert,
If your are OK with this version, please send a review tag. Thanks.
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] pata_falcon: Avoid type warnings from sparse
2021-11-25 22:34 [PATCH v2] pata_falcon: Avoid type warnings from sparse Finn Thain
2021-11-29 7:43 ` Damien Le Moal
@ 2021-11-29 8:20 ` Geert Uytterhoeven
2021-11-29 11:38 ` Damien Le Moal
2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2021-11-29 8:20 UTC (permalink / raw)
To: Finn Thain
Cc: Damien Le Moal, Michael Schmitz, Jens Axboe, linux-ide,
Linux Kernel Mailing List
On Thu, Nov 25, 2021 at 11:36 PM Finn Thain <fthain@linux-m68k.org> wrote:
> The zero day bot reported some sparse complaints in pata_falcon.c. E.g.
>
> drivers/ata/pata_falcon.c:58:41: warning: cast removes address space '__iomem' of expression
> drivers/ata/pata_falcon.c:58:41: warning: incorrect type in argument 1 (different address spaces)
> drivers/ata/pata_falcon.c:58:41: expected unsigned short volatile [noderef] [usertype] __iomem *port
> drivers/ata/pata_falcon.c:58:41: got unsigned short [usertype] *
>
> The same thing shows up in 8 places, all told. Avoid this by removing
> unnecessary type casts.
>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Michael Schmitz <schmitzmic@gmail.com>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] pata_falcon: Avoid type warnings from sparse
2021-11-25 22:34 [PATCH v2] pata_falcon: Avoid type warnings from sparse Finn Thain
2021-11-29 7:43 ` Damien Le Moal
2021-11-29 8:20 ` Geert Uytterhoeven
@ 2021-11-29 11:38 ` Damien Le Moal
2 siblings, 0 replies; 4+ messages in thread
From: Damien Le Moal @ 2021-11-29 11:38 UTC (permalink / raw)
To: Finn Thain
Cc: Geert Uytterhoeven, Michael Schmitz, Jens Axboe, linux-ide, linux-kernel
On 2021/11/26 7:34, Finn Thain wrote:
> The zero day bot reported some sparse complaints in pata_falcon.c. E.g.
>
> drivers/ata/pata_falcon.c:58:41: warning: cast removes address space '__iomem' of expression
> drivers/ata/pata_falcon.c:58:41: warning: incorrect type in argument 1 (different address spaces)
> drivers/ata/pata_falcon.c:58:41: expected unsigned short volatile [noderef] [usertype] __iomem *port
> drivers/ata/pata_falcon.c:58:41: got unsigned short [usertype] *
>
> The same thing shows up in 8 places, all told. Avoid this by removing
> unnecessary type casts.
>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Michael Schmitz <schmitzmic@gmail.com>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Applied to for-5.16-fixes. Thanks.
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-11-29 11:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25 22:34 [PATCH v2] pata_falcon: Avoid type warnings from sparse Finn Thain
2021-11-29 7:43 ` Damien Le Moal
2021-11-29 8:20 ` Geert Uytterhoeven
2021-11-29 11:38 ` Damien Le Moal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).