Skip to content

Commit 75cd968

Browse files
author
Linus Torvalds
committed
um: fix __pa/__va macro expansion problem
Proper parentheses around arguments needed, especially as the macros use a high-precedence cast operator on the argument.
1 parent 3edea48 commit 75cd968

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎include/asm-um/page.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ extern void *to_virt(unsigned long phys);
104104
* casting is the right thing, but 32-bit UML can't have 64-bit virtual
105105
* addresses
106106
*/
107-
#define __pa(virt) to_phys((void *) (unsigned long) virt)
108-
#define __va(phys) to_virt((unsigned long) phys)
107+
#define __pa(virt) to_phys((void *) (unsigned long) (virt))
108+
#define __va(phys) to_virt((unsigned long) (phys))
109109

110110
#define page_to_pfn(page) ((page) - mem_map)
111111
#define pfn_to_page(pfn) (mem_map + (pfn))

0 commit comments

Comments
 (0)