Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
bitops: Add missing parentheses to new get_order macro
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joerg Roedel  
View profile  
 More options Feb 24 2012, 8:00 am
Newsgroups: linux.kernel
From: Joerg Roedel <joerg.roe...@amd.com>
Date: Fri, 24 Feb 2012 14:00:01 +0100
Local: Fri, Feb 24 2012 8:00 am
Subject: [PATCH] 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 <mi...@elte.hu>
Cc: Ingo Molnar <mi...@elte.hu>
Cc: David Howells <dhowe...@redhat.com>
Cc: Arnd Bergmann <a...@arndb.de>
Cc: H. Peter Anvin <h...@zytor.com>
Signed-off-by: Joerg Roedel <joerg.roe...@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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Arnd Bergmann  
View profile  
 More options Feb 24 2012, 10:20 am
Newsgroups: linux.kernel
From: Arnd Bergmann <a...@arndb.de>
Date: Fri, 24 Feb 2012 16:20:02 +0100
Local: Fri, Feb 24 2012 10:20 am
Subject: Re: [PATCH] bitops: Add missing parentheses to new get_order macro
On Friday 24 February 2012, Joerg Roedel wrote:

Acked-by: Arnd Bergmann <a...@arndb.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tip-bot for Joerg Roedel  
View profile  
 More options Feb 24 2012, 3:20 pm
Newsgroups: linux.kernel
From: tip-bot for Joerg Roedel <joerg.roe...@amd.com>
Date: Fri, 24 Feb 2012 21:20:02 +0100
Local: Fri, Feb 24 2012 3:20 pm
Subject: [tip:x86/asm] bitops: Add missing parentheses to new get_order macro
Commit-ID:  b893485db994b17402524d3d700b950294cb6c97
Gitweb:     http://git.kernel.org/tip/b893485db994b17402524d3d700b950294cb6c97
Author:     Joerg Roedel <joerg.roe...@amd.com>
AuthorDate: Fri, 24 Feb 2012 13:58:15 +0100
Committer:  H. Peter Anvin <h...@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 <mi...@elte.hu>
Cc: David Howells <dhowe...@redhat.com>
Acked-by: Arnd Bergmann <a...@arndb.de>
Signed-off-by: Joerg Roedel <joerg.roe...@amd.com>
Link: http://lkml.kernel.org/r/1330088295-28732-1-git-send-email-joerg.roe...@amd.com
Signed-off-by: H. Peter Anvin <h...@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)                                          \
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Howells  
View profile  
 More options Mar 5 2012, 11:00 am
Newsgroups: linux.kernel
From: David Howells <dhowe...@redhat.com>
Date: Mon, 05 Mar 2012 17:00:03 +0100
Local: Mon, Mar 5 2012 11:00 am
Subject: Re: [PATCH] bitops: Add missing parentheses to new get_order macro

Acked-by: David Howells <dhowe...@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »