pmem: fix a name collision
PATCH 1/1 pmem: fix a name collision
Kernel test robot detected name collision when compiled on 'um' architecture. Rename "to_phys()" to "_to_phys()".
Quoted 1 line
Quoted 1 line
drivers/nvdimm/pmem.c:48:20: error: conflicting types for 'to_phys'; have 'phys_addr_t(struct pmem_device *, phys_addr_t)' {aka 'long long unsignedint(struct pmem_device *, long long unsigned int)'}
48 | static phys_addr_t to_phys(struct pmem_device *pmem, phys_addr_t offset)
| ^~~~~~~
In file included from arch/um/include/asm/page.h:98,
from arch/um/include/asm/thread_info.h:15,
from include/linux/thread_info.h:60,
from include/asm-generic/preempt.h:5,
from ./arch/um/include/generated/asm/preempt.h:1,
arch/um/include/shared/mem.h:12:29: note: previous definition of 'to_phys' with type 'long unsigned int(void *)'
12 | static inline unsigned long to_phys(void *virt)
| ^~~~~~~
vim +48 drivers/nvdimm/pmem.c
47
Quoted 1 line
48 static
phys_addr_tto_phys(struct pmem_device *pmem, phys_addr_t offset)
49 {
50 return pmem->phys_addr + offset;
51 }
52--- drivers/nvdimm/pmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/nvdimm/pmem.c +3 -3
@@ -45,7 +45,7 @@ static struct nd_region *to_region(struct pmem_device *pmem)return to_nd_region (to_dev (pmem)->parent); } -static phys_addr_t to_phys (struct pmem_device *pmem,phys_addr_t offset) +static phys_addr_t _to_phys (struct pmem_device *pmem,phys_addr_t offset) {return pmem->phys_addr + offset; }
@@ -63,7 +63,7 @@ static phys_addr_t to_offset(struct pmem_device *pmem, sector_t sector)static void pmem_mkpage_present (struct pmem_device *pmem,phys_addr_t offset,unsigned int len) { -phys_addr_t phys =to_phys (pmem, offset); +phys_addr_t phys =_to_phys (pmem, offset);unsigned long pfn_start, pfn_end, pfn;/* only pmem in the linear map supports HWPoison */
@@ -97,7 +97,7 @@ static void pmem_clear_bb(struct pmem_device *pmem, sector_t sector, long blks)static long __pmem_clear_poison (struct pmem_device *pmem,phys_addr_t offset,unsigned int len) { -phys_addr_t phys =to_phys (pmem, offset); +phys_addr_t phys =_to_phys (pmem, offset);long cleared =nvdimm_clear_poison (to_dev (pmem), phys, len);if (cleared >0 ) {
Signature · 1 line
2.18.4
drivers/nvdimm/pmem.c static struct nd_region *to_region(struct pmem_device *pmem) · line 48
Quoted 2 lines · Jane Chu
drivers/nvdimm/pmem.c +1
-1-static phys_addr_t to_phys (struct pmem_device *pmem,phys_addr_t offset) +static phys_addr_t _to_phys (struct pmem_device *pmem,phys_addr_t offset)
I'd rather call this pmem_to_phys as that is a much nicer name.
Quoted 5 lines · Christoph Hellwig
drivers/nvdimm/pmem.c static struct nd_region *to_region(struct pmem_device *pmem) · line 48
Quoted 2 lines · Jane Chu
drivers/nvdimm/pmem.c +1
-1-static phys_addr_t to_phys (struct pmem_device *pmem,phys_addr_t offset) +static phys_addr_t _to_phys (struct pmem_device *pmem,phys_addr_t offset)I'd rather call this
pmem_to_physas that is a much nicer name.
Okay, thanks!
-jane