Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / char / mem.c
index c6fa3bc2baa89cfec662945dcc9818dadfe0d44c..2c644afbcdd4561d2fc7810aafd2ef9502ecf0e6 100644 (file)
@@ -399,7 +399,7 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
 {
        unsigned long p = *ppos;
        ssize_t low_count, read, sz;
-       char * kbuf; /* k-addr because vread() takes vmlist_lock rwlock */
+       char *kbuf; /* k-addr because vread() takes vmlist_lock rwlock */
        int err = 0;
 
        read = 0;
@@ -527,7 +527,7 @@ static ssize_t write_kmem(struct file *file, const char __user *buf,
        unsigned long p = *ppos;
        ssize_t wrote = 0;
        ssize_t virtr = 0;
-       char * kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */
+       char *kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */
        int err = 0;
 
        if (p < (unsigned long) high_memory) {
@@ -595,7 +595,7 @@ static ssize_t write_port(struct file *file, const char __user *buf,
                          size_t count, loff_t *ppos)
 {
        unsigned long i = *ppos;
-       const char __user * tmp = buf;
+       const char __user *tmp = buf;
 
        if (!access_ok(VERIFY_READ, buf, count))
                return -EFAULT;
@@ -708,7 +708,7 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
 {
        loff_t ret;
 
-       mutex_lock(&file->f_path.dentry->d_inode->i_mutex);
+       mutex_lock(&file_inode(file)->i_mutex);
        switch (orig) {
        case SEEK_CUR:
                offset += file->f_pos;
@@ -725,11 +725,11 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
        default:
                ret = -EINVAL;
        }
-       mutex_unlock(&file->f_path.dentry->d_inode->i_mutex);
+       mutex_unlock(&file_inode(file)->i_mutex);
        return ret;
 }
 
-static int open_port(struct inode * inode, struct file * filp)
+static int open_port(struct inode *inode, struct file *filp)
 {
        return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
 }
@@ -898,7 +898,7 @@ static int __init chr_dev_init(void)
                        continue;
 
                /*
-                * Create /dev/port? 
+                * Create /dev/port?
                 */
                if ((minor == DEVPORT_MINOR) && !arch_has_dev_port())
                        continue;