From 276bd31ce5af01350465861af7aa6a25864eb108 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 23 Aug 2005 22:45:06 +0100 Subject: [PATCH] Kconfig fix (ISA_DMA_API and sound/*) fixed kconfig dependencies on ISA_DMA_API for parts of sound/* that rely on it. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/sound/core.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sound/core.h b/include/sound/core.h index 38b357fc8958..f72b3ef515e2 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -360,11 +360,13 @@ int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd); /* isadma.c */ +#ifdef CONFIG_ISA_DMA_API #define DMA_MODE_NO_ENABLE 0x0100 void snd_dma_program(unsigned long dma, unsigned long addr, unsigned int size, unsigned short mode); void snd_dma_disable(unsigned long dma); unsigned int snd_dma_pointer(unsigned long dma, unsigned int size); +#endif /* misc.c */ -- cgit v1.2.1 From 79fb7bdce363685b336e3f0fb8207312fd1f02fc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 23 Aug 2005 22:47:07 +0100 Subject: [PATCH] alpha xchg fix alpha xchg has to be a macro - alpha disables always_inline and if that puppy does not get inlined, we immediately blow up on undefined reference. Happens even on gcc3; with gcc4 that happens a _lot_. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/asm-alpha/system.h | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h index c08ce970ff8c..bdb4d66418f1 100644 --- a/include/asm-alpha/system.h +++ b/include/asm-alpha/system.h @@ -443,22 +443,19 @@ __xchg_u64(volatile long *m, unsigned long val) if something tries to do an invalid xchg(). */ extern void __xchg_called_with_bad_pointer(void); -static inline unsigned long -__xchg(volatile void *ptr, unsigned long x, int size) -{ - switch (size) { - case 1: - return __xchg_u8(ptr, x); - case 2: - return __xchg_u16(ptr, x); - case 4: - return __xchg_u32(ptr, x); - case 8: - return __xchg_u64(ptr, x); - } - __xchg_called_with_bad_pointer(); - return x; -} +#define __xchg(ptr, x, size) \ +({ \ + unsigned long __xchg__res; \ + volatile void *__xchg__ptr = (ptr); \ + switch (size) { \ + case 1: __xchg__res = __xchg_u8(__xchg__ptr, x); break; \ + case 2: __xchg__res = __xchg_u16(__xchg__ptr, x); break; \ + case 4: __xchg__res = __xchg_u32(__xchg__ptr, x); break; \ + case 8: __xchg__res = __xchg_u64(__xchg__ptr, x); break; \ + default: __xchg_called_with_bad_pointer(); __xchg__res = x; \ + } \ + __xchg__res; \ +}) #define xchg(ptr,x) \ ({ \ -- cgit v1.2.1 From e231a9c4fdf402bcfd5a7c27be49050882631a95 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 23 Aug 2005 22:47:17 +0100 Subject: [PATCH] m32r smp.h gcc4 fixes extern on physid_2_cpu[] does not belong in smp.h - the thing is static. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/asm-m32r/smp.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/asm-m32r/smp.h b/include/asm-m32r/smp.h index b9a20cdad65f..7885b7df84a2 100644 --- a/include/asm-m32r/smp.h +++ b/include/asm-m32r/smp.h @@ -61,9 +61,7 @@ extern physid_mask_t phys_cpu_present_map; * Some lowlevel functions might want to know about * the real CPU ID <-> CPU # mapping. */ -extern volatile int physid_2_cpu[NR_CPUS]; extern volatile int cpu_2_physid[NR_CPUS]; -#define physid_to_cpu(physid) physid_2_cpu[physid] #define cpu_to_physid(cpu_id) cpu_2_physid[cpu_id] #define raw_smp_processor_id() (current_thread_info()->cpu) -- cgit v1.2.1 From 33215652e4a75dfa8adb20f4d741517457b0da2b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 23 Aug 2005 22:47:52 +0100 Subject: [PATCH] qualifiers in return types - easy cases a bunch of functions switched from volatile to __attribute__((noreturn)) and from const to __attribute_pure__ Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/asm-arm/bug.h | 2 +- include/asm-arm/cpu-multi32.h | 2 +- include/asm-arm/cpu-single.h | 2 +- include/asm-ppc/time.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/asm-arm/bug.h b/include/asm-arm/bug.h index 24d11672eb60..7fb02138f585 100644 --- a/include/asm-arm/bug.h +++ b/include/asm-arm/bug.h @@ -5,7 +5,7 @@ #ifdef CONFIG_BUG #ifdef CONFIG_DEBUG_BUGVERBOSE -extern volatile void __bug(const char *file, int line, void *data); +extern void __bug(const char *file, int line, void *data) __attribute__((noreturn)); /* give file/line information */ #define BUG() __bug(__FILE__, __LINE__, NULL) diff --git a/include/asm-arm/cpu-multi32.h b/include/asm-arm/cpu-multi32.h index ff48022e4720..4679f63688e9 100644 --- a/include/asm-arm/cpu-multi32.h +++ b/include/asm-arm/cpu-multi32.h @@ -31,7 +31,7 @@ extern struct processor { /* * Special stuff for a reset */ - volatile void (*reset)(unsigned long addr); + void (*reset)(unsigned long addr) __attribute__((noreturn)); /* * Idle the processor */ diff --git a/include/asm-arm/cpu-single.h b/include/asm-arm/cpu-single.h index b5ec5d54665d..6723e67244fa 100644 --- a/include/asm-arm/cpu-single.h +++ b/include/asm-arm/cpu-single.h @@ -41,4 +41,4 @@ extern int cpu_do_idle(void); extern void cpu_dcache_clean_area(void *, int); extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm); extern void cpu_set_pte(pte_t *ptep, pte_t pte); -extern volatile void cpu_reset(unsigned long addr); +extern void cpu_reset(unsigned long addr) __attribute__((noreturn)); diff --git a/include/asm-ppc/time.h b/include/asm-ppc/time.h index ce09b47fa819..321fb75b5f22 100644 --- a/include/asm-ppc/time.h +++ b/include/asm-ppc/time.h @@ -58,7 +58,7 @@ static __inline__ void set_dec(unsigned int val) /* Accessor functions for the timebase (RTC on 601) registers. */ /* If one day CONFIG_POWER is added just define __USE_RTC as 1 */ #ifdef CONFIG_6xx -extern __inline__ int const __USE_RTC(void) { +extern __inline__ int __attribute_pure__ __USE_RTC(void) { return (mfspr(SPRN_PVR)>>16) == 1; } #else -- cgit v1.2.1 From 17566c3c5ed3ea8f941a135cf960387214c4f6ac Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 23 Aug 2005 22:48:22 +0100 Subject: [PATCH] s390 __CHECKER__ ifdefs remove the bogus games with explicit ifdefs on __CHECKER__ Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/asm-s390/uaccess.h | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h index a7f43a251f81..3e3bfe6a8fa8 100644 --- a/include/asm-s390/uaccess.h +++ b/include/asm-s390/uaccess.h @@ -149,11 +149,11 @@ struct exception_table_entry }) #endif -#ifndef __CHECKER__ #define __put_user(x, ptr) \ ({ \ __typeof__(*(ptr)) __x = (x); \ int __pu_err; \ + __chk_user_ptr(ptr); \ switch (sizeof (*(ptr))) { \ case 1: \ case 2: \ @@ -167,14 +167,6 @@ struct exception_table_entry } \ __pu_err; \ }) -#else -#define __put_user(x, ptr) \ -({ \ - void __user *p; \ - p = (ptr); \ - 0; \ -}) -#endif #define put_user(x, ptr) \ ({ \ @@ -213,11 +205,11 @@ extern int __put_user_bad(void) __attribute__((noreturn)); }) #endif -#ifndef __CHECKER__ #define __get_user(x, ptr) \ ({ \ __typeof__(*(ptr)) __x; \ int __gu_err; \ + __chk_user_ptr(ptr); \ switch (sizeof(*(ptr))) { \ case 1: \ case 2: \ @@ -232,15 +224,6 @@ extern int __put_user_bad(void) __attribute__((noreturn)); (x) = __x; \ __gu_err; \ }) -#else -#define __get_user(x, ptr) \ -({ \ - void __user *p; \ - p = (ptr); \ - 0; \ -}) -#endif - #define get_user(x, ptr) \ ({ \ -- cgit v1.2.1 From 9138dccbb9f39f12474554ef93dcc24de2e9c8f6 Mon Sep 17 00:00:00 2001 From: Deepak Saxena Date: Tue, 23 Aug 2005 13:30:29 -0700 Subject: [PATCH] Fix IXP4xx CLOCK_TICK_RATE As pointed out in the following thread, the CLOCK_TICK_RATE setting for IXP4xx is incorrect b/c the HW ignores the lowest 2 bits of the LATCH value. http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2005-August/030950.html Tnx to George Anziger and Egil Hjelmeland for finding the issue. Signed-off-by: Deepak Saxena Signed-off-by: Linus Torvalds --- include/asm-arm/arch-ixp4xx/timex.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-arm/arch-ixp4xx/timex.h b/include/asm-arm/arch-ixp4xx/timex.h index 38c9d77d3727..3745e35cc030 100644 --- a/include/asm-arm/arch-ixp4xx/timex.h +++ b/include/asm-arm/arch-ixp4xx/timex.h @@ -7,7 +7,9 @@ /* * We use IXP425 General purpose timer for our timer needs, it runs at - * 66.66... MHz + * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the + * timer register ignores the bottom 2 bits of the LATCH value. */ -#define CLOCK_TICK_RATE (66666666) +#define FREQ 66666666 +#define CLOCK_TICK_RATE (((FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) -- cgit v1.2.1 From 40bb0c3ef52d872de348e10000eb5432a43a147d Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 24 Aug 2005 17:36:21 +0200 Subject: [PATCH] m68k: fix broken macros causing compile errors Add parens around macro parameters. Signed-off-by: Andreas Schwab Signed-off-by: Linus Torvalds --- include/asm-m68k/page.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h index 99a516709210..206313e2a817 100644 --- a/include/asm-m68k/page.h +++ b/include/asm-m68k/page.h @@ -138,13 +138,13 @@ extern unsigned long m68k_memoffset; #define __pa(vaddr) ((unsigned long)(vaddr)+m68k_memoffset) #define __va(paddr) ((void *)((unsigned long)(paddr)-m68k_memoffset)) #else -#define __pa(vaddr) virt_to_phys((void *)vaddr) -#define __va(paddr) phys_to_virt((unsigned long)paddr) +#define __pa(vaddr) virt_to_phys((void *)(vaddr)) +#define __va(paddr) phys_to_virt((unsigned long)(paddr)) #endif #else /* !CONFIG_SUN3 */ /* This #define is a horrible hack to suppress lots of warnings. --m */ -#define __pa(x) ___pa((unsigned long)x) +#define __pa(x) ___pa((unsigned long)(x)) static inline unsigned long ___pa(unsigned long x) { if(x == 0) -- cgit v1.2.1