lkml.org 
[lkml]   [2022]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 4/6] mm: ioremap: Add arch_ioremap/iounmap()
On Tue, May 24, 2022 at 11:48 AM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
> >>> mm/ioremap.c:59:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const *addr @@ got void [noderef] __iomem *vaddr @@
> > mm/ioremap.c:59:16: sparse: expected void const *addr
> > mm/ioremap.c:59:16: sparse: got void [noderef] __iomem *vaddr
> >
> > vim +59 mm/ioremap.c
> >
> > 51
> > 52 void iounmap(volatile void __iomem *addr)
> > 53 {
> > 54 void __iomem *vaddr = (void __iomem *)((unsigned long)addr & PAGE_MASK);
> > 55
> > 56 if (arch_iounmap(vaddr))
> > 57 return;
> > 58
> > > 59 vunmap(vaddr);
>
> 1) Will add generic "arch_ioremap/arch_iounmap define"
>
> 2) and change this to vunmap((void *)vaddr);

I think this need an extra __force to actually suppress the sparse
warning, as in

vunmap((void __force *)vaddr);

Using __force is usually wrong, this is one of the exceptions, so
maybe add a comment
as well.

Arnd

\
 
 \ /
  Last update: 2022-05-24 14:37    [W:0.122 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site