[RFC PATCH 1/2] ARM: mstar: Add header with macros for RIU register access

Arnd Bergmann arnd at kernel.org
Fri Apr 23 14:47:44 BST 2021


On Thu, Apr 22, 2021 at 4:11 PM Daniel Palmer <daniel at 0x0f.com> wrote:

> +
> +#include <linux/io.h>
> +
> +static inline u32 riu_readl(__iomem void *base, unsigned int offset)

The __iomem token comes after the type, so this should be 'void __iomem *'.

> +       return readw_relaxed(reg + 4) << 16 | readw_relaxed(reg);

This should probably be using 'readw' instead of 'readw_relaxed'. If you
absolutely need to use one of the relaxed accessors somewhere,
better add both sets and make sure drivers use the non-relaxed version
by default.

Maybe both types of accessors can be in a single header.

     Arnd



More information about the linux-arm-kernel mailing list