Patchwork [1/4] powerpc: Cleanup macros in ppc-opcode.h

login
register
mail settings
Submitter Michael Neuling
Date April 30, 2009, 6:58 a.m.
Message ID <20090430065801.96E951222C@localhost.localdomain>
Download mbox | patch
Permalink /patch/26668/
State Accepted, archived
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Michael Neuling - April 30, 2009, 6:58 a.m.
Make macros more braces happy.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---

 arch/powerpc/include/asm/ppc-opcode.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Kumar Gala - April 30, 2009, 11:27 a.m.
On Apr 30, 2009, at 1:58 AM, Michael Neuling wrote:

> Make macros more braces happy.
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
>
> arch/powerpc/include/asm/ppc-opcode.h |    8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)

Acked-by: Kumar Gala <galak@kernel.crashing.org>

- k

>
>
> Index: linux-2.6-ozlabs/arch/powerpc/include/asm/ppc-opcode.h
> ===================================================================
> --- linux-2.6-ozlabs.orig/arch/powerpc/include/asm/ppc-opcode.h
> +++ linux-2.6-ozlabs/arch/powerpc/include/asm/ppc-opcode.h
> @@ -47,10 +47,10 @@
> #define PPC_INST_WAIT			0x7c00007c
>
> /* macros to insert fields into opcodes */
> -#define __PPC_RA(a)	((a & 0x1f) << 16)
> -#define __PPC_RB(b)	((b & 0x1f) << 11)
> -#define __PPC_T_TLB(t)	((t & 0x3) << 21)
> -#define __PPC_WC(w)	((w & 0x3) << 21)
> +#define __PPC_RA(a)	(((a) & 0x1f) << 16)
> +#define __PPC_RB(b)	(((b) & 0x1f) << 11)
> +#define __PPC_T_TLB(t)	(((t) & 0x3) << 21)
> +#define __PPC_WC(w)	(((w) & 0x3) << 21)
>
> /* Deal with instructions that older assemblers aren't aware of */
> #define	PPC_DCBAL(a, b)		stringify_in_c(.long PPC_INST_DCBAL | \

Patch

Index: linux-2.6-ozlabs/arch/powerpc/include/asm/ppc-opcode.h
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/include/asm/ppc-opcode.h
+++ linux-2.6-ozlabs/arch/powerpc/include/asm/ppc-opcode.h
@@ -47,10 +47,10 @@ 
 #define PPC_INST_WAIT			0x7c00007c
 
 /* macros to insert fields into opcodes */
-#define __PPC_RA(a)	((a & 0x1f) << 16)
-#define __PPC_RB(b)	((b & 0x1f) << 11)
-#define __PPC_T_TLB(t)	((t & 0x3) << 21)
-#define __PPC_WC(w)	((w & 0x3) << 21)
+#define __PPC_RA(a)	(((a) & 0x1f) << 16)
+#define __PPC_RB(b)	(((b) & 0x1f) << 11)
+#define __PPC_T_TLB(t)	(((t) & 0x3) << 21)
+#define __PPC_WC(w)	(((w) & 0x3) << 21)
 
 /* Deal with instructions that older assemblers aren't aware of */
 #define	PPC_DCBAL(a, b)		stringify_in_c(.long PPC_INST_DCBAL | \