Commit 2c09c666 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

[PATCH] s390: warnings.

Warning fixes: remove an unused variable and make bitops complain if the
pointer isn't of type long. Make 31 bit BUG() emit 4 0-bytes instead of 2.
This improves the readability of the listing.
parent 640bb315
...@@ -40,7 +40,6 @@ extern spinlock_t modlist_lock; ...@@ -40,7 +40,6 @@ extern spinlock_t modlist_lock;
unsigned long unsigned long
search_exception_table(unsigned long addr) search_exception_table(unsigned long addr)
{ {
struct list_head *i;
unsigned long ret = 0; unsigned long ret = 0;
#ifndef CONFIG_MODULES #ifndef CONFIG_MODULES
......
...@@ -53,7 +53,7 @@ extern const char _sb_findmap[]; ...@@ -53,7 +53,7 @@ extern const char _sb_findmap[];
/* /*
* SMP save set_bit routine based on compare and swap (CS) * SMP save set_bit routine based on compare and swap (CS)
*/ */
static inline void set_bit_cs(int nr, volatile void *ptr) static inline void set_bit_cs(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr, old, new, mask; unsigned long addr, old, new, mask;
...@@ -78,7 +78,7 @@ static inline void set_bit_cs(int nr, volatile void *ptr) ...@@ -78,7 +78,7 @@ static inline void set_bit_cs(int nr, volatile void *ptr)
/* /*
* SMP save clear_bit routine based on compare and swap (CS) * SMP save clear_bit routine based on compare and swap (CS)
*/ */
static inline void clear_bit_cs(int nr, volatile void *ptr) static inline void clear_bit_cs(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr, old, new, mask; unsigned long addr, old, new, mask;
...@@ -103,7 +103,7 @@ static inline void clear_bit_cs(int nr, volatile void *ptr) ...@@ -103,7 +103,7 @@ static inline void clear_bit_cs(int nr, volatile void *ptr)
/* /*
* SMP save change_bit routine based on compare and swap (CS) * SMP save change_bit routine based on compare and swap (CS)
*/ */
static inline void change_bit_cs(int nr, volatile void *ptr) static inline void change_bit_cs(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr, old, new, mask; unsigned long addr, old, new, mask;
...@@ -128,7 +128,8 @@ static inline void change_bit_cs(int nr, volatile void *ptr) ...@@ -128,7 +128,8 @@ static inline void change_bit_cs(int nr, volatile void *ptr)
/* /*
* SMP save test_and_set_bit routine based on compare and swap (CS) * SMP save test_and_set_bit routine based on compare and swap (CS)
*/ */
static inline int test_and_set_bit_cs(int nr, volatile void *ptr) static inline int
test_and_set_bit_cs(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr, old, new, mask; unsigned long addr, old, new, mask;
...@@ -154,7 +155,8 @@ static inline int test_and_set_bit_cs(int nr, volatile void *ptr) ...@@ -154,7 +155,8 @@ static inline int test_and_set_bit_cs(int nr, volatile void *ptr)
/* /*
* SMP save test_and_clear_bit routine based on compare and swap (CS) * SMP save test_and_clear_bit routine based on compare and swap (CS)
*/ */
static inline int test_and_clear_bit_cs(int nr, volatile void *ptr) static inline int
test_and_clear_bit_cs(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr, old, new, mask; unsigned long addr, old, new, mask;
...@@ -180,7 +182,8 @@ static inline int test_and_clear_bit_cs(int nr, volatile void *ptr) ...@@ -180,7 +182,8 @@ static inline int test_and_clear_bit_cs(int nr, volatile void *ptr)
/* /*
* SMP save test_and_change_bit routine based on compare and swap (CS) * SMP save test_and_change_bit routine based on compare and swap (CS)
*/ */
static inline int test_and_change_bit_cs(int nr, volatile void *ptr) static inline int
test_and_change_bit_cs(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr, old, new, mask; unsigned long addr, old, new, mask;
...@@ -207,7 +210,7 @@ static inline int test_and_change_bit_cs(int nr, volatile void *ptr) ...@@ -207,7 +210,7 @@ static inline int test_and_change_bit_cs(int nr, volatile void *ptr)
/* /*
* fast, non-SMP set_bit routine * fast, non-SMP set_bit routine
*/ */
static inline void __set_bit(int nr, volatile void *ptr) static inline void __set_bit(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
...@@ -219,7 +222,7 @@ static inline void __set_bit(int nr, volatile void *ptr) ...@@ -219,7 +222,7 @@ static inline void __set_bit(int nr, volatile void *ptr)
} }
static inline void static inline void
__constant_set_bit(const int nr, volatile void *ptr) __constant_set_bit(const int nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
...@@ -269,7 +272,7 @@ __constant_set_bit(const int nr, volatile void *ptr) ...@@ -269,7 +272,7 @@ __constant_set_bit(const int nr, volatile void *ptr)
* fast, non-SMP clear_bit routine * fast, non-SMP clear_bit routine
*/ */
static inline void static inline void
__clear_bit(int nr, volatile void *ptr) __clear_bit(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
...@@ -281,7 +284,7 @@ __clear_bit(int nr, volatile void *ptr) ...@@ -281,7 +284,7 @@ __clear_bit(int nr, volatile void *ptr)
} }
static inline void static inline void
__constant_clear_bit(const int nr, volatile void *ptr) __constant_clear_bit(const int nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
...@@ -330,7 +333,7 @@ __constant_clear_bit(const int nr, volatile void *ptr) ...@@ -330,7 +333,7 @@ __constant_clear_bit(const int nr, volatile void *ptr)
/* /*
* fast, non-SMP change_bit routine * fast, non-SMP change_bit routine
*/ */
static inline void __change_bit(int nr, volatile void *ptr) static inline void __change_bit(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
...@@ -342,7 +345,7 @@ static inline void __change_bit(int nr, volatile void *ptr) ...@@ -342,7 +345,7 @@ static inline void __change_bit(int nr, volatile void *ptr)
} }
static inline void static inline void
__constant_change_bit(const int nr, volatile void *ptr) __constant_change_bit(const int nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
...@@ -391,7 +394,8 @@ __constant_change_bit(const int nr, volatile void *ptr) ...@@ -391,7 +394,8 @@ __constant_change_bit(const int nr, volatile void *ptr)
/* /*
* fast, non-SMP test_and_set_bit routine * fast, non-SMP test_and_set_bit routine
*/ */
static inline int test_and_set_bit_simple(int nr, volatile void *ptr) static inline int
test_and_set_bit_simple(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
unsigned char ch; unsigned char ch;
...@@ -409,7 +413,8 @@ static inline int test_and_set_bit_simple(int nr, volatile void *ptr) ...@@ -409,7 +413,8 @@ static inline int test_and_set_bit_simple(int nr, volatile void *ptr)
/* /*
* fast, non-SMP test_and_clear_bit routine * fast, non-SMP test_and_clear_bit routine
*/ */
static inline int test_and_clear_bit_simple(int nr, volatile void *ptr) static inline int
test_and_clear_bit_simple(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
unsigned char ch; unsigned char ch;
...@@ -427,7 +432,8 @@ static inline int test_and_clear_bit_simple(int nr, volatile void *ptr) ...@@ -427,7 +432,8 @@ static inline int test_and_clear_bit_simple(int nr, volatile void *ptr)
/* /*
* fast, non-SMP test_and_change_bit routine * fast, non-SMP test_and_change_bit routine
*/ */
static inline int test_and_change_bit_simple(int nr, volatile void *ptr) static inline int
test_and_change_bit_simple(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
unsigned char ch; unsigned char ch;
...@@ -463,7 +469,7 @@ static inline int test_and_change_bit_simple(int nr, volatile void *ptr) ...@@ -463,7 +469,7 @@ static inline int test_and_change_bit_simple(int nr, volatile void *ptr)
* This routine doesn't need to be atomic. * This routine doesn't need to be atomic.
*/ */
static inline int __test_bit(int nr, volatile void *ptr) static inline int __test_bit(int nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
unsigned char ch; unsigned char ch;
...@@ -473,7 +479,8 @@ static inline int __test_bit(int nr, volatile void *ptr) ...@@ -473,7 +479,8 @@ static inline int __test_bit(int nr, volatile void *ptr)
return (ch >> (nr & 7)) & 1; return (ch >> (nr & 7)) & 1;
} }
static inline int __constant_test_bit(int nr, volatile void * addr) { static inline int
__constant_test_bit(int nr, volatile unsigned long * addr) {
return (((volatile char *) addr)[(nr>>3)^3] & (1<<(nr&7))) != 0; return (((volatile char *) addr)[(nr>>3)^3] & (1<<(nr&7))) != 0;
} }
...@@ -485,7 +492,8 @@ static inline int __constant_test_bit(int nr, volatile void * addr) { ...@@ -485,7 +492,8 @@ static inline int __constant_test_bit(int nr, volatile void * addr) {
/* /*
* Find-bit routines.. * Find-bit routines..
*/ */
static inline int find_first_zero_bit(void * addr, unsigned size) static inline int
find_first_zero_bit(unsigned long * addr, unsigned size)
{ {
unsigned long cmp, count; unsigned long cmp, count;
int res; int res;
...@@ -523,7 +531,8 @@ static inline int find_first_zero_bit(void * addr, unsigned size) ...@@ -523,7 +531,8 @@ static inline int find_first_zero_bit(void * addr, unsigned size)
return (res < size) ? res : size; return (res < size) ? res : size;
} }
static inline int find_first_bit(void * addr, unsigned size) static inline int
find_first_bit(unsigned long * addr, unsigned size)
{ {
unsigned long cmp, count; unsigned long cmp, count;
int res; int res;
...@@ -561,7 +570,8 @@ static inline int find_first_bit(void * addr, unsigned size) ...@@ -561,7 +570,8 @@ static inline int find_first_bit(void * addr, unsigned size)
return (res < size) ? res : size; return (res < size) ? res : size;
} }
static inline int find_next_zero_bit (void * addr, int size, int offset) static inline int
find_next_zero_bit (unsigned long * addr, int size, int offset)
{ {
unsigned long * p = ((unsigned long *) addr) + (offset >> 5); unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
unsigned long bitvec, reg; unsigned long bitvec, reg;
...@@ -599,7 +609,8 @@ static inline int find_next_zero_bit (void * addr, int size, int offset) ...@@ -599,7 +609,8 @@ static inline int find_next_zero_bit (void * addr, int size, int offset)
return (offset + res); return (offset + res);
} }
static inline int find_next_bit (void * addr, int size, int offset) static inline int
find_next_bit (unsigned long * addr, int size, int offset)
{ {
unsigned long * p = ((unsigned long *) addr) + (offset >> 5); unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
unsigned long bitvec, reg; unsigned long bitvec, reg;
...@@ -668,7 +679,7 @@ static inline unsigned long ffz(unsigned long word) ...@@ -668,7 +679,7 @@ static inline unsigned long ffz(unsigned long word)
* __ffs = find first bit in word. Undefined if no bit exists, * __ffs = find first bit in word. Undefined if no bit exists,
* so code should check against 0UL first.. * so code should check against 0UL first..
*/ */
static inline unsigned long __ffs(unsigned long word) static inline unsigned long __ffs (unsigned long word)
{ {
unsigned long reg, result; unsigned long reg, result;
...@@ -707,7 +718,7 @@ static inline int sched_find_first_bit(unsigned long *b) ...@@ -707,7 +718,7 @@ static inline int sched_find_first_bit(unsigned long *b)
* differs in spirit from the above ffz (man ffs). * differs in spirit from the above ffz (man ffs).
*/ */
extern int inline ffs (int x) extern inline int ffs (int x)
{ {
int r = 1; int r = 1;
...@@ -792,10 +803,15 @@ extern __inline__ int fls(int x) ...@@ -792,10 +803,15 @@ extern __inline__ int fls(int x)
* 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24 * 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
*/ */
#define ext2_set_bit(nr, addr) test_and_set_bit((nr)^24, addr) #define ext2_set_bit(nr, addr) \
#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr)^24, addr) test_and_set_bit((nr)^24, (unsigned long *)addr)
#define ext2_test_bit(nr, addr) test_bit((nr)^24, addr) #define ext2_clear_bit(nr, addr) \
static inline int ext2_find_first_zero_bit(void *vaddr, unsigned size) test_and_clear_bit((nr)^24, (unsigned long *)addr)
#define ext2_test_bit(nr, addr) \
test_bit((nr)^24, (unsigned long *)addr)
static inline int
ext2_find_first_zero_bit(void *vaddr, unsigned size)
{ {
unsigned long cmp, count; unsigned long cmp, count;
int res; int res;
......
...@@ -64,7 +64,7 @@ static inline void copy_page(void *to, void *from) ...@@ -64,7 +64,7 @@ static inline void copy_page(void *to, void *from)
#define BUG() do { \ #define BUG() do { \
printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
__asm__ __volatile__(".word 0x0000"); \ __asm__ __volatile__(".long 0"); \
} while (0) } while (0)
#define PAGE_BUG(page) do { \ #define PAGE_BUG(page) do { \
......
...@@ -60,13 +60,13 @@ typedef struct { ...@@ -60,13 +60,13 @@ typedef struct {
#endif #endif
#undef __FD_SET #undef __FD_SET
#define __FD_SET(fd,fdsetp) set_bit(fd,fdsetp) #define __FD_SET(fd,fdsetp) set_bit(fd,fdsetp->fds_bits)
#undef __FD_CLR #undef __FD_CLR
#define __FD_CLR(fd,fdsetp) clear_bit(fd,fdsetp) #define __FD_CLR(fd,fdsetp) clear_bit(fd,fdsetp->fds_bits)
#undef __FD_ISSET #undef __FD_ISSET
#define __FD_ISSET(fd,fdsetp) test_bit(fd,fdsetp) #define __FD_ISSET(fd,fdsetp) test_bit(fd,fdsetp->fds_bits)
#undef __FD_ZERO #undef __FD_ZERO
#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp))) #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
......
...@@ -228,7 +228,7 @@ static inline void __downgrade_write(struct rw_semaphore *sem) ...@@ -228,7 +228,7 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
: "=&d" (old), "=&d" (new) : "=&d" (old), "=&d" (new)
: "a" (&sem->count), "m" (tmp) : "a" (&sem->count), "m" (tmp)
: "cc", "memory" ); : "cc", "memory" );
if (new > 1) // FIXME: is this correct ?!? if (new > 1)
rwsem_downgrade_wake(sem); rwsem_downgrade_wake(sem);
} }
......
...@@ -25,13 +25,13 @@ ...@@ -25,13 +25,13 @@
*/ */
extern unsigned long machine_flags; extern unsigned long machine_flags;
#define MACHINE_IS_VM (machine_flags & 1) #define MACHINE_IS_VM (machine_flags & 1)
#define MACHINE_HAS_IEEE (machine_flags & 2) #define MACHINE_HAS_IEEE (machine_flags & 2)
#define MACHINE_IS_P390 (machine_flags & 4) #define MACHINE_IS_P390 (machine_flags & 4)
#define MACHINE_HAS_CSP (machine_flags & 8) #define MACHINE_HAS_CSP (machine_flags & 8)
#define MACHINE_HAS_MVPG (machine_flags & 16) #define MACHINE_HAS_MVPG (machine_flags & 16)
#define MACHINE_HAS_SCLP (!MACHINE_IS_P390) #define MACHINE_HAS_SCLP (!MACHINE_IS_P390)
/* /*
* Console mode. Override with conmode= * Console mode. Override with conmode=
......
#ifndef _S390_BITOPS_H
#define _S390_BITOPS_H
/* /*
* include/asm-s390/bitops.h * include/asm-s390/bitops.h
* *
...@@ -9,9 +12,7 @@ ...@@ -9,9 +12,7 @@
* Copyright (C) 1992, Linus Torvalds * Copyright (C) 1992, Linus Torvalds
* *
*/ */
#include <linux/config.h>
#ifndef _S390_BITOPS_H
#define _S390_BITOPS_H
/* /*
* bit 0 is the LSB of *addr; bit 63 is the MSB of *addr; * bit 0 is the LSB of *addr; bit 63 is the MSB of *addr;
...@@ -32,7 +33,6 @@ ...@@ -32,7 +33,6 @@
* of the form "flags |= (1 << bitnr)" are used INTERMIXED * of the form "flags |= (1 << bitnr)" are used INTERMIXED
* with operation of the form "set_bit(bitnr, flags)". * with operation of the form "set_bit(bitnr, flags)".
*/ */
#include <linux/config.h>
/* set ALIGN_CS to 1 if the SMP safe bit operations should /* set ALIGN_CS to 1 if the SMP safe bit operations should
* align the address to 4 byte boundary. It seems to work * align the address to 4 byte boundary. It seems to work
...@@ -57,7 +57,7 @@ extern const char _sb_findmap[]; ...@@ -57,7 +57,7 @@ extern const char _sb_findmap[];
/* /*
* SMP save set_bit routine based on compare and swap (CS) * SMP save set_bit routine based on compare and swap (CS)
*/ */
static inline void set_bit_cs(unsigned long nr, volatile void *ptr) static inline void set_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr, old, new, mask; unsigned long addr, old, new, mask;
...@@ -82,7 +82,7 @@ static inline void set_bit_cs(unsigned long nr, volatile void *ptr) ...@@ -82,7 +82,7 @@ static inline void set_bit_cs(unsigned long nr, volatile void *ptr)
/* /*
* SMP save clear_bit routine based on compare and swap (CS) * SMP save clear_bit routine based on compare and swap (CS)
*/ */
static inline void clear_bit_cs(unsigned long nr, volatile void *ptr) static inline void clear_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr, old, new, mask; unsigned long addr, old, new, mask;
...@@ -107,7 +107,7 @@ static inline void clear_bit_cs(unsigned long nr, volatile void *ptr) ...@@ -107,7 +107,7 @@ static inline void clear_bit_cs(unsigned long nr, volatile void *ptr)
/* /*
* SMP save change_bit routine based on compare and swap (CS) * SMP save change_bit routine based on compare and swap (CS)
*/ */
static inline void change_bit_cs(unsigned long nr, volatile void *ptr) static inline void change_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr, old, new, mask; unsigned long addr, old, new, mask;
...@@ -132,8 +132,8 @@ static inline void change_bit_cs(unsigned long nr, volatile void *ptr) ...@@ -132,8 +132,8 @@ static inline void change_bit_cs(unsigned long nr, volatile void *ptr)
/* /*
* SMP save test_and_set_bit routine based on compare and swap (CS) * SMP save test_and_set_bit routine based on compare and swap (CS)
*/ */
static inline int static inline int
test_and_set_bit_cs(unsigned long nr, volatile void *ptr) test_and_set_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr, old, new, mask; unsigned long addr, old, new, mask;
...@@ -160,7 +160,7 @@ test_and_set_bit_cs(unsigned long nr, volatile void *ptr) ...@@ -160,7 +160,7 @@ test_and_set_bit_cs(unsigned long nr, volatile void *ptr)
* SMP save test_and_clear_bit routine based on compare and swap (CS) * SMP save test_and_clear_bit routine based on compare and swap (CS)
*/ */
static inline int static inline int
test_and_clear_bit_cs(unsigned long nr, volatile void *ptr) test_and_clear_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr, old, new, mask; unsigned long addr, old, new, mask;
...@@ -187,7 +187,7 @@ test_and_clear_bit_cs(unsigned long nr, volatile void *ptr) ...@@ -187,7 +187,7 @@ test_and_clear_bit_cs(unsigned long nr, volatile void *ptr)
* SMP save test_and_change_bit routine based on compare and swap (CS) * SMP save test_and_change_bit routine based on compare and swap (CS)
*/ */
static inline int static inline int
test_and_change_bit_cs(unsigned long nr, volatile void *ptr) test_and_change_bit_cs(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr, old, new, mask; unsigned long addr, old, new, mask;
...@@ -214,7 +214,7 @@ test_and_change_bit_cs(unsigned long nr, volatile void *ptr) ...@@ -214,7 +214,7 @@ test_and_change_bit_cs(unsigned long nr, volatile void *ptr)
/* /*
* fast, non-SMP set_bit routine * fast, non-SMP set_bit routine
*/ */
static inline void __set_bit(unsigned long nr, volatile void *ptr) static inline void __set_bit(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
...@@ -226,7 +226,7 @@ static inline void __set_bit(unsigned long nr, volatile void *ptr) ...@@ -226,7 +226,7 @@ static inline void __set_bit(unsigned long nr, volatile void *ptr)
} }
static inline void static inline void
__constant_set_bit(const unsigned long nr, volatile void *ptr) __constant_set_bit(const unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
...@@ -276,7 +276,7 @@ __constant_set_bit(const unsigned long nr, volatile void *ptr) ...@@ -276,7 +276,7 @@ __constant_set_bit(const unsigned long nr, volatile void *ptr)
* fast, non-SMP clear_bit routine * fast, non-SMP clear_bit routine
*/ */
static inline void static inline void
__clear_bit(unsigned long nr, volatile void *ptr) __clear_bit(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
...@@ -288,7 +288,7 @@ __clear_bit(unsigned long nr, volatile void *ptr) ...@@ -288,7 +288,7 @@ __clear_bit(unsigned long nr, volatile void *ptr)
} }
static inline void static inline void
__constant_clear_bit(const unsigned long nr, volatile void *ptr) __constant_clear_bit(const unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
...@@ -337,7 +337,7 @@ __constant_clear_bit(const unsigned long nr, volatile void *ptr) ...@@ -337,7 +337,7 @@ __constant_clear_bit(const unsigned long nr, volatile void *ptr)
/* /*
* fast, non-SMP change_bit routine * fast, non-SMP change_bit routine
*/ */
static inline void __change_bit(unsigned long nr, volatile void *ptr) static inline void __change_bit(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
...@@ -349,7 +349,7 @@ static inline void __change_bit(unsigned long nr, volatile void *ptr) ...@@ -349,7 +349,7 @@ static inline void __change_bit(unsigned long nr, volatile void *ptr)
} }
static inline void static inline void
__constant_change_bit(const unsigned long nr, volatile void *ptr) __constant_change_bit(const unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
...@@ -399,7 +399,7 @@ __constant_change_bit(const unsigned long nr, volatile void *ptr) ...@@ -399,7 +399,7 @@ __constant_change_bit(const unsigned long nr, volatile void *ptr)
* fast, non-SMP test_and_set_bit routine * fast, non-SMP test_and_set_bit routine
*/ */
static inline int static inline int
test_and_set_bit_simple(unsigned long nr, volatile void *ptr) test_and_set_bit_simple(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
unsigned char ch; unsigned char ch;
...@@ -418,7 +418,7 @@ test_and_set_bit_simple(unsigned long nr, volatile void *ptr) ...@@ -418,7 +418,7 @@ test_and_set_bit_simple(unsigned long nr, volatile void *ptr)
* fast, non-SMP test_and_clear_bit routine * fast, non-SMP test_and_clear_bit routine
*/ */
static inline int static inline int
test_and_clear_bit_simple(unsigned long nr, volatile void *ptr) test_and_clear_bit_simple(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
unsigned char ch; unsigned char ch;
...@@ -437,7 +437,7 @@ test_and_clear_bit_simple(unsigned long nr, volatile void *ptr) ...@@ -437,7 +437,7 @@ test_and_clear_bit_simple(unsigned long nr, volatile void *ptr)
* fast, non-SMP test_and_change_bit routine * fast, non-SMP test_and_change_bit routine
*/ */
static inline int static inline int
test_and_change_bit_simple(unsigned long nr, volatile void *ptr) test_and_change_bit_simple(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
unsigned char ch; unsigned char ch;
...@@ -473,7 +473,7 @@ test_and_change_bit_simple(unsigned long nr, volatile void *ptr) ...@@ -473,7 +473,7 @@ test_and_change_bit_simple(unsigned long nr, volatile void *ptr)
* This routine doesn't need to be atomic. * This routine doesn't need to be atomic.
*/ */
static inline int __test_bit(unsigned long nr, volatile void *ptr) static inline int __test_bit(unsigned long nr, volatile unsigned long *ptr)
{ {
unsigned long addr; unsigned long addr;
unsigned char ch; unsigned char ch;
...@@ -484,7 +484,7 @@ static inline int __test_bit(unsigned long nr, volatile void *ptr) ...@@ -484,7 +484,7 @@ static inline int __test_bit(unsigned long nr, volatile void *ptr)
} }
static inline int static inline int
__constant_test_bit(unsigned long nr, volatile void *addr) { __constant_test_bit(unsigned long nr, volatile unsigned long *addr) {
return (((volatile char *) addr)[(nr>>3)^7] & (1<<(nr&7))) != 0; return (((volatile char *) addr)[(nr>>3)^7] & (1<<(nr&7))) != 0;
} }
...@@ -497,7 +497,7 @@ __constant_test_bit(unsigned long nr, volatile void *addr) { ...@@ -497,7 +497,7 @@ __constant_test_bit(unsigned long nr, volatile void *addr) {
* Find-bit routines.. * Find-bit routines..
*/ */
static inline unsigned long static inline unsigned long
find_first_zero_bit(void * addr, unsigned long size) find_first_zero_bit(unsigned long * addr, unsigned long size)
{ {
unsigned long res, cmp, count; unsigned long res, cmp, count;
...@@ -539,7 +539,7 @@ find_first_zero_bit(void * addr, unsigned long size) ...@@ -539,7 +539,7 @@ find_first_zero_bit(void * addr, unsigned long size)
} }
static inline unsigned long static inline unsigned long
find_first_bit(void * addr, unsigned long size) find_first_bit(unsigned long * addr, unsigned long size)
{ {
unsigned long res, cmp, count; unsigned long res, cmp, count;
...@@ -581,7 +581,7 @@ find_first_bit(void * addr, unsigned long size) ...@@ -581,7 +581,7 @@ find_first_bit(void * addr, unsigned long size)
} }
static inline unsigned long static inline unsigned long
find_next_zero_bit (void * addr, unsigned long size, unsigned long offset) find_next_zero_bit (unsigned long * addr, unsigned long size, unsigned long offset)
{ {
unsigned long * p = ((unsigned long *) addr) + (offset >> 6); unsigned long * p = ((unsigned long *) addr) + (offset >> 6);
unsigned long bitvec, reg; unsigned long bitvec, reg;
...@@ -625,7 +625,7 @@ find_next_zero_bit (void * addr, unsigned long size, unsigned long offset) ...@@ -625,7 +625,7 @@ find_next_zero_bit (void * addr, unsigned long size, unsigned long offset)
} }
static inline unsigned long static inline unsigned long
find_next_bit (void * addr, unsigned long size, unsigned long offset) find_next_bit (unsigned long * addr, unsigned long size, unsigned long offset)
{ {
unsigned long * p = ((unsigned long *) addr) + (offset >> 6); unsigned long * p = ((unsigned long *) addr) + (offset >> 6);
unsigned long bitvec, reg; unsigned long bitvec, reg;
...@@ -744,7 +744,7 @@ static inline int sched_find_first_bit(unsigned long *b) ...@@ -744,7 +744,7 @@ static inline int sched_find_first_bit(unsigned long *b)
* the libc and compiler builtin ffs routines, therefore * the libc and compiler builtin ffs routines, therefore
* differs in spirit from the above ffz (man ffs). * differs in spirit from the above ffz (man ffs).
*/ */
extern int inline ffs (int x) extern inline int ffs (int x)
{ {
int r = 1; int r = 1;
...@@ -836,9 +836,13 @@ extern __inline__ int fls(int x) ...@@ -836,9 +836,13 @@ extern __inline__ int fls(int x)
* 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24 * 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
*/ */
#define ext2_set_bit(nr, addr) test_and_set_bit((nr)^56, addr) #define ext2_set_bit(nr, addr) \
#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr)^56, addr) test_and_set_bit((nr)^56, (unsigned long *)addr)
#define ext2_test_bit(nr, addr) test_bit((nr)^56, addr) #define ext2_clear_bit(nr, addr) \
test_and_clear_bit((nr)^56, (unsigned long *)addr)
#define ext2_test_bit(nr, addr) \
test_bit((nr)^56, (unsigned long *)addr)
static inline unsigned long static inline unsigned long
ext2_find_first_zero_bit(void *vaddr, unsigned long size) ext2_find_first_zero_bit(void *vaddr, unsigned long size)
{ {
......
...@@ -58,13 +58,13 @@ typedef struct { ...@@ -58,13 +58,13 @@ typedef struct {
#endif #endif
#undef __FD_SET #undef __FD_SET
#define __FD_SET(fd,fdsetp) set_bit(fd,fdsetp) #define __FD_SET(fd,fdsetp) set_bit(fd,fdsetp->fds_bits)
#undef __FD_CLR #undef __FD_CLR
#define __FD_CLR(fd,fdsetp) clear_bit(fd,fdsetp) #define __FD_CLR(fd,fdsetp) clear_bit(fd,fdsetp->fds_bits)
#undef __FD_ISSET #undef __FD_ISSET
#define __FD_ISSET(fd,fdsetp) test_bit(fd,fdsetp) #define __FD_ISSET(fd,fdsetp) test_bit(fd,fdsetp->fds_bits)
#undef __FD_ZERO #undef __FD_ZERO
#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp))) #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
......
...@@ -228,7 +228,7 @@ static inline void __downgrade_write(struct rw_semaphore *sem) ...@@ -228,7 +228,7 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
: "=&d" (old), "=&d" (new) : "=&d" (old), "=&d" (new)
: "a" (&sem->count), "m" (tmp) : "a" (&sem->count), "m" (tmp)
: "cc", "memory" ); : "cc", "memory" );
if (new > 1) // FIXME: is this correct ?!? if (new > 1)
rwsem_downgrade_wake(sem); rwsem_downgrade_wake(sem);
} }
......
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