public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Removed superfluous parentheses in macro defs
@ 2011-10-06 22:22 Alex Ben
  2011-10-06 22:50 ` Borislav Petkov
  2011-10-07  3:18 ` H. Peter Anvin
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Ben @ 2011-10-06 22:22 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel; +Cc: Alex Ben

1) make it consistent with other constant macro deinitions, which
don't have parentheses, as they are really superfluous.

2) the extra parentheses on the 5th line of #define GDT_ENTRY is
superfluous, as there is no bit shifting on that line.
---
 arch/x86/include/asm/segment.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
index 5e64171..92621c1 100644
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
@@ -10,7 +10,7 @@
	 (((flags) & _AC(0x0000f0ff,ULL)) << 40) |	\
	 (((limit) & _AC(0x000f0000,ULL)) << (48-16)) |	\
	 (((base)  & _AC(0x00ffffff,ULL)) << 16) |	\
-	 (((limit) & _AC(0x0000ffff,ULL))))
+	 ((limit)  & _AC(0x0000ffff,ULL)))

 /* Simple and small GDT entries for booting only */

@@ -75,7 +75,7 @@

 #define GDT_ENTRY_DEFAULT_USER_DS	15

-#define GDT_ENTRY_KERNEL_BASE		(12)
+#define GDT_ENTRY_KERNEL_BASE		12

 #define GDT_ENTRY_KERNEL_CS		(GDT_ENTRY_KERNEL_BASE+0)

--
1.7.4.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: Removed superfluous parentheses in macro defs
  2011-10-06 22:22 [PATCH] x86: Removed superfluous parentheses in macro defs Alex Ben
@ 2011-10-06 22:50 ` Borislav Petkov
  2011-10-07  3:18 ` H. Peter Anvin
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2011-10-06 22:50 UTC (permalink / raw)
  To: Alex Ben; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel

On Fri, Oct 07, 2011 at 09:22:04AM +1100, Alex Ben wrote:
> 1) make it consistent with other constant macro deinitions, which
> don't have parentheses, as they are really superfluous.
> 
> 2) the extra parentheses on the 5th line of #define GDT_ENTRY is
> superfluous, as there is no bit shifting on that line.
> ---
>  arch/x86/include/asm/segment.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
> index 5e64171..92621c1 100644
> --- a/arch/x86/include/asm/segment.h
> +++ b/arch/x86/include/asm/segment.h
> @@ -10,7 +10,7 @@
> 	 (((flags) & _AC(0x0000f0ff,ULL)) << 40) |	\
> 	 (((limit) & _AC(0x000f0000,ULL)) << (48-16)) |	\
> 	 (((base)  & _AC(0x00ffffff,ULL)) << 16) |	\
> -	 (((limit) & _AC(0x0000ffff,ULL))))
> +	 ((limit)  & _AC(0x0000ffff,ULL)))
> 
>  /* Simple and small GDT entries for booting only */
> 
> @@ -75,7 +75,7 @@
> 
>  #define GDT_ENTRY_DEFAULT_USER_DS	15
> 
> -#define GDT_ENTRY_KERNEL_BASE		(12)
> +#define GDT_ENTRY_KERNEL_BASE		12

Please do a git annotate on the file you're patching and look at the
commit id which is listed for the GDT_ENTRY_KERNEL_BASE line to find out
why is the 12 parenthesized. Hint: 3234282f33b29

:-)

-- 
Regards/Gruss,
    Boris.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: Removed superfluous parentheses in macro defs
  2011-10-06 22:22 [PATCH] x86: Removed superfluous parentheses in macro defs Alex Ben
  2011-10-06 22:50 ` Borislav Petkov
@ 2011-10-07  3:18 ` H. Peter Anvin
  1 sibling, 0 replies; 3+ messages in thread
From: H. Peter Anvin @ 2011-10-07  3:18 UTC (permalink / raw)
  To: Alex Ben; +Cc: Thomas Gleixner, Ingo Molnar, x86, linux-kernel

On 10/06/2011 03:22 PM, Alex Ben wrote:
> 1) make it consistent with other constant macro deinitions, which
> don't have parentheses, as they are really superfluous.

Superfluous, yes, but it makes the expression read more regular.

> diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
> index 5e64171..92621c1 100644
> --- a/arch/x86/include/asm/segment.h
> +++ b/arch/x86/include/asm/segment.h
> @@ -10,7 +10,7 @@
> 	 (((flags) & _AC(0x0000f0ff,ULL)) << 40) |	\
> 	 (((limit) & _AC(0x000f0000,ULL)) << (48-16)) |	\
> 	 (((base)  & _AC(0x00ffffff,ULL)) << 16) |	\
> -	 (((limit) & _AC(0x0000ffff,ULL))))
> +	 ((limit)  & _AC(0x0000ffff,ULL)))
> 

So NAK.

	-hpa


-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-07  3:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06 22:22 [PATCH] x86: Removed superfluous parentheses in macro defs Alex Ben
2011-10-06 22:50 ` Borislav Petkov
2011-10-07  3:18 ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox