* [PATCH] power: reset: fix __le32 cast in reset code
@ 2019-10-15 15:54 Ben Dooks (Codethink)
2019-10-20 13:04 ` Sebastian Reichel
0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks (Codethink) @ 2019-10-15 15:54 UTC (permalink / raw)
To: linux-kernel
Cc: Ben Dooks (Codethink),
Sebastian Reichel, Nicolas Ferre, Alexandre Belloni,
Ludovic Desroches, linux-pm, linux-arm-kernel, linux-kernel
The writel() takes standard integers, not __le32 so
fix the following sparse warnings by removing the
cpu_to_le32() calls.
drivers/power/reset/at91-reset.c:134:9: warning: cast from restricted __le32
drivers/power/reset/at91-reset.c:143:9: warning: cast from restricted __le32
This has made no code changes, the md5sums pre and post applying
this patch are the same. The at91 should be natively little endian
anyway.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
drivers/power/reset/at91-reset.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c
index 44ca983a49a1..d94e3267c3b6 100644
--- a/drivers/power/reset/at91-reset.c
+++ b/drivers/power/reset/at91-reset.c
@@ -131,7 +131,7 @@ static int at91sam9g45_restart(struct notifier_block *this, unsigned long mode,
static int sama5d3_restart(struct notifier_block *this, unsigned long mode,
void *cmd)
{
- writel(cpu_to_le32(AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST),
+ writel(AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST,
at91_rstc_base);
return NOTIFY_DONE;
@@ -140,9 +140,7 @@ static int sama5d3_restart(struct notifier_block *this, unsigned long mode,
static int samx7_restart(struct notifier_block *this, unsigned long mode,
void *cmd)
{
- writel(cpu_to_le32(AT91_RSTC_KEY | AT91_RSTC_PROCRST),
- at91_rstc_base);
-
+ writel(AT91_RSTC_KEY | AT91_RSTC_PROCRST, at91_rstc_base);
return NOTIFY_DONE;
}
--
2.23.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] power: reset: fix __le32 cast in reset code
2019-10-15 15:54 [PATCH] power: reset: fix __le32 cast in reset code Ben Dooks (Codethink)
@ 2019-10-20 13:04 ` Sebastian Reichel
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2019-10-20 13:04 UTC (permalink / raw)
To: Ben Dooks (Codethink)
Cc: linux-kernel, Nicolas Ferre, Alexandre Belloni,
Ludovic Desroches, linux-pm, linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2106 bytes --]
Hi,
On Tue, Oct 15, 2019 at 04:54:14PM +0100, Ben Dooks (Codethink) wrote:
> The writel() takes standard integers, not __le32 so
> fix the following sparse warnings by removing the
> cpu_to_le32() calls.
>
> drivers/power/reset/at91-reset.c:134:9: warning: cast from restricted __le32
> drivers/power/reset/at91-reset.c:143:9: warning: cast from restricted __le32
>
> This has made no code changes, the md5sums pre and post applying
> this patch are the same. The at91 should be natively little endian
> anyway.
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
Thanks, queued.
-- Sebastian
> Cc: Sebastian Reichel <sre@kernel.org>
> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
> drivers/power/reset/at91-reset.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c
> index 44ca983a49a1..d94e3267c3b6 100644
> --- a/drivers/power/reset/at91-reset.c
> +++ b/drivers/power/reset/at91-reset.c
> @@ -131,7 +131,7 @@ static int at91sam9g45_restart(struct notifier_block *this, unsigned long mode,
> static int sama5d3_restart(struct notifier_block *this, unsigned long mode,
> void *cmd)
> {
> - writel(cpu_to_le32(AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST),
> + writel(AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST,
> at91_rstc_base);
>
> return NOTIFY_DONE;
> @@ -140,9 +140,7 @@ static int sama5d3_restart(struct notifier_block *this, unsigned long mode,
> static int samx7_restart(struct notifier_block *this, unsigned long mode,
> void *cmd)
> {
> - writel(cpu_to_le32(AT91_RSTC_KEY | AT91_RSTC_PROCRST),
> - at91_rstc_base);
> -
> + writel(AT91_RSTC_KEY | AT91_RSTC_PROCRST, at91_rstc_base);
> return NOTIFY_DONE;
> }
>
> --
> 2.23.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-20 13:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15 15:54 [PATCH] power: reset: fix __le32 cast in reset code Ben Dooks (Codethink)
2019-10-20 13:04 ` Sebastian Reichel
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).