Skip to content

Commit

Permalink
[ARM] Fix buggy __phys_to_pfn / __pfn_to_phys
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King authored and Russell King committed Oct 29, 2005
1 parent fb31690 commit 8c18fe2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/asm-arm/mach/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down

0 comments on commit 8c18fe2

Please sign in to comment.