* [PATCH] bitops: Add missing parentheses to new get_order macro
@ 2012-02-24 12:58 Joerg Roedel
2012-02-24 15:10 ` Arnd Bergmann
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Joerg Roedel @ 2012-02-24 12:58 UTC (permalink / raw)
To: linux-kernel
Cc: Joerg Roedel, Ingo Molnar, David Howells, Arnd Bergmann, H. Peter Anvin
The new get_order macro introcuded in commit
d66acc39c7cee323733c8503b9de1821a56dff7e
does not use parentheses around all uses of the parameter n.
This causes new compile warnings, for example in the
amd_iommu_init.c function:
drivers/iommu/amd_iommu_init.c:561:6: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
drivers/iommu/amd_iommu_init.c:561:6: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
Fix those warnings by adding the missing parentheses.
Reported-by: Ingo Molnar <mingo@elte.hu>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Howells <dhowells@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
include/asm-generic/getorder.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/asm-generic/getorder.h b/include/asm-generic/getorder.h
index e0fb4bf..65e4468 100644
--- a/include/asm-generic/getorder.h
+++ b/include/asm-generic/getorder.h
@@ -49,8 +49,8 @@ int __get_order(unsigned long size)
#define get_order(n) \
( \
__builtin_constant_p(n) ? ( \
- (n == 0UL) ? BITS_PER_LONG - PAGE_SHIFT : \
- ((n < (1UL << PAGE_SHIFT)) ? 0 : \
+ ((n) == 0UL) ? BITS_PER_LONG - PAGE_SHIFT : \
+ (((n) < (1UL << PAGE_SHIFT)) ? 0 : \
ilog2((n) - 1) - PAGE_SHIFT + 1) \
) : \
__get_order(n) \
--
1.7.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] bitops: Add missing parentheses to new get_order macro
2012-02-24 12:58 [PATCH] bitops: Add missing parentheses to new get_order macro Joerg Roedel
@ 2012-02-24 15:10 ` Arnd Bergmann
2012-02-24 20:16 ` [tip:x86/asm] " tip-bot for Joerg Roedel
2012-03-05 15:58 ` [PATCH] " David Howells
2 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2012-02-24 15:10 UTC (permalink / raw)
To: Joerg Roedel; +Cc: linux-kernel, Ingo Molnar, David Howells, H. Peter Anvin
On Friday 24 February 2012, Joerg Roedel wrote:
> d66acc39c7cee323733c8503b9de1821a56dff7e
>
> does not use parentheses around all uses of the parameter n.
> This causes new compile warnings, for example in the
> amd_iommu_init.c function:
>
> drivers/iommu/amd_iommu_init.c:561:6: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
> drivers/iommu/amd_iommu_init.c:561:6: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
>
> Fix those warnings by adding the missing parentheses.
>
> Reported-by: Ingo Molnar <mingo@elte.hu>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: David Howells <dhowells@redhat.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:x86/asm] bitops: Add missing parentheses to new get_order macro
2012-02-24 12:58 [PATCH] bitops: Add missing parentheses to new get_order macro Joerg Roedel
2012-02-24 15:10 ` Arnd Bergmann
@ 2012-02-24 20:16 ` tip-bot for Joerg Roedel
2012-03-05 15:58 ` [PATCH] " David Howells
2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Joerg Roedel @ 2012-02-24 20:16 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, joerg.roedel, arnd, dhowells, tglx, hpa, mingo
Commit-ID: b893485db994b17402524d3d700b950294cb6c97
Gitweb: http://git.kernel.org/tip/b893485db994b17402524d3d700b950294cb6c97
Author: Joerg Roedel <joerg.roedel@amd.com>
AuthorDate: Fri, 24 Feb 2012 13:58:15 +0100
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Fri, 24 Feb 2012 10:39:27 -0800
bitops: Add missing parentheses to new get_order macro
The new get_order macro introcuded in commit
d66acc39c7cee323733c8503b9de1821a56dff7e
does not use parentheses around all uses of the parameter n.
This causes new compile warnings, for example in the
amd_iommu_init.c function:
drivers/iommu/amd_iommu_init.c:561:6: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
drivers/iommu/amd_iommu_init.c:561:6: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
Fix those warnings by adding the missing parentheses.
Reported-by: Ingo Molnar <mingo@elte.hu>
Cc: David Howells <dhowells@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Link: http://lkml.kernel.org/r/1330088295-28732-1-git-send-email-joerg.roedel@amd.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
include/asm-generic/getorder.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/asm-generic/getorder.h b/include/asm-generic/getorder.h
index e0fb4bf..65e4468 100644
--- a/include/asm-generic/getorder.h
+++ b/include/asm-generic/getorder.h
@@ -49,8 +49,8 @@ int __get_order(unsigned long size)
#define get_order(n) \
( \
__builtin_constant_p(n) ? ( \
- (n == 0UL) ? BITS_PER_LONG - PAGE_SHIFT : \
- ((n < (1UL << PAGE_SHIFT)) ? 0 : \
+ ((n) == 0UL) ? BITS_PER_LONG - PAGE_SHIFT : \
+ (((n) < (1UL << PAGE_SHIFT)) ? 0 : \
ilog2((n) - 1) - PAGE_SHIFT + 1) \
) : \
__get_order(n) \
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] bitops: Add missing parentheses to new get_order macro
2012-02-24 12:58 [PATCH] bitops: Add missing parentheses to new get_order macro Joerg Roedel
2012-02-24 15:10 ` Arnd Bergmann
2012-02-24 20:16 ` [tip:x86/asm] " tip-bot for Joerg Roedel
@ 2012-03-05 15:58 ` David Howells
2 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2012-03-05 15:58 UTC (permalink / raw)
To: Joerg Roedel
Cc: dhowells, linux-kernel, Ingo Molnar, Arnd Bergmann, H. Peter Anvin
Joerg Roedel <joerg.roedel@amd.com> wrote:
> The new get_order macro introcuded in commit
>
> d66acc39c7cee323733c8503b9de1821a56dff7e
>
> does not use parentheses around all uses of the parameter n.
> This causes new compile warnings, for example in the
> amd_iommu_init.c function:
>
> drivers/iommu/amd_iommu_init.c:561:6: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
> drivers/iommu/amd_iommu_init.c:561:6: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
>
> Fix those warnings by adding the missing parentheses.
>
> Reported-by: Ingo Molnar <mingo@elte.hu>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: David Howells <dhowells@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-05 15:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-24 12:58 [PATCH] bitops: Add missing parentheses to new get_order macro Joerg Roedel
2012-02-24 15:10 ` Arnd Bergmann
2012-02-24 20:16 ` [tip:x86/asm] " tip-bot for Joerg Roedel
2012-03-05 15:58 ` [PATCH] " David Howells
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.