fix build errors by bitops code consolidation
Subsystems (12)
cover fix build errors by bitops code consolidation
According to http://l4x.org/k/ the bitops code consolidation patches break 2.6.16-rc4-mm1 on arm, m68k, ppc, s390, um architectures at least.
These patches fix the problem disclosed by http://l4x.org/k/
and typo fixes.
--
PATCH 1/8 s/fucn/func/ typo fix
typo fix
include/asm-generic/bitops/atomic.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/bitops/atomic.h +1 -1
@@ -42,7 +42,7 @@ extern raw_spinlock_t __atomic_hash[ATOM/* * NMI events can occur at any time, including when interrupts have been * disabled by *_irqsave(). So you can get NMI events occurring while a -* *_bit fucntion is holding a spin lock. If the NMI handler also wants +* *_bit function is holding a spin lock. If the NMI handler also wants * to do bit manipulation (and they do) then you can get a deadlock * between the original caller of *_bit() and the NMI handler. *
--
PATCH 2/8 more s/fucn/func/ typo fixes
In reply to Akinobu Mitas/fucntion/function/ typo fixes
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl | 2 +- arch/m68k/bvme6000/config.c | 2 +- arch/s390/crypto/crypt_s390_query.c | 2 +- drivers/acpi/processor_core.c | 2 +- drivers/net/sis900.c | 4 ++-- include/linux/gameport.h | 4 ++-- include/linux/serio.h | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-)
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl +1 -1
@@ -2836,7 +2836,7 @@ struct _snd_pcm_runtime { <para> Note that this callback became non-atomic since the recent version. - You can use schedule-related fucntions safely in this callback now. + You can use schedule-related functions safely in this callback now. </para> <para>
arch/m68k/bvme6000/config.c +1 -1
@@ -142,7 +142,7 @@ void __init config_bvme6000(void)/* Now do the PIT configuration */ pit->pgcr =0x00 ;/* Unidirectional 8 bit, no handshake for now */ - pit->psrr =0x18 ;/* PIACK and PIRQ fucntions enabled */ + pit->psrr =0x18 ;/* PIACK and PIRQ functions enabled */ pit->pacr =0x00 ;/* Sub Mode 00, H2 i/p, no DMA */ pit->padr =0x00 ;/* Just to be tidy! */ pit->paddr =0x00 ;/* All inputs for now (safest) */
arch/s390/crypto/crypt_s390_query.c +1 -1
@@ -55,7 +55,7 @@ static void query_available_functions(voprintk (KERN_INFO "KMC_AES_256: %d\n" ,crypt_s390_func_available (KMC_AES_256_ENCRYPT )); -/* query available KIMD fucntions */ +/* query available KIMD functions */ printk (KERN_INFO "KIMD_QUERY: %d\n" ,crypt_s390_func_available (KIMD_QUERY )); printk(KERN_INFO "KIMD_SHA_1: %d\n",
drivers/acpi/processor_core.c +1 -1
@@ -246,7 +246,7 @@ static int acpi_processor_errata(struct }/* -------------------------------------------------------------------------- -Common ACPI processor fucntions +Common ACPI processor functions -------------------------------------------------------------------------- */ /*
drivers/net/sis900.c +2 -2
@@ -1692,7 +1692,7 @@ static irqreturn_t sis900_interrupt(int* * Process receive interrupt events, * put buffer to higher layer and refill buffer pool -* Note: This fucntion is called by interrupt handler, +* Note: This function is called by interrupt handler, * don't do "too much" work here */
@@ -1839,7 +1839,7 @@ static int sis900_rx(struct net_device ** * Check for error condition and free socket buffer etc * schedule for more transmission as needed -* Note: This fucntion is called by interrupt handler, +* Note: This function is called by interrupt handler, * don't do "too much" work here */
include/linux/gameport.h +2 -2
@@ -120,7 +120,7 @@ static inline void gameport_set_name(str }/* -* Use the following fucntions to manipulate gameport's per-port +* Use the following functions to manipulate gameport's per-port * driver-specific data. */ static inline void *gameport_get_drvdata (struct gameport *gameport)
@@ -134,7 +134,7 @@ static inline void gameport_set_drvdata( }/* -* Use the following fucntions to pin gameport's driver in process context +* Use the following functions to pin gameport's driver in process context */ static inline int gameport_pin_driver (struct gameport *gameport) {
include/linux/serio.h +3 -3
@@ -120,7 +120,7 @@ static inline void serio_cleanup(struct }/* -* Use the following fucntions to manipulate serio's per-port +* Use the following functions to manipulate serio's per-port * driver-specific data. */ static inline void *serio_get_drvdata (struct serio *serio)
@@ -134,7 +134,7 @@ static inline void serio_set_drvdata(str }/* -* Use the following fucntions to protect critical sections in +* Use the following functions to protect critical sections in * driver code from port's interrupt handler */ static inline void serio_pause_rx (struct serio *serio)
@@ -148,7 +148,7 @@ static inline void serio_continue_rx(str }/* -* Use the following fucntions to pin serio's driver in process context +* Use the following functions to pin serio's driver in process context */ static inline int serio_pin_driver (struct serio *serio) {
--
PATCH 3/8 frv: remove unnesesary "&"
In reply to Akinobu MitaFix warning messages triggered by bitops code consolidation patches. cxn_bitmap is the array of unsigned long.
'&' is unnesesary for the argument of *_bit() routins.
arch/frv/mm/mmu-context.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/frv/mm/mmu-context.c +3 -3
@@ -54,9 +54,9 @@ static unsigned get_cxn(mm_context_t *ct/* find the first unallocated context number * - 0 is reserved for the kernel */ - cxn =find_next_zero_bit (&cxn_bitmap,NR_CXN ,1 ); + cxn =find_next_zero_bit (cxn_bitmap,NR_CXN ,1 );if (cxn <NR_CXN ) { -set_bit (cxn, &cxn_bitmap); +set_bit (cxn, cxn_bitmap); }else {/* none remaining - need to steal someone else's cxn */
@@ -138,7 +138,7 @@ void destroy_context(struct mm_struct *m cxn_pinned =-1 ;list_del_init (&ctx->id_link); -clear_bit (ctx->id, &cxn_bitmap); +clear_bit (ctx->id, cxn_bitmap);__flush_tlb_mm (ctx->id); ctx->id =0 ; }
--
Re: [-mm patch 3/8] frv: remove unnesesary "&"
PATCH 4/8 fix error: __u32 undeclared
In reply to Akinobu MitaBuild fix for s390
declare __u32 and __u64.
include/asm-generic/bitops/fls64.h | 2 ++ include/asm-generic/bitops/hweight.h | 2 ++ 2 files changed, 4 insertions(+)
include/asm-generic/bitops/fls64.h +2 -0
@@ -1,6 +1,8 @@#ifndef _ASM_GENERIC_BITOPS_FLS64_H_#define _ASM_GENERIC_BITOPS_FLS64_H_ +#include <asm/types.h> +static inline int fls64 (__u64 x) {__u32 h = x >>32 ;
include/asm-generic/bitops/hweight.h +2 -0
@@ -1,6 +1,8 @@#ifndef _ASM_GENERIC_BITOPS_HWEIGHT_H_#define _ASM_GENERIC_BITOPS_HWEIGHT_H_ +#include <asm/types.h> +extern unsigned int hweight32 (unsigned int w);extern unsigned int hweight16 (unsigned int w);extern unsigned int hweight8 (unsigned int w);
--
PATCH 5/8 um: fix undefined reference to hweight32
In reply to Akinobu MitaBuild fix for user mode linux.
arch/um/Kconfig.i386 | 5 +++++ arch/um/Kconfig.x86_64 | 5 +++++ 2 files changed, 10 insertions(+)
arch/um/Kconfig.i386 +5 -0
@@ -52,3 +52,8 @@ config ARCH_HAS_SC_SIGNALS config ARCH_REUSE_HOST_VSYSCALL_AREA bool default y + +config GENERIC_HWEIGHT + bool + default y +
arch/um/Kconfig.x86_64 +5 -0
@@ -46,3 +46,8 @@ config ARCH_REUSE_HOST_VSYSCALL_AREA config SMP_BROKEN bool default y + +config GENERIC_HWEIGHT + bool + default y +
--
Re: [-mm patch 5/8] um: fix undefined reference to hweight32
Quoted 4 lines · Akinobu Mita
Build fix for user mode linux.
Signed-off-by Akinobu Mita <[email protected]>Cc Jeff Dike <[email protected]>
PATCH 6/8 arm: fix undefined reference to generic_fls
In reply to Akinobu MitaThis patch defines constant_fls() instead of removed generic_fls().
include/asm-arm/bitops.h | 31 ++++++++++++++++++++++++++++++- 1 files changed, 30 insertions(+), 1 deletion(-)
include/asm-arm/bitops.h +30 -1
@@ -239,13 +239,42 @@ extern int _find_next_bit_be(const unsig#else +static inline int constant_fls (int x) +{ +int r =32 ; + +if (!x) +return 0 ; +if (!(x &0xffff0000u )) { + x <<=16 ; + r -=16 ; + } +if (!(x &0xff000000u )) { + x <<=8 ; + r -=8 ; + } +if (!(x &0xf0000000u )) { + x <<=4 ; + r -=4 ; + } +if (!(x &0xc0000000u )) { + x <<=2 ; + r -=2 ; + } +if (!(x &0x80000000u )) { + x <<=1 ; + r -=1 ; + } +return r; +} +/* * On ARMv5 and above those functions can be implemented around * the clz instruction for much better code efficiency. */ #define fls (x) \ - ( __builtin_constant_p(x) ? generic_fls(x) : \ + ( __builtin_constant_p(x) ? constant_fls(x) : \ ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) )#define ffs (x) ({ unsigned long __t = (x); fls(__t & -__t); })#define __ffs (x) (ffs(x) - 1)
--
PATCH 7/8 m68k: fix undefined reference to generic_find_next_zero_le_bit
In reply to Akinobu MitaThis patch reverts ext2 bitmap functions.
include/asm-m68k/bitops.h | 54 ++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 52 insertions(+), 2 deletions(-)
include/asm-m68k/bitops.h +52 -2
@@ -351,11 +351,61 @@ static inline int minix_test_bit(int nr,/* Bitmap functions for the ext2 filesystem. */ -#include <asm-generic/bitops/ext2-non-atomic.h> - +#define ext2_set_bit (nr, addr) __test_and_set_bit((nr) ^ 24, (unsigned long *)(addr))#define ext2_set_bit_atomic (lock, nr, addr) test_and_set_bit((nr) ^ 24, (unsigned long *)(addr)) +#define ext2_clear_bit (nr, addr) __test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr))#define ext2_clear_bit_atomic (lock, nr, addr) test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr)) +static inline int ext2_test_bit (int nr,const void *vaddr) +{ +const unsigned char *p = vaddr; +return (p[nr >>3 ] & (1U << (nr &7 ))) !=0 ; +} + +static inline int ext2_find_first_zero_bit (const void *vaddr,unsigned size) +{ +const unsigned long *p = vaddr, *addr = vaddr; +int res; + +if (!size) +return 0 ; + + size = (size >>5 ) + ((size &31 ) >0 ); +while (*p++ == ~0UL ) + { +if (--size ==0 ) +return (p - addr) <<5 ; + } + + --p; +for (res =0 ; res <32 ; res++) +if (!ext2_test_bit (res, p)) +break ; +return (p - addr) *32 + res; +} + +static inline int ext2_find_next_zero_bit (const void *vaddr,unsigned size, +unsigned offset) +{ +const unsigned long *addr = vaddr; +const unsigned long *p = addr + (offset >>5 ); +int bit = offset &31UL , res; + +if (offset >= size) +return size; + +if (bit) { +/* Look for zero in first longword */ +for (res = bit; res <32 ; res++) +if (!ext2_test_bit (res, p)) +return (p - addr) *32 + res; + p++; + } +/* No zero yet, search remaining full bytes for a zero */ + res =ext2_find_first_zero_bit (p, size -32 * (p - addr)); +return (p - addr) *32 + res; +} +#endif /* __KERNEL__ */ #endif /* _M68K_BITOPS_H */
--
PATCH 8/8 ppc: fix undefined reference to hweight32
In reply to Akinobu MitaBuild fix for ppc
arch/ppc/Kconfig | 4 ++++ 1 files changed, 4 insertions(+)
arch/ppc/Kconfig +4 -0
@@ -19,6 +19,10 @@ config RWSEM_XCHGADD_ALGORITHM bool default y +config GENERIC_HWEIGHT + bool + default y + config GENERIC_CALIBRATE_DELAY bool default y
--