Skip to content

Commit 149d171

Browse files
jchu314atgithubdjbw
authored andcommitted
pmem: fix a name collision
Kernel test robot detected name collision when compiled on 'um' architecture. Rename "to_phys()" to "pmem_to_phys()". >> 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 unsigned int(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 > 48 static phys_addr_t to_phys(struct pmem_device *pmem, phys_addr_t offset) 49 { 50 return pmem->phys_addr + offset; 51 } 52 Fixes: 9409c9b (pmem: refactor pmem_clear_poison()) Reported-by: kernel test robot <[email protected]> Signed-off-by: Jane Chu <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 88084a3 commit 149d171

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/nvdimm/pmem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static struct nd_region *to_region(struct pmem_device *pmem)
4545
return to_nd_region(to_dev(pmem)->parent);
4646
}
4747

48-
static phys_addr_t to_phys(struct pmem_device *pmem, phys_addr_t offset)
48+
static phys_addr_t pmem_to_phys(struct pmem_device *pmem, phys_addr_t offset)
4949
{
5050
return pmem->phys_addr + offset;
5151
}
@@ -63,7 +63,7 @@ static phys_addr_t to_offset(struct pmem_device *pmem, sector_t sector)
6363
static void pmem_mkpage_present(struct pmem_device *pmem, phys_addr_t offset,
6464
unsigned int len)
6565
{
66-
phys_addr_t phys = to_phys(pmem, offset);
66+
phys_addr_t phys = pmem_to_phys(pmem, offset);
6767
unsigned long pfn_start, pfn_end, pfn;
6868

6969
/* 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)
9797
static long __pmem_clear_poison(struct pmem_device *pmem,
9898
phys_addr_t offset, unsigned int len)
9999
{
100-
phys_addr_t phys = to_phys(pmem, offset);
100+
phys_addr_t phys = pmem_to_phys(pmem, offset);
101101
long cleared = nvdimm_clear_poison(to_dev(pmem), phys, len);
102102

103103
if (cleared > 0) {

0 commit comments

Comments
 (0)