lkml.org 
[lkml]   [2021]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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...

\
 
 \ /
  Last update: 2021-01-06 21:49    [W:0.380 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site