Thread (9 messages) flat view 9 messages, 4 authors, 2023-08-23

Re: [PATCH] powerpc: Make virt_to_pfn() a static inline

From: Linus Walleij <hidden>
Date: 2023-08-14 18:23:23
Also in: kvm, lkml

On Mon, Aug 14, 2023 at 2:37 PM Michael Ellerman [off-list ref] wrote:
quoted
+static inline const void *pfn_to_kaddr(unsigned long pfn)
+{
+     return (const void *)(((unsigned long)__va(pfn)) << PAGE_SHIFT);
Any reason to do it this way rather than:

+       return __va(pfn << PAGE_SHIFT);

Seems to be equivalent and much cleaner?
I was afraid of changing the semantic in the original macro
which converts to a virtual address before shifting, instead
of shifting first, but you're right, I'm too cautious. I'll propose
the elegant solution from you & Christophe instead!

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help