Skip to content
Snippets Groups Projects
Commit 5c4a3d43 authored by Timur Tabi's avatar Timur Tabi Committed by Kumar Gala
Browse files

powerpc/85xx: fix definition of MAS register macros


Some of the MAS register macros do not protect the parameter with
parentheses, which could cause wrong values if the parameter includes
operators.

Also fix the definition of TSIZE_TO_BYTES() so that it actually uses
the parameter.  This hasn't caused any problems to date because the
parameter was always been 'tsize'.

Signed-off-by: default avatarTimur Tabi <timur@freescale.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent d3701228
No related branches found
No related tags found
No related merge requests found
...@@ -392,17 +392,17 @@ extern void print_bats(void); ...@@ -392,17 +392,17 @@ extern void print_bats(void);
*/ */
#define MAS0_TLBSEL_MSK 0x30000000 #define MAS0_TLBSEL_MSK 0x30000000
#define MAS0_TLBSEL(x) ((x << 28) & MAS0_TLBSEL_MSK) #define MAS0_TLBSEL(x) (((x) << 28) & MAS0_TLBSEL_MSK)
#define MAS0_ESEL_MSK 0x0FFF0000 #define MAS0_ESEL_MSK 0x0FFF0000
#define MAS0_ESEL(x) ((x << 16) & MAS0_ESEL_MSK) #define MAS0_ESEL(x) (((x) << 16) & MAS0_ESEL_MSK)
#define MAS0_NV(x) ((x) & 0x00000FFF) #define MAS0_NV(x) ((x) & 0x00000FFF)
#define MAS1_VALID 0x80000000 #define MAS1_VALID 0x80000000
#define MAS1_IPROT 0x40000000 #define MAS1_IPROT 0x40000000
#define MAS1_TID(x) ((x << 16) & 0x3FFF0000) #define MAS1_TID(x) (((x) << 16) & 0x3FFF0000)
#define MAS1_TS 0x00001000 #define MAS1_TS 0x00001000
#define MAS1_TSIZE(x) ((x << 8) & 0x00000F00) #define MAS1_TSIZE(x) (((x) << 8) & 0x00000F00)
#define TSIZE_TO_BYTES(x) ((phys_addr_t)(1UL << ((tsize * 2) + 10))) #define TSIZE_TO_BYTES(x) (1ULL << (((x) * 2) + 10))
#define MAS2_EPN 0xFFFFF000 #define MAS2_EPN 0xFFFFF000
#define MAS2_X0 0x00000040 #define MAS2_X0 0x00000040
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment