Commit 00eae9e1 authored by Greg Ungerer's avatar Greg Ungerer Committed by Anton Blanchard

[PATCH] clean up m68knommu bitops.h

Rework the bitops functions for the m68knommu arhcitecture. Change
all addr pointers to be "unsigned long", cleans up many compiler
warnings.
parent 815dece7
...@@ -11,31 +11,6 @@ ...@@ -11,31 +11,6 @@
#include <asm/system.h> /* save_flags */ #include <asm/system.h> /* save_flags */
#ifdef __KERNEL__ #ifdef __KERNEL__
/*
* Function prototypes to keep gcc -Wall happy
*/
/*
* The __ functions are not atomic
*/
extern void set_bit(int nr, volatile void * addr);
extern void __set_bit(int nr, volatile void * addr);
extern void clear_bit(int nr, volatile void * addr);
extern void __clear_bit(int nr, volatile void * addr);
extern void change_bit(int nr, volatile void * addr);
extern void __change_bit(int nr, volatile void * addr);
extern int test_and_set_bit(int nr, volatile void * addr);
extern int __test_and_set_bit(int nr, volatile void * addr);
extern int test_and_clear_bit(int nr, volatile void * addr);
extern int __test_and_clear_bit(int nr, volatile void * addr);
extern int test_and_change_bit(int nr, volatile void * addr);
extern int __test_and_change_bit(int nr, volatile void * addr);
extern int __constant_test_bit(int nr, const volatile void * addr);
extern int __test_bit(int nr, volatile void * addr);
extern int find_first_zero_bit(void * addr, unsigned size);
extern int find_next_zero_bit (void * addr, int size, int offset);
/* /*
* Generic ffs(). * Generic ffs().
...@@ -130,7 +105,7 @@ static inline int sched_find_first_bit(unsigned long *b) ...@@ -130,7 +105,7 @@ static inline int sched_find_first_bit(unsigned long *b)
* ffz = Find First Zero in word. Undefined if no zero exists, * ffz = Find First Zero in word. Undefined if no zero exists,
* so code should check against ~0UL first.. * so code should check against ~0UL first..
*/ */
extern __inline__ unsigned long ffz(unsigned long word) static __inline__ unsigned long ffz(unsigned long word)
{ {
unsigned long result = 0; unsigned long result = 0;
...@@ -142,7 +117,7 @@ extern __inline__ unsigned long ffz(unsigned long word) ...@@ -142,7 +117,7 @@ extern __inline__ unsigned long ffz(unsigned long word)
} }
extern __inline__ void set_bit(int nr, volatile void * addr) static __inline__ void set_bit(int nr, volatile unsigned long * addr)
{ {
int * a = (int *) addr; int * a = (int *) addr;
int mask; int mask;
...@@ -155,7 +130,7 @@ extern __inline__ void set_bit(int nr, volatile void * addr) ...@@ -155,7 +130,7 @@ extern __inline__ void set_bit(int nr, volatile void * addr)
local_irq_restore(flags); local_irq_restore(flags);
} }
extern __inline__ void __set_bit(int nr, volatile void * addr) static __inline__ void __set_bit(int nr, volatile unsigned long * addr)
{ {
int * a = (int *) addr; int * a = (int *) addr;
int mask; int mask;
...@@ -171,7 +146,7 @@ extern __inline__ void __set_bit(int nr, volatile void * addr) ...@@ -171,7 +146,7 @@ extern __inline__ void __set_bit(int nr, volatile void * addr)
#define smp_mb__before_clear_bit() barrier() #define smp_mb__before_clear_bit() barrier()
#define smp_mb__after_clear_bit() barrier() #define smp_mb__after_clear_bit() barrier()
extern __inline__ void clear_bit(int nr, volatile void * addr) static __inline__ void clear_bit(int nr, volatile unsigned long * addr)
{ {
int * a = (int *) addr; int * a = (int *) addr;
int mask; int mask;
...@@ -184,7 +159,7 @@ extern __inline__ void clear_bit(int nr, volatile void * addr) ...@@ -184,7 +159,7 @@ extern __inline__ void clear_bit(int nr, volatile void * addr)
local_irq_restore(flags); local_irq_restore(flags);
} }
extern __inline__ void __clear_bit(int nr, volatile void * addr) static __inline__ void __clear_bit(int nr, volatile unsigned long * addr)
{ {
int * a = (int *) addr; int * a = (int *) addr;
int mask; int mask;
...@@ -194,7 +169,7 @@ extern __inline__ void __clear_bit(int nr, volatile void * addr) ...@@ -194,7 +169,7 @@ extern __inline__ void __clear_bit(int nr, volatile void * addr)
*a &= ~mask; *a &= ~mask;
} }
extern __inline__ void change_bit(int nr, volatile void * addr) static __inline__ void change_bit(int nr, volatile unsigned long * addr)
{ {
int mask, flags; int mask, flags;
unsigned long *ADDR = (unsigned long *) addr; unsigned long *ADDR = (unsigned long *) addr;
...@@ -206,7 +181,7 @@ extern __inline__ void change_bit(int nr, volatile void * addr) ...@@ -206,7 +181,7 @@ extern __inline__ void change_bit(int nr, volatile void * addr)
local_irq_restore(flags); local_irq_restore(flags);
} }
extern __inline__ void __change_bit(int nr, volatile void * addr) static __inline__ void __change_bit(int nr, volatile unsigned long * addr)
{ {
int mask; int mask;
unsigned long *ADDR = (unsigned long *) addr; unsigned long *ADDR = (unsigned long *) addr;
...@@ -216,7 +191,7 @@ extern __inline__ void __change_bit(int nr, volatile void * addr) ...@@ -216,7 +191,7 @@ extern __inline__ void __change_bit(int nr, volatile void * addr)
*ADDR ^= mask; *ADDR ^= mask;
} }
extern __inline__ int test_and_set_bit(int nr, volatile void * addr) static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr)
{ {
int mask, retval; int mask, retval;
volatile unsigned int *a = (volatile unsigned int *) addr; volatile unsigned int *a = (volatile unsigned int *) addr;
...@@ -232,7 +207,7 @@ extern __inline__ int test_and_set_bit(int nr, volatile void * addr) ...@@ -232,7 +207,7 @@ extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
return retval; return retval;
} }
extern __inline__ int __test_and_set_bit(int nr, volatile void * addr) static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * addr)
{ {
int mask, retval; int mask, retval;
volatile unsigned int *a = (volatile unsigned int *) addr; volatile unsigned int *a = (volatile unsigned int *) addr;
...@@ -244,7 +219,7 @@ extern __inline__ int __test_and_set_bit(int nr, volatile void * addr) ...@@ -244,7 +219,7 @@ extern __inline__ int __test_and_set_bit(int nr, volatile void * addr)
return retval; return retval;
} }
extern __inline__ int test_and_clear_bit(int nr, volatile void * addr) static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr)
{ {
int mask, retval; int mask, retval;
volatile unsigned int *a = (volatile unsigned int *) addr; volatile unsigned int *a = (volatile unsigned int *) addr;
...@@ -260,7 +235,7 @@ extern __inline__ int test_and_clear_bit(int nr, volatile void * addr) ...@@ -260,7 +235,7 @@ extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
return retval; return retval;
} }
extern __inline__ int __test_and_clear_bit(int nr, volatile void * addr) static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long * addr)
{ {
int mask, retval; int mask, retval;
volatile unsigned int *a = (volatile unsigned int *) addr; volatile unsigned int *a = (volatile unsigned int *) addr;
...@@ -272,7 +247,7 @@ extern __inline__ int __test_and_clear_bit(int nr, volatile void * addr) ...@@ -272,7 +247,7 @@ extern __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
return retval; return retval;
} }
extern __inline__ int test_and_change_bit(int nr, volatile void * addr) static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr)
{ {
int mask, retval; int mask, retval;
volatile unsigned int *a = (volatile unsigned int *) addr; volatile unsigned int *a = (volatile unsigned int *) addr;
...@@ -288,7 +263,7 @@ extern __inline__ int test_and_change_bit(int nr, volatile void * addr) ...@@ -288,7 +263,7 @@ extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
return retval; return retval;
} }
extern __inline__ int __test_and_change_bit(int nr, volatile void * addr) static __inline__ int __test_and_change_bit(int nr, volatile unsigned long * addr)
{ {
int mask, retval; int mask, retval;
volatile unsigned int *a = (volatile unsigned int *) addr; volatile unsigned int *a = (volatile unsigned int *) addr;
...@@ -303,12 +278,12 @@ extern __inline__ int __test_and_change_bit(int nr, volatile void * addr) ...@@ -303,12 +278,12 @@ extern __inline__ int __test_and_change_bit(int nr, volatile void * addr)
/* /*
* This routine doesn't need to be atomic. * This routine doesn't need to be atomic.
*/ */
extern __inline__ int __constant_test_bit(int nr, const volatile void * addr) static __inline__ int __constant_test_bit(int nr, const volatile unsigned long * addr)
{ {
return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0; return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
} }
extern __inline__ int __test_bit(int nr, volatile void * addr) static __inline__ int __test_bit(int nr, const unsigned long * addr)
{ {
int * a = (int *) addr; int * a = (int *) addr;
int mask; int mask;
...@@ -326,7 +301,7 @@ extern __inline__ int __test_bit(int nr, volatile void * addr) ...@@ -326,7 +301,7 @@ extern __inline__ int __test_bit(int nr, volatile void * addr)
#define find_first_zero_bit(addr, size) \ #define find_first_zero_bit(addr, size) \
find_next_zero_bit((addr), (size), 0) find_next_zero_bit((addr), (size), 0)
extern __inline__ int find_next_zero_bit (void * addr, int size, int offset) static __inline__ int find_next_zero_bit (void * addr, int size, int offset)
{ {
unsigned long *p = ((unsigned long *) addr) + (offset >> 5); unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
unsigned long result = offset & ~31UL; unsigned long result = offset & ~31UL;
...@@ -372,7 +347,7 @@ extern __inline__ int find_next_zero_bit (void * addr, int size, int offset) ...@@ -372,7 +347,7 @@ extern __inline__ int find_next_zero_bit (void * addr, int size, int offset)
#define hweight8(x) generic_hweight8(x) #define hweight8(x) generic_hweight8(x)
extern __inline__ int ext2_set_bit(int nr, volatile void * addr) static __inline__ int ext2_set_bit(int nr, volatile void * addr)
{ {
int mask, retval; int mask, retval;
unsigned long flags; unsigned long flags;
...@@ -387,7 +362,7 @@ extern __inline__ int ext2_set_bit(int nr, volatile void * addr) ...@@ -387,7 +362,7 @@ extern __inline__ int ext2_set_bit(int nr, volatile void * addr)
return retval; return retval;
} }
extern __inline__ int ext2_clear_bit(int nr, volatile void * addr) static __inline__ int ext2_clear_bit(int nr, volatile void * addr)
{ {
int mask, retval; int mask, retval;
unsigned long flags; unsigned long flags;
...@@ -420,7 +395,7 @@ extern __inline__ int ext2_clear_bit(int nr, volatile void * addr) ...@@ -420,7 +395,7 @@ extern __inline__ int ext2_clear_bit(int nr, volatile void * addr)
ret; \ ret; \
}) })
extern __inline__ int ext2_test_bit(int nr, const volatile void * addr) static __inline__ int ext2_test_bit(int nr, const volatile void * addr)
{ {
int mask; int mask;
const volatile unsigned char *ADDR = (const unsigned char *) addr; const volatile unsigned char *ADDR = (const unsigned char *) addr;
...@@ -433,7 +408,7 @@ extern __inline__ int ext2_test_bit(int nr, const volatile void * addr) ...@@ -433,7 +408,7 @@ extern __inline__ int ext2_test_bit(int nr, const volatile void * addr)
#define ext2_find_first_zero_bit(addr, size) \ #define ext2_find_first_zero_bit(addr, size) \
ext2_find_next_zero_bit((addr), (size), 0) ext2_find_next_zero_bit((addr), (size), 0)
extern __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset) static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
{ {
unsigned long *p = ((unsigned long *) addr) + (offset >> 5); unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
unsigned long result = offset & ~31UL; unsigned long result = offset & ~31UL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment