Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joerg Roedel and committed by
H. Peter Anvin
b893485d d66acc39

+2 -2
+2 -2
include/asm-generic/getorder.h
··· 49 49 #define get_order(n) \ 50 50 ( \ 51 51 __builtin_constant_p(n) ? ( \ 52 - (n == 0UL) ? BITS_PER_LONG - PAGE_SHIFT : \ 53 - ((n < (1UL << PAGE_SHIFT)) ? 0 : \ 52 + ((n) == 0UL) ? BITS_PER_LONG - PAGE_SHIFT : \ 53 + (((n) < (1UL << PAGE_SHIFT)) ? 0 : \ 54 54 ilog2((n) - 1) - PAGE_SHIFT + 1) \ 55 55 ) : \ 56 56 __get_order(n) \