lkml.org 
[lkml]   [2024]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] openrisc: apply page shift to PFN instead of VA in pfn_to_virt
Date
Apply the page shift to PFN to get physical address for final VA.
The macro __va should take physical address instead of PFN as input.

Fixes: 232ba1630c66 ("openrisc: Make pfn accessors statics inlines")
Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
---
arch/openrisc/include/asm/page.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h
index 44fc1fd56717..55c66f6cb1bd 100644
--- a/arch/openrisc/include/asm/page.h
+++ b/arch/openrisc/include/asm/page.h
@@ -79,7 +79,7 @@ static inline unsigned long virt_to_pfn(const void *kaddr)

static inline void * pfn_to_virt(unsigned long pfn)
{
- return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT);
+ return __va(pfn << PAGE_SHIFT);
}

#define virt_to_page(addr) \
--
2.17.1

\
 
 \ /
  Last update: 2024-05-27 14:41    [W:0.109 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site