mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
The UML function names to_virt() and to_phys() are exposed by UML headers, and are very generic and may be defined by drivers. As it turns out, commit9409c9b670
("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:9409c9b670
("pmem: refactor pmem_clear_poison()") Cc: Dan Williams <dan.j.williams@intel.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
22 lines
476 B
C
22 lines
476 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
|
|
*/
|
|
|
|
#ifndef __MEM_H__
|
|
#define __MEM_H__
|
|
|
|
extern int phys_mapping(unsigned long phys, unsigned long long *offset_out);
|
|
|
|
extern unsigned long uml_physmem;
|
|
static inline unsigned long uml_to_phys(void *virt)
|
|
{
|
|
return(((unsigned long) virt) - uml_physmem);
|
|
}
|
|
|
|
static inline void *uml_to_virt(unsigned long phys)
|
|
{
|
|
return((void *) uml_physmem + phys);
|
|
}
|
|
|
|
#endif
|