linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] m68k: apollo: Remove a duplicate assignment in dn_timer_int
@ 2023-07-05 12:13 Minjie Du
  2023-07-05 12:38 ` Geert Uytterhoeven
  2023-07-05 12:42 ` Andreas Schwab
  0 siblings, 2 replies; 3+ messages in thread
From: Minjie Du @ 2023-07-05 12:13 UTC (permalink / raw)
  To: Geert Uytterhoeven, Minjie Du, Stephen Rothwell,
	open list:M68K ARCHITECTURE, open list
  Cc: opensource.kernel

Delete a duplicate statement from this function implementation.

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 arch/m68k/apollo/config.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index 42a8b8e2b..5645d2018 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -173,7 +173,6 @@ irqreturn_t dn_timer_int(int irq, void *dev_id)
 	legacy_timer_tick(1);
 	timer_heartbeat();
 
-	x = *(volatile unsigned char *)(apollo_timer + 3);
 	x = *(volatile unsigned char *)(apollo_timer + 5);
 
 	return IRQ_HANDLED;
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] m68k: apollo: Remove a duplicate assignment in dn_timer_int
  2023-07-05 12:13 [PATCH v1] m68k: apollo: Remove a duplicate assignment in dn_timer_int Minjie Du
@ 2023-07-05 12:38 ` Geert Uytterhoeven
  2023-07-05 12:42 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2023-07-05 12:38 UTC (permalink / raw)
  To: Minjie Du
  Cc: Stephen Rothwell, open list:M68K ARCHITECTURE, open list,
	opensource.kernel

Hi Minjie,

On Wed, Jul 5, 2023 at 2:13 PM Minjie Du <duminjie@vivo.com> wrote:
> Delete a duplicate statement from this function implementation.
>
> Signed-off-by: Minjie Du <duminjie@vivo.com>

Thanks for your patch, which is presumably untested on real hardware?

> --- a/arch/m68k/apollo/config.c
> +++ b/arch/m68k/apollo/config.c
> @@ -173,7 +173,6 @@ irqreturn_t dn_timer_int(int irq, void *dev_id)
>         legacy_timer_tick(1);
>         timer_heartbeat();
>
> -       x = *(volatile unsigned char *)(apollo_timer + 3);
>         x = *(volatile unsigned char *)(apollo_timer + 5);

This is intentional: the use of volatile makes sure the registers at
offsets 3 and 5 are read, in that order.

I agree this could be made more obvious by converting the code to the
more modern READ_ONCE() helper.
But please do not send such a patch without testing.

>
>         return IRQ_HANDLED;

NAKed-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] 3+ messages in thread

* Re: [PATCH v1] m68k: apollo: Remove a duplicate assignment in dn_timer_int
  2023-07-05 12:13 [PATCH v1] m68k: apollo: Remove a duplicate assignment in dn_timer_int Minjie Du
  2023-07-05 12:38 ` Geert Uytterhoeven
@ 2023-07-05 12:42 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2023-07-05 12:42 UTC (permalink / raw)
  To: Minjie Du
  Cc: Geert Uytterhoeven, Stephen Rothwell, open list:M68K ARCHITECTURE,
	open list, opensource.kernel

On Jul 05 2023, Minjie Du wrote:

> Delete a duplicate statement from this function implementation.
>
> Signed-off-by: Minjie Du <duminjie@vivo.com>
> ---
>  arch/m68k/apollo/config.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
> index 42a8b8e2b..5645d2018 100644
> --- a/arch/m68k/apollo/config.c
> +++ b/arch/m68k/apollo/config.c
> @@ -173,7 +173,6 @@ irqreturn_t dn_timer_int(int irq, void *dev_id)
>  	legacy_timer_tick(1);
>  	timer_heartbeat();
>  
> -	x = *(volatile unsigned char *)(apollo_timer + 3);
>  	x = *(volatile unsigned char *)(apollo_timer + 5);

They are not the same: 3 != 5.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-05 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-05 12:13 [PATCH v1] m68k: apollo: Remove a duplicate assignment in dn_timer_int Minjie Du
2023-07-05 12:38 ` Geert Uytterhoeven
2023-07-05 12:42 ` Andreas Schwab

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