From 98c20bf4d97c0f33f4b6e76237ede5b620b83e2c Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 2 Apr 2003 16:27:47 -0800 Subject: [PATCH] [PATCH] misc fixes - Fix warning in sound/pci/cs46xx/cs46xx_lib.c (Martin Bligh) - pte_file() comment fix (Pete Zaitcev) - _PAGE_FILE comment clarifications - copy_to_user() check in do_proc_readlink() --- fs/proc/base.c | 3 ++- include/asm-alpha/pgtable.h | 2 +- include/asm-i386/pgtable.h | 6 +++++- include/asm-x86_64/pgtable.h | 2 +- sound/pci/cs46xx/cs46xx_lib.c | 2 ++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index 7f767342c449..c72b512876ec 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -583,7 +583,8 @@ static int do_proc_readlink(struct dentry *dentry, struct vfsmount *mnt, if (len > buflen) len = buflen; - copy_to_user(buffer, path, len); + if (copy_to_user(buffer, path, len)) + len = -EFAULT; out: free_page((unsigned long)tmp); return len; diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h index 84286e14c4d4..60bf13e10b4e 100644 --- a/include/asm-alpha/pgtable.h +++ b/include/asm-alpha/pgtable.h @@ -68,7 +68,7 @@ /* .. and these are ours ... */ #define _PAGE_DIRTY 0x20000 #define _PAGE_ACCESSED 0x40000 -#define _PAGE_FILE 0x80000 /* pagecache or swap? */ +#define _PAGE_FILE 0x80000 /* set:pagecache, unset:swap */ /* * NOTE! The "accessed" bit isn't necessarily exact: it can be kept exactly diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index e7ca60e0d028..1c557c87abf1 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h @@ -110,7 +110,7 @@ void pgtable_cache_init(void); #define _PAGE_PSE 0x080 /* 4 MB (or 2MB) page, Pentium+, if present.. */ #define _PAGE_GLOBAL 0x100 /* Global TLB entry PPro+ */ -#define _PAGE_FILE 0x040 /* pagecache or swap? */ +#define _PAGE_FILE 0x040 /* set:pagecache unset:swap */ #define _PAGE_PROTNONE 0x080 /* If not present */ #define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY) @@ -188,6 +188,10 @@ static inline int pte_exec(pte_t pte) { return (pte).pte_low & _PAGE_USER; } static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; } static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; } static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; } + +/* + * The following only works if pte_present() is not true. + */ static inline int pte_file(pte_t pte) { return (pte).pte_low & _PAGE_FILE; } static inline pte_t pte_rdprotect(pte_t pte) { (pte).pte_low &= ~_PAGE_USER; return pte; } diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 4d31ca2fef05..7e6a4b577bae 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h @@ -151,7 +151,7 @@ static inline void set_pml4(pml4_t *dst, pml4_t val) #define _PAGE_ACCESSED 0x020 #define _PAGE_DIRTY 0x040 #define _PAGE_PSE 0x080 /* 2MB page */ -#define _PAGE_FILE 0x040 /* pagecache or swap */ +#define _PAGE_FILE 0x040 /* set:pagecache, unset:swap */ #define _PAGE_GLOBAL 0x100 /* Global TLB entry */ #define _PAGE_PROTNONE 0x080 /* If not present */ diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index fe1f7d5afac1..61b2496ece32 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -3381,7 +3381,9 @@ static void amp_voyetra(cs46xx_t *chip, int change) /* Manage the EAPD bit on the Crystal 4297 and the Analog AD1885 */ +#ifdef CONFIG_SND_CS46XX_NEW_DSP int old = chip->amplifier; +#endif int oval, val; chip->amplifier += change; -- 2.39.5