* [PATCH] mips: Fix a compilation error.
@ 2022-03-29 1:35 xiaolinkui2022
0 siblings, 0 replies; 2+ messages in thread
From: xiaolinkui2022 @ 2022-03-29 1:35 UTC (permalink / raw)
To: tsbogend, david, f.fainelli, akpm, arnd, rppt
Cc: linux-mips, linux-kernel, xiaolinkui
From: xiaolinkui <xiaolinkui@kylinos.cn>
Commit 4d5b3bdc0ecb ("MIPS: Fix a warning for virt_to_page") will
trigger a compilation error as follows with kernel v5.17-rc8:
(CONFIG_RDMA_SIW=y)
In file included from ./arch/mips/include/asm/page.h:270,
from ./arch/mips/include/asm/io.h:29,
from ./arch/mips/include/asm/mmiowb.h:5,
from ./include/linux/spinlock.h:64,
from ./include/linux/wait.h:9,
from ./include/linux/net.h:19,
from drivers/infiniband/sw/siw/siw_qp_tx.c:8:
drivers/infiniband/sw/siw/siw_qp_tx.c: In function ‘siw_tx_hdt’:
./arch/mips/include/asm/page.h:255:53: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
| ^
./include/asm-generic/memory_model.h:18:41: note: in definition of macro ‘__pfn_to_page’
18 | #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))
| ^~~
./arch/mips/include/asm/page.h:255:31: note: in expansion of macro ‘PFN_DOWN’
255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
| ^~~~~~~~
./arch/mips/include/asm/page.h:256:41: note: in expansion of macro ‘virt_to_pfn’
256 | #define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
| ^~~~~~~~~~~
drivers/infiniband/sw/siw/siw_qp_tx.c:538:23: note: in expansion of macro ‘virt_to_page’
538 | page_array[seg] = virt_to_page(va & PAGE_MASK);
| ^~~~~~~~~~~~
Fixes: 37d15948eb72 ("MIPS: page.h: Define virt_to_pfn()")
Fixes: 4d5b3bdc0ecb ("MIPS: Fix a warning for virt_to_page")
Fixes: b9be6f18cf9e ("rdma/siw: transmit path")
Signed-off-by: xiaolinkui <xiaolinkui@kylinos.cn>
---
arch/mips/include/asm/page.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 96bc798c1ec1..0f986f4ad4f0 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -252,7 +252,7 @@ static inline int pfn_valid(unsigned long pfn)
#endif
-#define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
+#define virt_to_pfn(kaddr) PFN_DOWN(__pa(kaddr))
#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
extern bool __virt_addr_valid(const volatile void *kaddr);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] mips: fix a compilation error.
@ 2022-03-29 8:58 xiaolinkui
0 siblings, 0 replies; 2+ messages in thread
From: xiaolinkui @ 2022-03-29 8:58 UTC (permalink / raw)
To: tsbogend, f.fainelli, rppt, david, arnd
Cc: linux-mips, linux-kernel, xiaolinkui
From: xiaolinkui <xiaolinkui@kylinos.cn>
Commit 4d5b3bdc0ecb ("MIPS: Fix a warning for virt_to_page") will
trigger a compilation error as follows with kernel v5.17-rc8:
(CONFIG_RDMA_SIW=y)
In file included from ./arch/mips/include/asm/page.h:270,
from ./arch/mips/include/asm/io.h:29,
from ./arch/mips/include/asm/mmiowb.h:5,
from ./include/linux/spinlock.h:64,
from ./include/linux/wait.h:9,
from ./include/linux/net.h:19,
from drivers/infiniband/sw/siw/siw_qp_tx.c:8:
drivers/infiniband/sw/siw/siw_qp_tx.c: In function ‘siw_tx_hdt’:
./arch/mips/include/asm/page.h:255:53: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
| ^
./include/asm-generic/memory_model.h:18:41: note: in definition of macro ‘__pfn_to_page’
18 | #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))
| ^~~
./arch/mips/include/asm/page.h:255:31: note: in expansion of macro ‘PFN_DOWN’
255 | #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
| ^~~~~~~~
./arch/mips/include/asm/page.h:256:41: note: in expansion of macro ‘virt_to_pfn’
256 | #define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
| ^~~~~~~~~~~
drivers/infiniband/sw/siw/siw_qp_tx.c:538:23: note: in expansion of macro ‘virt_to_page’
538 | page_array[seg] = virt_to_page(va & PAGE_MASK);
| ^~~~~~~~~~~~
Fixes: 37d15948eb72 ("MIPS: page.h: Define virt_to_pfn()")
Fixes: 4d5b3bdc0ecb ("MIPS: Fix a warning for virt_to_page")
Fixes: b9be6f18cf9e ("rdma/siw: transmit path")
Signed-off-by: xiaolinkui <xiaolinkui@kylinos.cn>
---
arch/mips/include/asm/page.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 96bc798c1ec1..0f986f4ad4f0 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -252,7 +252,7 @@ static inline int pfn_valid(unsigned long pfn)
#endif
-#define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr)))
+#define virt_to_pfn(kaddr) PFN_DOWN(__pa(kaddr))
#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
extern bool __virt_addr_valid(const volatile void *kaddr);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-29 8:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-29 1:35 [PATCH] mips: Fix a compilation error xiaolinkui2022
-- strict thread matches above, loose matches on Subject: below --
2022-03-29 8:58 [PATCH] mips: fix " xiaolinkui
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).