RE: [PATCH] um: Replace to_phys() and to_virt() with less generic function names

From: Dan Williams
Date: Thu Jul 14 2022 - 16:23:57 EST


[ add Jane ]

Guenter Roeck wrote:
> to_virt() and to_phys() are very generic and may be defined by drivers.
> As it turns out, commit 9409c9b6709e ("pmem: refactor pmem_clear_poison()")
> did exactly that. This results in build errors such as the following
> when trying to build um:allmodconfig.
>
> drivers/nvdimm/pmem.c: In function ‘pmem_dax_zero_page_range’:
> ./arch/um/include/asm/page.h:105:20: error:
> too few arguments to function ‘to_phys’
> 105 | #define __pa(virt) to_phys((void *) (unsigned long) (virt))
> | ^~~~~~~
>
> Use less generic function names for the um specific to_phys() and to_virt()
> functions to fix the problem and to avoid similar problems in the future.
>
> Fixes: 9409c9b6709e ("pmem: refactor pmem_clear_poison()")
> Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
> Cc: Christoph Hellwig <hch@xxxxxx>

Acked-by: Dan Williams <dan.j.williams@xxxxxxxxx>

Jane had sent a pmem local fixup, that I was about to push to linux-next:

https://lore.kernel.org/nvdimm/20220630182802.3250449-1-jane.chu@xxxxxxxxxx/

...but I like this one too, lets do both.

> Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
> ---
> arch/um/include/asm/page.h | 4 ++--
> arch/um/include/shared/mem.h | 4 ++--
> arch/um/os-Linux/skas/process.c | 6 +++---
> 3 files changed, 7 insertions(+), 7 deletions(-)