[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210106204659.GE3579531@ZenIV.linux.org.uk>
Date: Wed, 6 Jan 2021 20:46:59 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Ionela Voinescu <ionela.voinescu@....com>
Cc: Catalin Marinas <catalin.marinas@....com>,
kernel test robot <lkp@...el.com>, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org, Sudeep Holla <sudeep.holla@....com>
Subject: Re: arch/arm64/kernel/topology.c:367:22: sparse: sparse: dereference
of noderef expression
On Wed, Jan 06, 2021 at 08:12:27PM +0000, Ionela Voinescu wrote:
> Initially I though it always only makes sense to have a __iomem pointer.
> That is, it only makes sense to have a pointer with a cookie attached
> specifying that it addresses a device memory space that should only be
> accessed using special functions.
>
> But then you've got something like this in drivers/input/serio/apbps2.c:
> struct apbps2_regs {
> u32 __iomem data; /* 0x00 */
> u32 __iomem status; /* 0x04 */
> u32 __iomem ctrl; /* 0x08 */
> u32 __iomem reload; /* 0x0c */
> };
> struct apbps2_priv {
> struct serio *io;
> struct apbps2_regs *regs;
> };
> [..] (followed by)
> ioread32be(&priv->regs->status)
>
> which I think is correct despite contradicting my assumption, but it's
> the only example I've found in the kernel.
Frankly, I would rather turn that into
struct apbps2_regs __iomem *regs;
and striped the individual field qualifiers...
Powered by blists - more mailing lists