Re: [PATCH 25/52] m68k: apollo: Replace set but not used variable by READ_ONCE()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 8, 2023, at 08:51, Geert Uytterhoeven wrote:

On Fri, Sep 8, 2023 at 1:37 AM Finn Thain <fthain@xxxxxxxxxxxxxx> wrote:
On Thu, 7 Sep 2023, Geert Uytterhoeven wrote:
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -146,13 +146,11 @@ void __init config_apollo(void)

 irqreturn_t dn_timer_int(int irq, void *dev_id)
 {
-     volatile unsigned char x;
-
      legacy_timer_tick(1);
      timer_heartbeat();

-     x = *(volatile unsigned char *)(apollo_timer + 3);
-     x = *(volatile unsigned char *)(apollo_timer + 5);
+     READ_ONCE(*(volatile unsigned char *)(apollo_timer + 3));
+     READ_ONCE(*(volatile unsigned char *)(apollo_timer + 5));

      return IRQ_HANDLED;
 }


I believe the volatile cast is redundant here, as READ_ONCE does that.

Yes it does.  I didn't drop the volatile out of fear of introducing
some higher W-level warning about casting away volatility, but upon
closer look, the apollo_timer definition itself does not use volatile.

I think ideally you'd want apollo_timer or IO_BASE to be marked __iomem
and passed to readb() instead. OTOH, I don't think anyone actually
cares about apollo, so your version is probably good enough.

     Arnd




[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux