linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] pmem: fix a name collision
@ 2022-06-30 18:28 Jane Chu
  2022-06-30 18:29 ` Christoph Hellwig
  2022-07-13  0:53 ` Dan Williams
  0 siblings, 2 replies; 4+ messages in thread
From: Jane Chu @ 2022-06-30 18:28 UTC (permalink / raw)
  To: dan.j.williams, linux-kernel, hch, nvdimm

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: 9409c9b6709e (pmem: refactor pmem_clear_poison())
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jane Chu <jane.chu@oracle.com>
---
 drivers/nvdimm/pmem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 629d10fcf53b..b9f1a8e9f88c 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -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 pmem_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 = pmem_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 = pmem_to_phys(pmem, offset);
 	long cleared = nvdimm_clear_poison(to_dev(pmem), phys, len);
 
 	if (cleared > 0) {
-- 
2.18.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] pmem: fix a name collision
  2022-06-30 18:28 [PATCH v2] pmem: fix a name collision Jane Chu
@ 2022-06-30 18:29 ` Christoph Hellwig
  2022-06-30 18:34   ` Jane Chu
  2022-07-13  0:53 ` Dan Williams
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2022-06-30 18:29 UTC (permalink / raw)
  To: Jane Chu; +Cc: dan.j.williams, linux-kernel, hch, nvdimm

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] pmem: fix a name collision
  2022-06-30 18:29 ` Christoph Hellwig
@ 2022-06-30 18:34   ` Jane Chu
  0 siblings, 0 replies; 4+ messages in thread
From: Jane Chu @ 2022-06-30 18:34 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: dan.j.williams, linux-kernel, nvdimm

On 6/30/2022 11:29 AM, Christoph Hellwig wrote:
> Looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Thank you!
-jane

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v2] pmem: fix a name collision
  2022-06-30 18:28 [PATCH v2] pmem: fix a name collision Jane Chu
  2022-06-30 18:29 ` Christoph Hellwig
@ 2022-07-13  0:53 ` Dan Williams
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Williams @ 2022-07-13  0:53 UTC (permalink / raw)
  To: Jane Chu, dan.j.williams, linux-kernel, hch, nvdimm

Jane Chu wrote:
> 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: 9409c9b6709e (pmem: refactor pmem_clear_poison())
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Jane Chu <jane.chu@oracle.com>

Applied. Sorry for the delay, catching up after vacation.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-13  0:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30 18:28 [PATCH v2] pmem: fix a name collision Jane Chu
2022-06-30 18:29 ` Christoph Hellwig
2022-06-30 18:34   ` Jane Chu
2022-07-13  0:53 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).