浏览代码

[ARM] Fix buggy __phys_to_pfn / __pfn_to_phys

Macro arguments should _always_ be surrounded by parentheses
when used to prevent unexpected problems with operator precedence.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Russell King 19 年之前
父节点
当前提交
8c18fe2562
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      include/asm-arm/mach/map.h

+ 2 - 2
include/asm-arm/mach/map.h

@@ -27,8 +27,8 @@ struct meminfo;
 #define MT_ROM			6
 #define MT_IXP2000_DEVICE	7
 
-#define	__phys_to_pfn(paddr)	(paddr >> PAGE_SHIFT)
-#define	__pfn_to_phys(pfn)	(pfn << PAGE_SHIFT)
+#define	__phys_to_pfn(paddr)	((paddr) >> PAGE_SHIFT)
+#define	__pfn_to_phys(pfn)	((pfn) << PAGE_SHIFT)
 
 extern void create_memmap_holes(struct meminfo *);
 extern void memtable_init(struct meminfo *);