Skip to contentSkip to conversation

m68k: apollo: Remove a duplicate assignment in dn_timer_int

PATCH In review Minjie Du 3 participants 3 messages Jul 5, 2023 m68k architecture

lore
Share & tools
lore

Minjie Du

author
#0 lore raw

PATCH 1/1 m68k: apollo: Remove a duplicate assignment in dn_timer_int

Delete a duplicate statement from this function implementation.

---
 arch/m68k/apollo/config.c | 1 -
 1 file changed, 1 deletion(-)
arch/m68k/apollo/config.c +0 -1
index 42a8b8e2b..5645d2018 100644
@@ -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;
Signature · 1 line
2.39.0
#1 lore raw

Hi Minjie,

Quoted 3 lines · Minjie Du

Delete a duplicate statement from this function implementation.

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

arch/m68k/apollo/config.c irqreturn_t dn_timer_int(int irq, void *dev_id) · line 176

Quoted 8 lines
arch/m68k/apollo/config.c +0 -1
@@ -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.

arch/m68k/apollo/config.c irqreturn_t dn_timer_int(int irq, void *dev_id) · line 178

Quoted 2 lines
arch/m68k/apollo/config.c +0 -0
        return IRQ_HANDLED;

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#2 lore raw
In reply to Minjie Du
Quoted 12 lines · Minjie Du

Delete a duplicate statement from this function implementation.

---
 arch/m68k/apollo/config.c | 1 -
 1 file changed, 1 deletion(-)
arch/m68k/apollo/config.c +0 -0
index 42a8b8e2b..5645d2018 100644

arch/m68k/apollo/config.c irqreturn_t dn_timer_int(int irq, void *dev_id) · line 176

Quoted 5 lines
arch/m68k/apollo/config.c +0 -1
@@ -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.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."