]> git.hungrycats.org Git - linux/commitdiff
[PATCH] misc fixes
authorAndrew Morton <akpm@digeo.com>
Thu, 3 Apr 2003 00:27:47 +0000 (16:27 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 3 Apr 2003 00:27:47 +0000 (16:27 -0800)
- 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
include/asm-alpha/pgtable.h
include/asm-i386/pgtable.h
include/asm-x86_64/pgtable.h
sound/pci/cs46xx/cs46xx_lib.c

index 7f767342c449baa1509449c75fcca37ff5a46163..c72b512876ec8e127143f49f961e541d2c2665d1 100644 (file)
@@ -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;
index 84286e14c4d4af3cdba65f528cead5918ab1fe19..60bf13e10b4eb112eea8c7307a26ddb53dc89062 100644 (file)
@@ -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
index e7ca60e0d02830191cdbf0e22e1eab9658992801..1c557c87abf18859ea341ce58474d042a73be9bf 100644 (file)
@@ -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; }
index 4d31ca2fef05fec457bfddc75b2874cc73a4f67f..7e6a4b577baeeb8bc2ecd84cef180b344eaa8a72 100644 (file)
@@ -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 */
index fe1f7d5afac11b0b62b47e6b1231a7831e93a9e9..61b2496ece32f70729eb882245b340c066afdec8 100644 (file)
@@ -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;