bitops: Change the bitmap index from int to unsigned long [frv]
PATCH 14/15 bitops: Change the bitmap index from int to unsigned long [frv]
Change the index to unsigned long in all bitops for [frv]
--- include/asm-frv/bitops.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)
include/asm-frv/bitops.h +15 -14
@@ -112,7 +112,7 @@#define atomic_clear_mask (mask, v) atomic_test_and_ANDNOT_mask((mask), (v))#define atomic_set_mask (mask, v) atomic_test_and_OR_mask((mask), (v)) -static inline int test_and_clear_bit (int nr,volatile void *addr) +static inline int test_and_clear_bit (unsigned long nr,volatile void *addr) {volatile unsigned long *ptr = addr;unsigned long mask =1UL << (nr &31 );
@@ -120,7 +120,7 @@return (atomic_test_and_ANDNOT_mask (mask, ptr) & mask) !=0 ; } -static inline int test_and_set_bit (int nr,volatile void *addr) +static inline int test_and_set_bit (unsigned long nr,volatile void *addr) {volatile unsigned long *ptr = addr;unsigned long mask =1UL << (nr &31 );
@@ -128,7 +128,7 @@return (atomic_test_and_OR_mask (mask, ptr) & mask) !=0 ; } -static inline int test_and_change_bit (int nr,volatile void *addr) +static inline int test_and_change_bit (unsigned long nr,volatile void *addr) {volatile unsigned long *ptr = addr;unsigned long mask =1UL << (nr &31 );
@@ -136,22 +136,22 @@return (atomic_test_and_XOR_mask (mask, ptr) & mask) !=0 ; } -static inline void clear_bit (int nr,volatile void *addr) +static inline void clear_bit (unsigned long nr,volatile void *addr) {test_and_clear_bit (nr, addr); } -static inline void set_bit (int nr,volatile void *addr) +static inline void set_bit (unsigned long nr,volatile void *addr) {test_and_set_bit (nr, addr); } -static inline void change_bit (int nr,volatile void * addr) +static inline void change_bit (unsigned long nr,volatile void *addr) {test_and_change_bit (nr, addr); } -static inline void __clear_bit (int nr,volatile void * addr) +static inline void __clear_bit (unsigned long nr,volatile void *addr) {volatile unsigned long *a = addr;int mask;
@@ -161,7 +161,7 @@ *a &= ~mask; } -static inline void __set_bit (int nr,volatile void * addr) +static inline void __set_bit (unsigned long nr,volatile void *addr) {volatile unsigned long *a = addr;int mask;
@@ -171,7 +171,7 @@ *a |= mask; } -static inline void __change_bit (int nr,volatile void *addr) +static inline void __change_bit (unsigned long nr,volatile void *addr) {volatile unsigned long *a = addr;int mask;
@@ -181,7 +181,7 @@ *a ^= mask; } -static inline int __test_and_clear_bit (int nr,volatile void * addr) +static inline int __test_and_clear_bit (unsigned long nr,volatile void *addr) {volatile unsigned long *a = addr;int mask, retval;
@@ -193,7 +193,7 @@return retval; } -static inline int __test_and_set_bit (int nr,volatile void * addr) +static inline int __test_and_set_bit (unsigned long nr,volatile void *addr) {volatile unsigned long *a = addr;int mask, retval;
@@ -205,7 +205,7 @@return retval; } -static inline int __test_and_change_bit (int nr,volatile void * addr) +static inline int __test_and_change_bit (unsigned long nr,volatile void *addr) {volatile unsigned long *a = addr;int mask, retval;
@@ -220,12 +220,13 @@/* * This routine doesn't need to be atomic. */ -static inline int __constant_test_bit (int nr,const volatile void * addr) +static inline int +__constant_test_bit (unsigned long nr,const volatile void *addr) {return ((1UL << (nr &31 )) & (((const volatile unsigned int *) addr)[nr >>5 ])) !=0 ; } -static inline int __test_bit (int nr,const volatile void * addr) +static inline int __test_bit (unsigned long nr,const volatile void *addr) {int * a = (int *) addr;int mask;
Quoted 4 lines · Justin Chen
Change the index to unsigned long in all bitops for [frv]
Signed-off-by Justin Chen <[email protected]>Reviewed-by Bjorn Helgaas <[email protected]>
Mostly okay, apart from:
include/asm-frv/bitops.h line 224
Quoted 3 lines
include/asm-frv/bitops.h +2
-1-static inline int __constant_test_bit (int nr,const volatile void * addr) +static inline int +__constant_test_bit (unsigned long nr,const volatile void *addr)
Please move the return type onto the next line also. Other than that:
Quoted 8 lines · David Howells
include/asm-frv/bitops.h line 224
Quoted 4 lines
include/asm-frv/bitops.h +2
-1-static inline int __constant_test_bit (int nr,const volatile void * addr) +static inline int +__constant_test_bit (unsigned long nr,const volatile void *addr)Please move the return type onto the next line also. Other than that:
Acked-by David Howells <[email protected]>
What makes you say that, in particular? A casual grep finds no less than 3524 instances of "static inline <type>" -- presumably with a function name following -- and only 447 instances of "static inline" without a type in the kernel.
-hpa
Quoted 1 line · H. Peter Anvin
What makes you say that, in particular?
I prefer it. Actually, I'd prefer it all to be on one line, but some people get picky about the 80 char limit.
Besides, that "static inline" is merely a qualifier to the declaration of the function. The return type, name and args are part of the declaration of the function and belong together more.
Quoted 3 lines
A casual grep finds no less than 3524 instances of "static inline <type>" -- presumably with a function name following -- and only 447 instances of "static inline" without a type in the kernel.
But how does it break down between "static inline type\nfunction_name" and "static inline\ntype function_name"? That's more to the point.
David
Quoted 8 lines · David Howells
Quoted 4 lines
A casual grep finds no less than 3524 instances of "static inline <type>" -- presumably with a function name following -- and only 447 instances of "static inline" without a type in the kernel.
But how does it break down between "static inline type\nfunction_name" and "static inline\ntype
function_name"? That's more to the point.
I believe that is the breakdown is roughly what you see above, i.e. over 8:1; the pattern I used was looking for "^static inline[^;(]*$", and a visual examination of the results shows that even if my line count is slighly off the lopsidedness is still dramatic.
-hpa
Quoted 8 lines · David Howells
Quoted 4 lines
A casual grep finds no less than 3524 instances of "static inline <type>" -- presumably with a function name following -- and only 447 instances of "static inline" without a type in the kernel.
But how does it break down between "static inline type\nfunction_name" and "static inline\ntype
function_name"? That's more to the point.
I believe that is the breakdown is roughly what you see above, i.e. over 8:1; the pattern I used was looking for "^static inline[^;(]*$", and a visual examination of the results shows that even if my line count is slighly off the lopsidedness is still dramatic.
-hpa
Quoted 8 lines · H. Peter Anvin
Quoted 3 lines
But how does it break down between "static inline type\nfunction_name" and "static inline\ntype
function_name"? That's more to the point.I believe that is the breakdown is roughly what you see above, i.e. over 8:1; the pattern I used was looking for "^static inline[^;(]*$", and a visual examination of the results shows that even if my line count is slighly off the lopsidedness is still dramatic.
Sorry, I meant:
"static inline type\nfunction_name" vs "static inline type function_name"
David
Quoted 5 lines · David Howells
Quoted 3 lines · H. Peter Anvin
Quoted 3 lines
But how does it break down between "static inline type\nfunction_name" and "static inline\ntype
function_name"? That's more to the point.
Quoted 9 lines
Quoted 4 lines
I believe that is the breakdown is roughly what you see above, i.e. over 8:1; the pattern I used was looking for "^static inline[^;(]*$", and a visual examination of the results shows that even if my line count is slighly off the lopsidedness is still dramatic.
Sorry, I meant:
"static inline type\nfunction_name" vs "static inline type
function_name"
Well, the latter is obviously in vast majority, but that doesn't seem to have anything to do with anything at all here...
-hpa