From c1f5f140bc0250090d42ae4e9f0bf03fdd5a8786 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mon, 1 Nov 2010 16:08:55 +0100 Subject: [PATCH] --- yaml --- r: 221584 b: refs/heads/master c: 50ae28f0144a790fc63a5b89b9aca3ffa9f88522 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/m68k/include/asm/irqflags.h | 2 -- trunk/arch/m68k/include/asm/machdep.h | 1 - trunk/arch/tile/include/asm/highmem.h | 1 + trunk/arch/tile/include/asm/kmap_types.h | 34 ++++++--------------- trunk/arch/tile/include/asm/pgtable.h | 6 ++-- trunk/arch/tile/include/asm/stat.h | 3 -- trunk/arch/tile/include/asm/unistd.h | 1 - trunk/arch/tile/kernel/compat.c | 10 +++--- trunk/arch/tile/kernel/early_printk.c | 2 +- trunk/arch/tile/kernel/hardwall.c | 6 ++-- trunk/arch/tile/kernel/irq.c | 4 +-- trunk/arch/tile/kernel/machine_kexec.c | 6 ++-- trunk/arch/tile/kernel/messaging.c | 2 +- trunk/arch/tile/kernel/ptrace.c | 39 +++++++++++------------- trunk/arch/tile/kernel/reboot.c | 6 ++-- trunk/arch/tile/kernel/setup.c | 8 ++--- trunk/arch/tile/kernel/signal.c | 9 +----- trunk/arch/tile/kernel/smp.c | 2 +- trunk/arch/tile/kernel/time.c | 8 ++--- trunk/arch/tile/lib/memcpy_tile64.c | 11 ++----- trunk/arch/tile/mm/highmem.c | 2 +- trunk/arch/tile/mm/init.c | 8 ++--- trunk/arch/tile/mm/pgtable.c | 4 +-- trunk/drivers/hwmon/ltc4261.c | 5 +-- trunk/drivers/leds/leds-net5501.c | 2 -- trunk/fs/cifs/file.c | 25 +++++++-------- trunk/fs/cifs/ioctl.c | 4 --- trunk/fs/ext4/inode.c | 2 ++ trunk/fs/logfs/logfs.h | 2 +- trunk/include/asm-generic/stat.h | 14 ++++----- trunk/include/linux/hardirq.h | 8 ++--- trunk/kernel/exit.c | 8 ----- trunk/kernel/relay.c | 15 ++++++--- trunk/mm/filemap.c | 4 +-- trunk/mm/vmstat.c | 2 +- trunk/scripts/kconfig/symbol.c | 2 +- trunk/sound/pci/asihpi/hpi6000.c | 2 -- trunk/sound/pci/asihpi/hpi6205.c | 2 -- trunk/sound/pci/asihpi/hpicmn.c | 12 ++------ trunk/sound/pci/cs46xx/dsp_spos.c | 33 +++++++++++++------- trunk/sound/pci/hda/patch_cirrus.c | 1 - trunk/sound/pci/lx6464es/lx6464es.c | 4 +-- trunk/sound/pci/lx6464es/lx6464es.h | 2 +- trunk/sound/pci/lx6464es/lx_core.c | 2 +- trunk/sound/soc/codecs/Kconfig | 3 +- trunk/sound/soc/codecs/tlv320dac33.c | 36 ++++++---------------- trunk/sound/soc/codecs/tpa6130a2.c | 6 ++-- trunk/sound/soc/codecs/wm8900.c | 6 ++++ trunk/sound/soc/codecs/wm_hubs.c | 2 +- trunk/sound/soc/pxa/tosa.c | 2 +- trunk/sound/soc/soc-core.c | 5 +-- trunk/sound/usb/mixer_quirks.c | 15 ++------- trunk/sound/usb/pcm.c | 4 +-- 54 files changed, 165 insertions(+), 242 deletions(-) diff --git a/[refs] b/[refs] index b5e33320c985..c256e1830d73 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e0a70217107e6f9844628120412cb27bb4cea194 +refs/heads/master: 50ae28f0144a790fc63a5b89b9aca3ffa9f88522 diff --git a/trunk/arch/m68k/include/asm/irqflags.h b/trunk/arch/m68k/include/asm/irqflags.h index 7ef4115b8c4a..4a5b284a1550 100644 --- a/trunk/arch/m68k/include/asm/irqflags.h +++ b/trunk/arch/m68k/include/asm/irqflags.h @@ -2,9 +2,7 @@ #define _M68K_IRQFLAGS_H #include -#ifdef CONFIG_MMU #include -#endif #include #include #include diff --git a/trunk/arch/m68k/include/asm/machdep.h b/trunk/arch/m68k/include/asm/machdep.h index 415d5484916c..789f3b2de0e9 100644 --- a/trunk/arch/m68k/include/asm/machdep.h +++ b/trunk/arch/m68k/include/asm/machdep.h @@ -40,6 +40,5 @@ extern unsigned long hw_timer_offset(void); extern irqreturn_t arch_timer_interrupt(int irq, void *dummy); extern void config_BSP(char *command, int len); -extern void do_IRQ(int irq, struct pt_regs *fp); #endif /* _M68K_MACHDEP_H */ diff --git a/trunk/arch/tile/include/asm/highmem.h b/trunk/arch/tile/include/asm/highmem.h index b2a6c5de79ab..e0f7ee186721 100644 --- a/trunk/arch/tile/include/asm/highmem.h +++ b/trunk/arch/tile/include/asm/highmem.h @@ -23,6 +23,7 @@ #include #include +#include #include #include diff --git a/trunk/arch/tile/include/asm/kmap_types.h b/trunk/arch/tile/include/asm/kmap_types.h index 3d0f20246260..1480106d1c05 100644 --- a/trunk/arch/tile/include/asm/kmap_types.h +++ b/trunk/arch/tile/include/asm/kmap_types.h @@ -16,42 +16,28 @@ #define _ASM_TILE_KMAP_TYPES_H /* - * In 32-bit TILE Linux we have to balance the desire to have a lot of - * nested atomic mappings with the fact that large page sizes and many - * processors chew up address space quickly. In a typical - * 64-processor, 64KB-page layout build, making KM_TYPE_NR one larger - * adds 4MB of required address-space. For now we leave KM_TYPE_NR - * set to depth 8. + * In TILE Linux each set of four of these uses another 16MB chunk of + * address space, given 64 tiles and 64KB pages, so we only enable + * ones that are required by the kernel configuration. */ enum km_type { - KM_TYPE_NR = 8 -}; - -/* - * We provide dummy definitions of all the stray values that used to be - * required for kmap_atomic() and no longer are. - */ -enum { KM_BOUNCE_READ, KM_SKB_SUNRPC_DATA, KM_SKB_DATA_SOFTIRQ, KM_USER0, KM_USER1, KM_BIO_SRC_IRQ, - KM_BIO_DST_IRQ, - KM_PTE0, - KM_PTE1, KM_IRQ0, KM_IRQ1, KM_SOFTIRQ0, KM_SOFTIRQ1, - KM_SYNC_ICACHE, - KM_SYNC_DCACHE, - KM_UML_USERCOPY, - KM_IRQ_PTE, - KM_NMI, - KM_NMI_PTE, - KM_KDB + KM_MEMCPY0, + KM_MEMCPY1, +#if defined(CONFIG_HIGHPTE) + KM_PTE0, + KM_PTE1, +#endif + KM_TYPE_NR }; #endif /* _ASM_TILE_KMAP_TYPES_H */ diff --git a/trunk/arch/tile/include/asm/pgtable.h b/trunk/arch/tile/include/asm/pgtable.h index a6604e9485da..dc4ccdd855bc 100644 --- a/trunk/arch/tile/include/asm/pgtable.h +++ b/trunk/arch/tile/include/asm/pgtable.h @@ -344,8 +344,10 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) #define pgd_offset_k(address) pgd_offset(&init_mm, address) #if defined(CONFIG_HIGHPTE) -extern pte_t *pte_offset_map(pmd_t *, unsigned long address); -#define pte_unmap(pte) kunmap_atomic(pte) +extern pte_t *_pte_offset_map(pmd_t *, unsigned long address, enum km_type); +#define pte_offset_map(dir, address) \ + _pte_offset_map(dir, address, KM_PTE0) +#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0) #else #define pte_offset_map(dir, address) pte_offset_kernel(dir, address) #define pte_unmap(pte) do { } while (0) diff --git a/trunk/arch/tile/include/asm/stat.h b/trunk/arch/tile/include/asm/stat.h index b16e5db8f0e7..3dc90fa92c70 100644 --- a/trunk/arch/tile/include/asm/stat.h +++ b/trunk/arch/tile/include/asm/stat.h @@ -1,4 +1 @@ -#ifdef CONFIG_COMPAT -#define __ARCH_WANT_STAT64 /* Used for compat_sys_stat64() etc. */ -#endif #include diff --git a/trunk/arch/tile/include/asm/unistd.h b/trunk/arch/tile/include/asm/unistd.h index b35c2db71199..f2e3ff485333 100644 --- a/trunk/arch/tile/include/asm/unistd.h +++ b/trunk/arch/tile/include/asm/unistd.h @@ -41,7 +41,6 @@ __SYSCALL(__NR_cmpxchg_badaddr, sys_cmpxchg_badaddr) #ifdef CONFIG_COMPAT #define __ARCH_WANT_SYS_LLSEEK #endif -#define __ARCH_WANT_SYS_NEWFSTATAT #endif #endif /* _ASM_TILE_UNISTD_H */ diff --git a/trunk/arch/tile/kernel/compat.c b/trunk/arch/tile/kernel/compat.c index 67617a05e602..77739cdd9462 100644 --- a/trunk/arch/tile/kernel/compat.c +++ b/trunk/arch/tile/kernel/compat.c @@ -148,11 +148,11 @@ long tile_compat_sys_msgrcv(int msqid, #define compat_sys_readahead sys32_readahead #define compat_sys_sync_file_range compat_sys_sync_file_range2 -/* We leverage the "struct stat64" type for 32-bit time_t/nsec. */ -#define compat_sys_stat64 sys_stat64 -#define compat_sys_lstat64 sys_lstat64 -#define compat_sys_fstat64 sys_fstat64 -#define compat_sys_fstatat64 sys_fstatat64 +/* The native 64-bit "struct stat" matches the 32-bit "struct stat64". */ +#define compat_sys_stat64 sys_newstat +#define compat_sys_lstat64 sys_newlstat +#define compat_sys_fstat64 sys_newfstat +#define compat_sys_fstatat64 sys_newfstatat /* The native sys_ptrace dynamically handles compat binaries. */ #define compat_sys_ptrace sys_ptrace diff --git a/trunk/arch/tile/kernel/early_printk.c b/trunk/arch/tile/kernel/early_printk.c index 493a0e66d916..2c54fd43a8a0 100644 --- a/trunk/arch/tile/kernel/early_printk.c +++ b/trunk/arch/tile/kernel/early_printk.c @@ -54,7 +54,7 @@ void early_printk(const char *fmt, ...) void early_panic(const char *fmt, ...) { va_list ap; - arch_local_irq_disable_all(); + raw_local_irq_disable_all(); va_start(ap, fmt); early_printk("Kernel panic - not syncing: "); early_vprintk(fmt, ap); diff --git a/trunk/arch/tile/kernel/hardwall.c b/trunk/arch/tile/kernel/hardwall.c index e910530436e6..1e54a7843410 100644 --- a/trunk/arch/tile/kernel/hardwall.c +++ b/trunk/arch/tile/kernel/hardwall.c @@ -151,12 +151,12 @@ enum direction_protect { static void enable_firewall_interrupts(void) { - arch_local_irq_unmask_now(INT_UDN_FIREWALL); + raw_local_irq_unmask_now(INT_UDN_FIREWALL); } static void disable_firewall_interrupts(void) { - arch_local_irq_mask_now(INT_UDN_FIREWALL); + raw_local_irq_mask_now(INT_UDN_FIREWALL); } /* Set up hardwall on this cpu based on the passed hardwall_info. */ @@ -768,13 +768,13 @@ static int hardwall_release(struct inode *inode, struct file *file) } static const struct file_operations dev_hardwall_fops = { - .open = nonseekable_open, .unlocked_ioctl = hardwall_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = hardwall_compat_ioctl, #endif .flush = hardwall_flush, .release = hardwall_release, + .llseek = noop_llseek, }; static struct cdev hardwall_dev; diff --git a/trunk/arch/tile/kernel/irq.c b/trunk/arch/tile/kernel/irq.c index 128805ef8f2c..e63917687e99 100644 --- a/trunk/arch/tile/kernel/irq.c +++ b/trunk/arch/tile/kernel/irq.c @@ -26,7 +26,7 @@ #define IS_HW_CLEARED 1 /* - * The set of interrupts we enable for arch_local_irq_enable(). + * The set of interrupts we enable for raw_local_irq_enable(). * This is initialized to have just a single interrupt that the kernel * doesn't actually use as a sentinel. During kernel init, * interrupts are added as the kernel gets prepared to support them. @@ -225,7 +225,7 @@ void __cpuinit setup_irq_regs(void) /* Enable interrupt delivery. */ unmask_irqs(~0UL); #if CHIP_HAS_IPI() - arch_local_irq_unmask(INT_IPI_K); + raw_local_irq_unmask(INT_IPI_K); #endif } diff --git a/trunk/arch/tile/kernel/machine_kexec.c b/trunk/arch/tile/kernel/machine_kexec.c index 0d8b9e933487..ba7a265d6179 100644 --- a/trunk/arch/tile/kernel/machine_kexec.c +++ b/trunk/arch/tile/kernel/machine_kexec.c @@ -182,13 +182,13 @@ static void kexec_find_and_set_command_line(struct kimage *image) if ((entry & IND_SOURCE)) { void *va = - kmap_atomic_pfn(entry >> PAGE_SHIFT); + kmap_atomic_pfn(entry >> PAGE_SHIFT, KM_USER0); r = kexec_bn2cl(va); if (r) { command_line = r; break; } - kunmap_atomic(va); + kunmap_atomic(va, KM_USER0); } } @@ -198,7 +198,7 @@ static void kexec_find_and_set_command_line(struct kimage *image) hverr = hv_set_command_line( (HV_VirtAddr) command_line, strlen(command_line)); - kunmap_atomic(command_line); + kunmap_atomic(command_line, KM_USER0); } else { pr_info("%s: no command line found; making empty\n", __func__); diff --git a/trunk/arch/tile/kernel/messaging.c b/trunk/arch/tile/kernel/messaging.c index 0858ee6b520f..997e3933f726 100644 --- a/trunk/arch/tile/kernel/messaging.c +++ b/trunk/arch/tile/kernel/messaging.c @@ -34,7 +34,7 @@ void __cpuinit init_messaging(void) panic("hv_register_message_state: error %d", rc); /* Make sure downcall interrupts will be enabled. */ - arch_local_irq_unmask(INT_INTCTRL_K); + raw_local_irq_unmask(INT_INTCTRL_K); } void hv_message_intr(struct pt_regs *regs, int intnum) diff --git a/trunk/arch/tile/kernel/ptrace.c b/trunk/arch/tile/kernel/ptrace.c index e92e40527d6d..9cd29884c09f 100644 --- a/trunk/arch/tile/kernel/ptrace.c +++ b/trunk/arch/tile/kernel/ptrace.c @@ -50,10 +50,10 @@ long arch_ptrace(struct task_struct *child, long request, { unsigned long __user *datap = (long __user __force *)data; unsigned long tmp; + int i; long ret = -EIO; + unsigned long *childregs; char *childreg; - struct pt_regs copyregs; - int ex1_offset; switch (request) { @@ -80,16 +80,6 @@ long arch_ptrace(struct task_struct *child, long request, if (addr >= PTREGS_SIZE) break; childreg = (char *)task_pt_regs(child) + addr; - - /* Guard against overwrites of the privilege level. */ - ex1_offset = PTREGS_OFFSET_EX1; -#if defined(CONFIG_COMPAT) && defined(__BIG_ENDIAN) - if (is_compat_task()) /* point at low word */ - ex1_offset += sizeof(compat_long_t); -#endif - if (addr == ex1_offset) - data = PL_ICS_EX1(USER_PL, EX1_ICS(data)); - #ifdef CONFIG_COMPAT if (is_compat_task()) { if (addr & (sizeof(compat_long_t)-1)) @@ -106,19 +96,26 @@ long arch_ptrace(struct task_struct *child, long request, break; case PTRACE_GETREGS: /* Get all registers from the child. */ - if (copy_to_user(datap, task_pt_regs(child), - sizeof(struct pt_regs)) == 0) { - ret = 0; + if (!access_ok(VERIFY_WRITE, datap, PTREGS_SIZE)) + break; + childregs = (long *)task_pt_regs(child); + for (i = 0; i < sizeof(struct pt_regs)/sizeof(unsigned long); + ++i) { + ret = __put_user(childregs[i], &datap[i]); + if (ret != 0) + break; } break; case PTRACE_SETREGS: /* Set all registers in the child. */ - if (copy_from_user(©regs, datap, - sizeof(struct pt_regs)) == 0) { - copyregs.ex1 = - PL_ICS_EX1(USER_PL, EX1_ICS(copyregs.ex1)); - *task_pt_regs(child) = copyregs; - ret = 0; + if (!access_ok(VERIFY_READ, datap, PTREGS_SIZE)) + break; + childregs = (long *)task_pt_regs(child); + for (i = 0; i < sizeof(struct pt_regs)/sizeof(unsigned long); + ++i) { + ret = __get_user(childregs[i], &datap[i]); + if (ret != 0) + break; } break; diff --git a/trunk/arch/tile/kernel/reboot.c b/trunk/arch/tile/kernel/reboot.c index baa3d905fee2..acd86d20beba 100644 --- a/trunk/arch/tile/kernel/reboot.c +++ b/trunk/arch/tile/kernel/reboot.c @@ -27,7 +27,7 @@ void machine_halt(void) { warn_early_printk(); - arch_local_irq_disable_all(); + raw_local_irq_disable_all(); smp_send_stop(); hv_halt(); } @@ -35,14 +35,14 @@ void machine_halt(void) void machine_power_off(void) { warn_early_printk(); - arch_local_irq_disable_all(); + raw_local_irq_disable_all(); smp_send_stop(); hv_power_off(); } void machine_restart(char *cmd) { - arch_local_irq_disable_all(); + raw_local_irq_disable_all(); smp_send_stop(); hv_restart((HV_VirtAddr) "vmlinux", (HV_VirtAddr) cmd); } diff --git a/trunk/arch/tile/kernel/setup.c b/trunk/arch/tile/kernel/setup.c index fb0b3cbeae14..ae51cad12da0 100644 --- a/trunk/arch/tile/kernel/setup.c +++ b/trunk/arch/tile/kernel/setup.c @@ -868,14 +868,14 @@ void __cpuinit setup_cpu(int boot) /* Allow asynchronous TLB interrupts. */ #if CHIP_HAS_TILE_DMA() - arch_local_irq_unmask(INT_DMATLB_MISS); - arch_local_irq_unmask(INT_DMATLB_ACCESS); + raw_local_irq_unmask(INT_DMATLB_MISS); + raw_local_irq_unmask(INT_DMATLB_ACCESS); #endif #if CHIP_HAS_SN_PROC() - arch_local_irq_unmask(INT_SNITLB_MISS); + raw_local_irq_unmask(INT_SNITLB_MISS); #endif #ifdef __tilegx__ - arch_local_irq_unmask(INT_SINGLE_STEP_K); + raw_local_irq_unmask(INT_SINGLE_STEP_K); #endif /* diff --git a/trunk/arch/tile/kernel/signal.c b/trunk/arch/tile/kernel/signal.c index 687719d4abd1..fb28e85ae3ae 100644 --- a/trunk/arch/tile/kernel/signal.c +++ b/trunk/arch/tile/kernel/signal.c @@ -71,9 +71,6 @@ int restore_sigcontext(struct pt_regs *regs, for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i) err |= __get_user(regs->regs[i], &sc->gregs[i]); - /* Ensure that the PL is always set to USER_PL. */ - regs->ex1 = PL_ICS_EX1(USER_PL, EX1_ICS(regs->ex1)); - regs->faultnum = INT_SWINT_1_SIGRETURN; err |= __get_user(*pr0, &sc->gregs[0]); @@ -333,7 +330,7 @@ void do_signal(struct pt_regs *regs) current_thread_info()->status &= ~TS_RESTORE_SIGMASK; } - goto done; + return; } /* Did we come from a system call? */ @@ -361,8 +358,4 @@ void do_signal(struct pt_regs *regs) current_thread_info()->status &= ~TS_RESTORE_SIGMASK; sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); } - -done: - /* Avoid double syscall restart if there are nested signals. */ - regs->faultnum = INT_SWINT_1_SIGRETURN; } diff --git a/trunk/arch/tile/kernel/smp.c b/trunk/arch/tile/kernel/smp.c index 9575b37a8b75..75255d90aff3 100644 --- a/trunk/arch/tile/kernel/smp.c +++ b/trunk/arch/tile/kernel/smp.c @@ -115,7 +115,7 @@ static void smp_start_cpu_interrupt(void) static void smp_stop_cpu_interrupt(void) { set_cpu_online(smp_processor_id(), 0); - arch_local_irq_disable_all(); + raw_local_irq_disable_all(); for (;;) asm("nap"); } diff --git a/trunk/arch/tile/kernel/time.c b/trunk/arch/tile/kernel/time.c index f2e156e44692..6bed820e1421 100644 --- a/trunk/arch/tile/kernel/time.c +++ b/trunk/arch/tile/kernel/time.c @@ -132,7 +132,7 @@ static int tile_timer_set_next_event(unsigned long ticks, { BUG_ON(ticks > MAX_TICK); __insn_mtspr(SPR_TILE_TIMER_CONTROL, ticks); - arch_local_irq_unmask_now(INT_TILE_TIMER); + raw_local_irq_unmask_now(INT_TILE_TIMER); return 0; } @@ -143,7 +143,7 @@ static int tile_timer_set_next_event(unsigned long ticks, static void tile_timer_set_mode(enum clock_event_mode mode, struct clock_event_device *evt) { - arch_local_irq_mask_now(INT_TILE_TIMER); + raw_local_irq_mask_now(INT_TILE_TIMER); } /* @@ -172,7 +172,7 @@ void __cpuinit setup_tile_timer(void) evt->cpumask = cpumask_of(smp_processor_id()); /* Start out with timer not firing. */ - arch_local_irq_mask_now(INT_TILE_TIMER); + raw_local_irq_mask_now(INT_TILE_TIMER); /* Register tile timer. */ clockevents_register_device(evt); @@ -188,7 +188,7 @@ void do_timer_interrupt(struct pt_regs *regs, int fault_num) * Mask the timer interrupt here, since we are a oneshot timer * and there are now by definition no events pending. */ - arch_local_irq_mask(INT_TILE_TIMER); + raw_local_irq_mask(INT_TILE_TIMER); /* Track time spent here in an interrupt context */ irq_enter(); diff --git a/trunk/arch/tile/lib/memcpy_tile64.c b/trunk/arch/tile/lib/memcpy_tile64.c index f7d4a6ad61e8..dfedea7b266b 100644 --- a/trunk/arch/tile/lib/memcpy_tile64.c +++ b/trunk/arch/tile/lib/memcpy_tile64.c @@ -54,7 +54,7 @@ typedef unsigned long (*memcpy_t)(void *, const void *, unsigned long); * we must run with interrupts disabled to avoid the risk of some * other code seeing the incoherent data in our cache. (Recall that * our cache is indexed by PA, so even if the other code doesn't use - * our kmap_atomic virtual addresses, they'll still hit in cache using + * our KM_MEMCPY virtual addresses, they'll still hit in cache using * the normal VAs that aren't supposed to hit in cache.) */ static void memcpy_multicache(void *dest, const void *source, @@ -64,7 +64,6 @@ static void memcpy_multicache(void *dest, const void *source, unsigned long flags, newsrc, newdst; pmd_t *pmdp; pte_t *ptep; - int type0, type1; int cpu = get_cpu(); /* @@ -78,8 +77,7 @@ static void memcpy_multicache(void *dest, const void *source, sim_allow_multiple_caching(1); /* Set up the new dest mapping */ - type0 = kmap_atomic_idx_push(); - idx = FIX_KMAP_BEGIN + (KM_TYPE_NR * cpu) + type0; + idx = FIX_KMAP_BEGIN + (KM_TYPE_NR * cpu) + KM_MEMCPY0; newdst = __fix_to_virt(idx) + ((unsigned long)dest & (PAGE_SIZE-1)); pmdp = pmd_offset(pud_offset(pgd_offset_k(newdst), newdst), newdst); ptep = pte_offset_kernel(pmdp, newdst); @@ -89,8 +87,7 @@ static void memcpy_multicache(void *dest, const void *source, } /* Set up the new source mapping */ - type1 = kmap_atomic_idx_push(); - idx += (type0 - type1); + idx += (KM_MEMCPY0 - KM_MEMCPY1); src_pte = hv_pte_set_nc(src_pte); src_pte = hv_pte_clear_writable(src_pte); /* be paranoid */ newsrc = __fix_to_virt(idx) + ((unsigned long)source & (PAGE_SIZE-1)); @@ -122,8 +119,6 @@ static void memcpy_multicache(void *dest, const void *source, * We're done: notify the simulator that all is back to normal, * and re-enable interrupts and pre-emption. */ - kmap_atomic_idx_pop(); - kmap_atomic_idx_pop(); sim_allow_multiple_caching(0); local_irq_restore(flags); put_cpu(); diff --git a/trunk/arch/tile/mm/highmem.c b/trunk/arch/tile/mm/highmem.c index 31dbbd9afe47..abb57331cf6e 100644 --- a/trunk/arch/tile/mm/highmem.c +++ b/trunk/arch/tile/mm/highmem.c @@ -227,7 +227,7 @@ EXPORT_SYMBOL(kmap_atomic_prot); void *__kmap_atomic(struct page *page) { /* PAGE_NONE is a magic value that tells us to check immutability. */ - return kmap_atomic_prot(page, PAGE_NONE); + return kmap_atomic_prot(page, type, PAGE_NONE); } EXPORT_SYMBOL(__kmap_atomic); diff --git a/trunk/arch/tile/mm/init.c b/trunk/arch/tile/mm/init.c index 0b9ce69b0ee5..78e1982cb6c9 100644 --- a/trunk/arch/tile/mm/init.c +++ b/trunk/arch/tile/mm/init.c @@ -988,12 +988,8 @@ static long __write_once initfree = 1; /* Select whether to free (1) or mark unusable (0) the __init pages. */ static int __init set_initfree(char *str) { - long val; - if (strict_strtol(str, 0, &val)) { - initfree = val; - pr_info("initfree: %s free init pages\n", - initfree ? "will" : "won't"); - } + strict_strtol(str, 0, &initfree); + pr_info("initfree: %s free init pages\n", initfree ? "will" : "won't"); return 1; } __setup("initfree=", set_initfree); diff --git a/trunk/arch/tile/mm/pgtable.c b/trunk/arch/tile/mm/pgtable.c index 1f5430c53d0d..335c24621c41 100644 --- a/trunk/arch/tile/mm/pgtable.c +++ b/trunk/arch/tile/mm/pgtable.c @@ -134,9 +134,9 @@ void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t flags) } #if defined(CONFIG_HIGHPTE) -pte_t *_pte_offset_map(pmd_t *dir, unsigned long address) +pte_t *_pte_offset_map(pmd_t *dir, unsigned long address, enum km_type type) { - pte_t *pte = kmap_atomic(pmd_page(*dir)) + + pte_t *pte = kmap_atomic(pmd_page(*dir), type) + (pmd_ptfn(*dir) << HV_LOG2_PAGE_TABLE_ALIGN) & ~PAGE_MASK; return &pte[pte_index(address)]; } diff --git a/trunk/drivers/hwmon/ltc4261.c b/trunk/drivers/hwmon/ltc4261.c index 4b50601027d3..267626178678 100644 --- a/trunk/drivers/hwmon/ltc4261.c +++ b/trunk/drivers/hwmon/ltc4261.c @@ -82,7 +82,7 @@ static struct ltc4261_data *ltc4261_update_device(struct device *dev) val = i2c_smbus_read_byte_data(client, i); if (unlikely(val < 0)) { dev_dbg(dev, - "Failed to read ADC value: error %d\n", + "Failed to read ADC value: error %d", val); ret = ERR_PTR(val); goto abort; @@ -230,7 +230,8 @@ static int ltc4261_probe(struct i2c_client *client, return -ENODEV; if (i2c_smbus_read_byte_data(client, LTC4261_STATUS) < 0) { - dev_err(&client->dev, "Failed to read status register\n"); + dev_err(&client->dev, "Failed to read register %d:%02x:%02x\n", + adapter->id, client->addr, LTC4261_STATUS); return -ENODEV; } diff --git a/trunk/drivers/leds/leds-net5501.c b/trunk/drivers/leds/leds-net5501.c index 1739557a9038..3063f591f0dc 100644 --- a/trunk/drivers/leds/leds-net5501.c +++ b/trunk/drivers/leds/leds-net5501.c @@ -92,5 +92,3 @@ static int __init soekris_init(void) } arch_initcall(soekris_init); - -MODULE_LICENSE("GPL"); diff --git a/trunk/fs/cifs/file.c b/trunk/fs/cifs/file.c index ae82159cf7fa..5d06eb3078de 100644 --- a/trunk/fs/cifs/file.c +++ b/trunk/fs/cifs/file.c @@ -956,6 +956,7 @@ cifs_update_eof(struct cifsInodeInfo *cifsi, loff_t offset, ssize_t cifs_user_write(struct file *file, const char __user *write_data, size_t write_size, loff_t *poffset) { + struct inode *inode = file->f_path.dentry->d_inode; int rc = 0; unsigned int bytes_written = 0; unsigned int total_written; @@ -963,7 +964,7 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data, struct cifsTconInfo *pTcon; int xid, long_op; struct cifsFileInfo *open_file; - struct cifsInodeInfo *cifsi = CIFS_I(file->f_path.dentry->d_inode); + struct cifsInodeInfo *cifsi = CIFS_I(inode); cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); @@ -1029,21 +1030,17 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data, cifs_stats_bytes_written(pTcon, total_written); - /* since the write may have blocked check these pointers again */ - if ((file->f_path.dentry) && (file->f_path.dentry->d_inode)) { - struct inode *inode = file->f_path.dentry->d_inode; /* Do not update local mtime - server will set its actual value on write - * inode->i_ctime = inode->i_mtime = - * current_fs_time(inode->i_sb);*/ - if (total_written > 0) { - spin_lock(&inode->i_lock); - if (*poffset > file->f_path.dentry->d_inode->i_size) - i_size_write(file->f_path.dentry->d_inode, - *poffset); - spin_unlock(&inode->i_lock); - } - mark_inode_dirty_sync(file->f_path.dentry->d_inode); + * inode->i_ctime = inode->i_mtime = + * current_fs_time(inode->i_sb);*/ + if (total_written > 0) { + spin_lock(&inode->i_lock); + if (*poffset > inode->i_size) + i_size_write(inode, *poffset); + spin_unlock(&inode->i_lock); } + mark_inode_dirty_sync(inode); + FreeXid(xid); return total_written; } diff --git a/trunk/fs/cifs/ioctl.c b/trunk/fs/cifs/ioctl.c index 077bf756f342..2fa22f20cfc5 100644 --- a/trunk/fs/cifs/ioctl.c +++ b/trunk/fs/cifs/ioctl.c @@ -63,8 +63,6 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) #ifdef CONFIG_CIFS_POSIX case FS_IOC_GETFLAGS: if (CIFS_UNIX_EXTATTR_CAP & caps) { - if (pSMBFile == NULL) - break; rc = CIFSGetExtAttr(xid, tcon, pSMBFile->netfid, &ExtAttrBits, &ExtAttrMask); if (rc == 0) @@ -80,8 +78,6 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) rc = -EFAULT; break; } - if (pSMBFile == NULL) - break; /* rc= CIFSGetExtAttr(xid,tcon,pSMBFile->netfid, extAttrBits, &ExtAttrMask);*/ } diff --git a/trunk/fs/ext4/inode.c b/trunk/fs/ext4/inode.c index 4d78342f3bf0..191616470466 100644 --- a/trunk/fs/ext4/inode.c +++ b/trunk/fs/ext4/inode.c @@ -5410,7 +5410,9 @@ int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry, * will return the blocks that include the delayed allocation * blocks for this file. */ + spin_lock(&EXT4_I(inode)->i_block_reservation_lock); delalloc_blocks = EXT4_I(inode)->i_reserved_data_blocks; + spin_unlock(&EXT4_I(inode)->i_block_reservation_lock); stat->blocks += (delalloc_blocks << inode->i_sb->s_blocksize_bits)>>9; return 0; diff --git a/trunk/fs/logfs/logfs.h b/trunk/fs/logfs/logfs.h index 57afd4a6fabb..cd51a36b37f0 100644 --- a/trunk/fs/logfs/logfs.h +++ b/trunk/fs/logfs/logfs.h @@ -486,7 +486,7 @@ static inline int logfs_get_sb_bdev(struct logfs_super *s, /* dev_mtd.c */ #ifdef CONFIG_MTD -int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr); +int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr) #else static inline int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr) { diff --git a/trunk/include/asm-generic/stat.h b/trunk/include/asm-generic/stat.h index bd8cad21998e..47e64170305d 100644 --- a/trunk/include/asm-generic/stat.h +++ b/trunk/include/asm-generic/stat.h @@ -33,18 +33,18 @@ struct stat { int st_blksize; /* Optimal block size for I/O. */ int __pad2; long st_blocks; /* Number 512-byte blocks allocated. */ - long st_atime; /* Time of last access. */ - unsigned long st_atime_nsec; - long st_mtime; /* Time of last modification. */ - unsigned long st_mtime_nsec; - long st_ctime; /* Time of last status change. */ - unsigned long st_ctime_nsec; + int st_atime; /* Time of last access. */ + unsigned int st_atime_nsec; + int st_mtime; /* Time of last modification. */ + unsigned int st_mtime_nsec; + int st_ctime; /* Time of last status change. */ + unsigned int st_ctime_nsec; unsigned int __unused4; unsigned int __unused5; }; +#if __BITS_PER_LONG != 64 /* This matches struct stat64 in glibc2.1. Only used for 32 bit. */ -#if __BITS_PER_LONG != 64 || defined(__ARCH_WANT_STAT64) struct stat64 { unsigned long long st_dev; /* Device. */ unsigned long long st_ino; /* File serial number. */ diff --git a/trunk/include/linux/hardirq.h b/trunk/include/linux/hardirq.h index 41cb31f14ee3..8a389b608ce3 100644 --- a/trunk/include/linux/hardirq.h +++ b/trunk/include/linux/hardirq.h @@ -96,15 +96,11 @@ */ #define in_nmi() (preempt_count() & NMI_MASK) -#if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL) -# define PREEMPT_INATOMIC_BASE kernel_locked() -#else -# define PREEMPT_INATOMIC_BASE 0 -#endif - #if defined(CONFIG_PREEMPT) +# define PREEMPT_INATOMIC_BASE kernel_locked() # define PREEMPT_CHECK_OFFSET 1 #else +# define PREEMPT_INATOMIC_BASE 0 # define PREEMPT_CHECK_OFFSET 0 #endif diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index 21aa7b3001fb..b194febf5799 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -95,14 +95,6 @@ static void __exit_signal(struct task_struct *tsk) tty = sig->tty; sig->tty = NULL; } else { - /* - * This can only happen if the caller is de_thread(). - * FIXME: this is the temporary hack, we should teach - * posix-cpu-timers to handle this case correctly. - */ - if (unlikely(has_group_leader_pid(tsk))) - posix_cpu_timers_exit_group(tsk); - /* * If there is any task waiting for the group exit * then notify it: diff --git a/trunk/kernel/relay.c b/trunk/kernel/relay.c index 859ea5a9605f..c7cf397fb929 100644 --- a/trunk/kernel/relay.c +++ b/trunk/kernel/relay.c @@ -70,10 +70,17 @@ static const struct vm_operations_struct relay_file_mmap_ops = { */ static struct page **relay_alloc_page_array(unsigned int n_pages) { - const size_t pa_size = n_pages * sizeof(struct page *); - if (pa_size > PAGE_SIZE) - return vzalloc(pa_size); - return kzalloc(pa_size, GFP_KERNEL); + struct page **array; + size_t pa_size = n_pages * sizeof(struct page *); + + if (pa_size > PAGE_SIZE) { + array = vmalloc(pa_size); + if (array) + memset(array, 0, pa_size); + } else { + array = kzalloc(pa_size, GFP_KERNEL); + } + return array; } /* diff --git a/trunk/mm/filemap.c b/trunk/mm/filemap.c index 61ba5e405791..75572b5f2374 100644 --- a/trunk/mm/filemap.c +++ b/trunk/mm/filemap.c @@ -1563,10 +1563,8 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) goto no_cached_page; } - if (!lock_page_or_retry(page, vma->vm_mm, vmf->flags)) { - page_cache_release(page); + if (!lock_page_or_retry(page, vma->vm_mm, vmf->flags)) return ret | VM_FAULT_RETRY; - } /* Did it get truncated? */ if (unlikely(page->mapping != mapping)) { diff --git a/trunk/mm/vmstat.c b/trunk/mm/vmstat.c index 42eac4d33216..cd2e42be7b68 100644 --- a/trunk/mm/vmstat.c +++ b/trunk/mm/vmstat.c @@ -949,7 +949,7 @@ static void *vmstat_start(struct seq_file *m, loff_t *pos) v[PGPGIN] /= 2; /* sectors -> kbytes */ v[PGPGOUT] /= 2; #endif - return (unsigned long *)m->private + *pos; + return m->private + *pos; } static void *vmstat_next(struct seq_file *m, void *arg, loff_t *pos) diff --git a/trunk/scripts/kconfig/symbol.c b/trunk/scripts/kconfig/symbol.c index af6e9f3de950..c0efe102d655 100644 --- a/trunk/scripts/kconfig/symbol.c +++ b/trunk/scripts/kconfig/symbol.c @@ -875,7 +875,7 @@ const char *sym_expand_string_value(const char *in) symval = sym_get_string_value(sym); } - newlen = strlen(res) + strlen(symval) + strlen(src) + 1; + newlen = strlen(res) + strlen(symval) + strlen(src); if (newlen > reslen) { reslen = newlen; res = realloc(res, reslen); diff --git a/trunk/sound/pci/asihpi/hpi6000.c b/trunk/sound/pci/asihpi/hpi6000.c index 1b9bf9395cfe..f7e374ec4414 100644 --- a/trunk/sound/pci/asihpi/hpi6000.c +++ b/trunk/sound/pci/asihpi/hpi6000.c @@ -625,8 +625,6 @@ static short create_adapter_obj(struct hpi_adapter_obj *pao, control_cache_size, (struct hpi_control_cache_info *) &phw->control_cache[0] ); - if (!phw->p_cache) - pao->has_control_cache = 0; } else pao->has_control_cache = 0; diff --git a/trunk/sound/pci/asihpi/hpi6205.c b/trunk/sound/pci/asihpi/hpi6205.c index 2672f6591ceb..22c5fc625533 100644 --- a/trunk/sound/pci/asihpi/hpi6205.c +++ b/trunk/sound/pci/asihpi/hpi6205.c @@ -644,8 +644,6 @@ static u16 create_adapter_obj(struct hpi_adapter_obj *pao, interface->control_cache.size_in_bytes, (struct hpi_control_cache_info *) p_control_cache_virtual); - if (!phw->p_cache) - err = HPI_ERROR_MEMORY_ALLOC; } if (!err) { err = hpios_locked_mem_get_phys_addr(&phw-> diff --git a/trunk/sound/pci/asihpi/hpicmn.c b/trunk/sound/pci/asihpi/hpicmn.c index d67f4d3db911..dda4f1c6f658 100644 --- a/trunk/sound/pci/asihpi/hpicmn.c +++ b/trunk/sound/pci/asihpi/hpicmn.c @@ -571,20 +571,14 @@ struct hpi_control_cache *hpi_alloc_control_cache(const u32 { struct hpi_control_cache *p_cache = kmalloc(sizeof(*p_cache), GFP_KERNEL); - if (!p_cache) - return NULL; - p_cache->p_info = - kmalloc(sizeof(*p_cache->p_info) * number_of_controls, - GFP_KERNEL); - if (!p_cache->p_info) { - kfree(p_cache); - return NULL; - } p_cache->cache_size_in_bytes = size_in_bytes; p_cache->control_count = number_of_controls; p_cache->p_cache = (struct hpi_control_cache_single *)pDSP_control_buffer; p_cache->init = 0; + p_cache->p_info = + kmalloc(sizeof(*p_cache->p_info) * p_cache->control_count, + GFP_KERNEL); return p_cache; } diff --git a/trunk/sound/pci/cs46xx/dsp_spos.c b/trunk/sound/pci/cs46xx/dsp_spos.c index e377287192aa..3e5ca8fb519f 100644 --- a/trunk/sound/pci/cs46xx/dsp_spos.c +++ b/trunk/sound/pci/cs46xx/dsp_spos.c @@ -225,25 +225,39 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip) { struct dsp_spos_instance * ins = kzalloc(sizeof(struct dsp_spos_instance), GFP_KERNEL); - if (ins == NULL) + if (ins == NULL) return NULL; /* better to use vmalloc for this big table */ + ins->symbol_table.nsymbols = 0; ins->symbol_table.symbols = vmalloc(sizeof(struct dsp_symbol_entry) * DSP_MAX_SYMBOLS); - ins->code.data = kmalloc(DSP_CODE_BYTE_SIZE, GFP_KERNEL); - ins->modules = kmalloc(sizeof(struct dsp_module_desc) * DSP_MAX_MODULES, GFP_KERNEL); - if (!ins->symbol_table.symbols || !ins->code.data || !ins->modules) { + ins->symbol_table.highest_frag_index = 0; + + if (ins->symbol_table.symbols == NULL) { cs46xx_dsp_spos_destroy(chip); goto error; } - ins->symbol_table.nsymbols = 0; - ins->symbol_table.highest_frag_index = 0; + ins->code.offset = 0; ins->code.size = 0; + ins->code.data = kmalloc(DSP_CODE_BYTE_SIZE, GFP_KERNEL); + + if (ins->code.data == NULL) { + cs46xx_dsp_spos_destroy(chip); + goto error; + } + ins->nscb = 0; ins->ntask = 0; + ins->nmodules = 0; + ins->modules = kmalloc(sizeof(struct dsp_module_desc) * DSP_MAX_MODULES, GFP_KERNEL); + + if (ins->modules == NULL) { + cs46xx_dsp_spos_destroy(chip); + goto error; + } /* default SPDIF input sample rate to 48000 khz */ @@ -257,8 +271,8 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip) /* set left and right validity bits and default channel status */ - ins->spdif_csuv_default = - ins->spdif_csuv_stream = + ins->spdif_csuv_default = + ins->spdif_csuv_stream = /* byte 0 */ ((unsigned int)_wrap_all_bits( (SNDRV_PCM_DEFAULT_CON_SPDIF & 0xff)) << 24) | /* byte 1 */ ((unsigned int)_wrap_all_bits( ((SNDRV_PCM_DEFAULT_CON_SPDIF >> 8) & 0xff)) << 16) | /* byte 3 */ (unsigned int)_wrap_all_bits( (SNDRV_PCM_DEFAULT_CON_SPDIF >> 24) & 0xff) | @@ -267,9 +281,6 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip) return ins; error: - kfree(ins->modules); - kfree(ins->code.data); - vfree(ins->symbol_table.symbols); kfree(ins); return NULL; } diff --git a/trunk/sound/pci/hda/patch_cirrus.c b/trunk/sound/pci/hda/patch_cirrus.c index 18af38ebf757..460fb2ef7e39 100644 --- a/trunk/sound/pci/hda/patch_cirrus.c +++ b/trunk/sound/pci/hda/patch_cirrus.c @@ -1166,7 +1166,6 @@ static const char *cs420x_models[CS420X_MODELS] = { static struct snd_pci_quirk cs420x_cfg_tbl[] = { SND_PCI_QUIRK(0x10de, 0x0ac0, "MacBookPro 5,3", CS420X_MBP53), - SND_PCI_QUIRK(0x10de, 0x0d94, "MacBookAir 3,1(2)", CS420X_MBP55), SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55), SND_PCI_QUIRK(0x10de, 0xcb89, "MacBookPro 7,1", CS420X_MBP55), SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27), diff --git a/trunk/sound/pci/lx6464es/lx6464es.c b/trunk/sound/pci/lx6464es/lx6464es.c index 1bd7a540fd49..ef9af3f4ace2 100644 --- a/trunk/sound/pci/lx6464es/lx6464es.c +++ b/trunk/sound/pci/lx6464es/lx6464es.c @@ -425,7 +425,7 @@ static int lx_pcm_hw_free(struct snd_pcm_substream *substream) static void lx_trigger_start(struct lx6464es *chip, struct lx_stream *lx_stream) { struct snd_pcm_substream *substream = lx_stream->stream; - const unsigned int is_capture = lx_stream->is_capture; + const int is_capture = lx_stream->is_capture; int err; @@ -473,7 +473,7 @@ static void lx_trigger_start(struct lx6464es *chip, struct lx_stream *lx_stream) static void lx_trigger_stop(struct lx6464es *chip, struct lx_stream *lx_stream) { - const unsigned int is_capture = lx_stream->is_capture; + const int is_capture = lx_stream->is_capture; int err; snd_printd(LXP "stopping: stopping stream\n"); diff --git a/trunk/sound/pci/lx6464es/lx6464es.h b/trunk/sound/pci/lx6464es/lx6464es.h index aea621eafbb5..51afc048961d 100644 --- a/trunk/sound/pci/lx6464es/lx6464es.h +++ b/trunk/sound/pci/lx6464es/lx6464es.h @@ -60,7 +60,7 @@ struct lx_stream { snd_pcm_uframes_t frame_pos; enum lx_stream_status status; /* free, open, running, draining * pause */ - unsigned int is_capture:1; + int is_capture:1; }; diff --git a/trunk/sound/pci/lx6464es/lx_core.c b/trunk/sound/pci/lx6464es/lx_core.c index 617f98b0cbae..3086b751da4a 100644 --- a/trunk/sound/pci/lx6464es/lx_core.c +++ b/trunk/sound/pci/lx6464es/lx_core.c @@ -1152,7 +1152,7 @@ static int lx_interrupt_request_new_buffer(struct lx6464es *chip, struct lx_stream *lx_stream) { struct snd_pcm_substream *substream = lx_stream->stream; - const unsigned int is_capture = lx_stream->is_capture; + int is_capture = lx_stream->is_capture; int err; unsigned long flags; diff --git a/trunk/sound/soc/codecs/Kconfig b/trunk/sound/soc/codecs/Kconfig index 3b5690d28b8b..94a9d06b9027 100644 --- a/trunk/sound/soc/codecs/Kconfig +++ b/trunk/sound/soc/codecs/Kconfig @@ -25,9 +25,8 @@ config SND_SOC_ALL_CODECS select SND_SOC_CQ0093VC if MFD_DAVINCI_VOICECODEC select SND_SOC_CS42L51 if I2C select SND_SOC_CS4270 if I2C - select SND_SOC_CX20442 select SND_SOC_DA7210 if I2C - select SND_SOC_JZ4740_CODEC if SOC_JZ4740 + select SND_SOC_JZ4740 if SOC_JZ4740 select SND_SOC_MAX98088 if I2C select SND_SOC_MAX9877 if I2C select SND_SOC_PCM3008 diff --git a/trunk/sound/soc/codecs/tlv320dac33.c b/trunk/sound/soc/codecs/tlv320dac33.c index c5ab8c805771..d251ff54a2d3 100644 --- a/trunk/sound/soc/codecs/tlv320dac33.c +++ b/trunk/sound/soc/codecs/tlv320dac33.c @@ -58,7 +58,7 @@ (1000000000 / ((rate * 1000) / samples)) #define US_TO_SAMPLES(rate, us) \ - (rate / (1000000 / (us < 1000000 ? us : 1000000))) + (rate / (1000000 / us)) #define UTHR_FROM_PERIOD_SIZE(samples, playrate, burstrate) \ ((samples * 5000) / ((burstrate * 5000) / (burstrate - playrate))) @@ -200,7 +200,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg, u8 *value) { struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); - int val, ret = 0; + int val; *value = reg & 0xff; @@ -210,7 +210,6 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg, if (val < 0) { dev_err(codec->dev, "Read failed (%d)\n", val); value[0] = dac33_read_reg_cache(codec, reg); - ret = val; } else { value[0] = val; dac33_write_reg_cache(codec, reg, val); @@ -219,7 +218,7 @@ static int dac33_read(struct snd_soc_codec *codec, unsigned int reg, value[0] = dac33_read_reg_cache(codec, reg); } - return ret; + return 0; } static int dac33_write(struct snd_soc_codec *codec, unsigned int reg, @@ -330,18 +329,13 @@ static void dac33_init_chip(struct snd_soc_codec *codec) dac33_read_reg_cache(codec, DAC33_LINER_TO_RLO_VOL)); } -static inline int dac33_read_id(struct snd_soc_codec *codec) +static inline void dac33_read_id(struct snd_soc_codec *codec) { - int i, ret = 0; u8 reg; - for (i = 0; i < 3; i++) { - ret = dac33_read(codec, DAC33_DEVICE_ID_MSB + i, ®); - if (ret < 0) - break; - } - - return ret; + dac33_read(codec, DAC33_DEVICE_ID_MSB, ®); + dac33_read(codec, DAC33_DEVICE_ID_LSB, ®); + dac33_read(codec, DAC33_DEVICE_REV_ID, ®); } static inline void dac33_soft_power(struct snd_soc_codec *codec, int power) @@ -1082,9 +1076,6 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream) /* Number of samples under i2c latency */ dac33->alarm_threshold = US_TO_SAMPLES(rate, dac33->mode1_latency); - nsample_limit = DAC33_BUFFER_SIZE_SAMPLES - - dac33->alarm_threshold; - if (dac33->auto_fifo_config) { if (period_size <= dac33->alarm_threshold) /* @@ -1095,8 +1086,6 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream) ((dac33->alarm_threshold / period_size) + (dac33->alarm_threshold % period_size ? 1 : 0)); - else if (period_size > nsample_limit) - dac33->nsample = nsample_limit; else dac33->nsample = period_size; } else { @@ -1108,7 +1097,8 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream) */ dac33->nsample_max = substream->runtime->buffer_size - period_size; - + nsample_limit = DAC33_BUFFER_SIZE_SAMPLES - + dac33->alarm_threshold; if (dac33->nsample_max > nsample_limit) dac33->nsample_max = nsample_limit; @@ -1424,15 +1414,9 @@ static int dac33_soc_probe(struct snd_soc_codec *codec) dev_err(codec->dev, "Failed to power up codec: %d\n", ret); goto err_power; } - ret = dac33_read_id(codec); + dac33_read_id(codec); dac33_hard_power(codec, 0); - if (ret < 0) { - dev_err(codec->dev, "Failed to read chip ID: %d\n", ret); - ret = -ENODEV; - goto err_power; - } - /* Check if the IRQ number is valid and request it */ if (dac33->irq >= 0) { ret = request_irq(dac33->irq, dac33_interrupt_handler, diff --git a/trunk/sound/soc/codecs/tpa6130a2.c b/trunk/sound/soc/codecs/tpa6130a2.c index ee4fb201de60..329acc1a2074 100644 --- a/trunk/sound/soc/codecs/tpa6130a2.c +++ b/trunk/sound/soc/codecs/tpa6130a2.c @@ -119,13 +119,13 @@ static int tpa6130a2_power(int power) { struct tpa6130a2_data *data; u8 val; - int ret = 0; + int ret; BUG_ON(tpa6130a2_client == NULL); data = i2c_get_clientdata(tpa6130a2_client); mutex_lock(&data->mutex); - if (power && !data->power_state) { + if (power) { /* Power on */ if (data->power_gpio >= 0) gpio_set_value(data->power_gpio, 1); @@ -153,7 +153,7 @@ static int tpa6130a2_power(int power) val = tpa6130a2_read(TPA6130A2_REG_CONTROL); val &= ~TPA6130A2_SWS; tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val); - } else if (!power && data->power_state) { + } else { /* set SWS */ val = tpa6130a2_read(TPA6130A2_REG_CONTROL); val |= TPA6130A2_SWS; diff --git a/trunk/sound/soc/codecs/wm8900.c b/trunk/sound/soc/codecs/wm8900.c index aca4b1ea10bb..b4f11724a63f 100644 --- a/trunk/sound/soc/codecs/wm8900.c +++ b/trunk/sound/soc/codecs/wm8900.c @@ -186,6 +186,7 @@ static int wm8900_volatile_register(unsigned int reg) { switch (reg) { case WM8900_REG_ID: + case WM8900_REG_POWER1: return 1; default: return 0; @@ -1199,6 +1200,11 @@ static int wm8900_probe(struct snd_soc_codec *codec) return -ENODEV; } + /* Read back from the chip */ + reg = snd_soc_read(codec, WM8900_REG_POWER1); + reg = (reg >> 12) & 0xf; + dev_info(codec->dev, "WM8900 revision %d\n", reg); + wm8900_reset(codec); /* Turn the chip on */ diff --git a/trunk/sound/soc/codecs/wm_hubs.c b/trunk/sound/soc/codecs/wm_hubs.c index 19ca782ac970..2cb81538cd91 100644 --- a/trunk/sound/soc/codecs/wm_hubs.c +++ b/trunk/sound/soc/codecs/wm_hubs.c @@ -123,7 +123,7 @@ static void calibrate_dc_servo(struct snd_soc_codec *codec) reg_r = reg & WM8993_DCS_DAC_WR_VAL_0_MASK; break; default: - WARN(1, "Unknown DCS readback method\n"); + WARN(1, "Unknown DCS readback method"); break; } diff --git a/trunk/sound/soc/pxa/tosa.c b/trunk/sound/soc/pxa/tosa.c index 73d0edd8ded9..a3bfb2e8b70f 100644 --- a/trunk/sound/soc/pxa/tosa.c +++ b/trunk/sound/soc/pxa/tosa.c @@ -79,7 +79,7 @@ static void tosa_ext_control(struct snd_soc_codec *codec) static int tosa_startup(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_codec *codec = rtd->codec; + struct snd_soc_codec *codec = rtd->card->codec; /* check the jack status at stream startup */ tosa_ext_control(codec); diff --git a/trunk/sound/soc/soc-core.c b/trunk/sound/soc/soc-core.c index 614a8b30d87b..1c8f3f507f54 100644 --- a/trunk/sound/soc/soc-core.c +++ b/trunk/sound/soc/soc-core.c @@ -165,11 +165,8 @@ static ssize_t pmdown_time_set(struct device *dev, { struct snd_soc_pcm_runtime *rtd = container_of(dev, struct snd_soc_pcm_runtime, dev); - int ret; - ret = strict_strtol(buf, 10, &rtd->pmdown_time); - if (ret) - return ret; + strict_strtol(buf, 10, &rtd->pmdown_time); return count; } diff --git a/trunk/sound/usb/mixer_quirks.c b/trunk/sound/usb/mixer_quirks.c index 782f741cd00a..7dae05d8783e 100644 --- a/trunk/sound/usb/mixer_quirks.c +++ b/trunk/sound/usb/mixer_quirks.c @@ -60,7 +60,7 @@ static const struct rc_config { { USB_ID(0x041e, 0x3000), 0, 1, 2, 1, 18, 0x0013 }, /* Extigy */ { USB_ID(0x041e, 0x3020), 2, 1, 6, 6, 18, 0x0013 }, /* Audigy 2 NX */ { USB_ID(0x041e, 0x3040), 2, 2, 6, 6, 2, 0x6e91 }, /* Live! 24-bit */ - { USB_ID(0x041e, 0x3042), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi S51 */ + { USB_ID(0x041e, 0x3042), 0, 1, 1, 1, 1, 0x000d }, /* Usb X-Fi */ { USB_ID(0x041e, 0x3048), 2, 2, 6, 6, 2, 0x6e91 }, /* Toshiba SB0500 */ }; @@ -183,13 +183,7 @@ static int snd_audigy2nx_led_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e if (value > 1) return -EINVAL; changed = value != mixer->audigy2nx_leds[index]; - if (mixer->chip->usb_id == USB_ID(0x041e, 0x3042)) - err = snd_usb_ctl_msg(mixer->chip->dev, - usb_sndctrlpipe(mixer->chip->dev, 0), 0x24, - USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER, - !value, 0, NULL, 0, 100); - else - err = snd_usb_ctl_msg(mixer->chip->dev, + err = snd_usb_ctl_msg(mixer->chip->dev, usb_sndctrlpipe(mixer->chip->dev, 0), 0x24, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER, value, index + 2, NULL, 0, 100); @@ -231,12 +225,8 @@ static int snd_audigy2nx_controls_create(struct usb_mixer_interface *mixer) int i, err; for (i = 0; i < ARRAY_SIZE(snd_audigy2nx_controls); ++i) { - /* USB X-Fi S51 doesn't have a CMSS LED */ - if ((mixer->chip->usb_id == USB_ID(0x041e, 0x3042)) && i == 0) - continue; if (i > 1 && /* Live24ext has 2 LEDs only */ (mixer->chip->usb_id == USB_ID(0x041e, 0x3040) || - mixer->chip->usb_id == USB_ID(0x041e, 0x3042) || mixer->chip->usb_id == USB_ID(0x041e, 0x3048))) break; err = snd_ctl_add(mixer->chip->card, @@ -375,7 +365,6 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) if (mixer->chip->usb_id == USB_ID(0x041e, 0x3020) || mixer->chip->usb_id == USB_ID(0x041e, 0x3040) || - mixer->chip->usb_id == USB_ID(0x041e, 0x3042) || mixer->chip->usb_id == USB_ID(0x041e, 0x3048)) { if ((err = snd_audigy2nx_controls_create(mixer)) < 0) return err; diff --git a/trunk/sound/usb/pcm.c b/trunk/sound/usb/pcm.c index 4132522ac90f..cff3a3c465d7 100644 --- a/trunk/sound/usb/pcm.c +++ b/trunk/sound/usb/pcm.c @@ -676,10 +676,8 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime, if (!needs_knot) return 0; - subs->rate_list.list = kmalloc(sizeof(int) * count, GFP_KERNEL); - if (!subs->rate_list.list) - return -ENOMEM; subs->rate_list.count = count; + subs->rate_list.list = kmalloc(sizeof(int) * count, GFP_KERNEL); subs->rate_list.mask = 0; count = 0; list_for_each_entry(fp, &subs->fmt_list, list) {