From 47376c18611d6878fa3fbf704b300178501677ed Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 30 Nov 2011 15:12:01 +1100 Subject: [PATCH] procfs-introduce-the-proc-pid-map_files-directory-checkpatch-fixes Cc: "Kirill A. Shutemov" WARNING: line over 80 characters #286: FILE: fs/proc/base.c:2433: +static int proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir) WARNING: line over 80 characters #351: FILE: fs/proc/base.c:2498: + fa = flex_array_alloc(sizeof(info), nr_files, GFP_KERNEL); WARNING: line over 80 characters #352: FILE: fs/proc/base.c:2499: + if (!fa || flex_array_prealloc(fa, 0, nr_files, GFP_KERNEL)) { WARNING: line over 80 characters #360: FILE: fs/proc/base.c:2507: + for (i = 0, vma = mm->mmap, pos = 2; vma; vma = vma->vm_next) { WARNING: line over 80 characters #368: FILE: fs/proc/base.c:2515: + info.len = snprintf(info.name, sizeof(info.name), WARNING: line over 80 characters #424: FILE: fs/proc/base.c:3179: + DIR("map_files", S_IRUSR|S_IXUSR, proc_map_files_inode_operations, proc_map_files_operations), WARNING: line over 80 characters #437: FILE: include/linux/mm.h:1497: +find_exact_vma(struct mm_struct *mm, unsigned long vm_start, unsigned long vm_end) total: 0 errors, 7 warnings, 387 lines checked ./patches/procfs-introduce-the-proc-pid-map_files-directory.patch has style problems, please review. If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Cyrill Gorcunov Signed-off-by: Andrew Morton --- fs/proc/base.c | 18 +++++++++++------- include/linux/mm.h | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index 51b0322e2842..f200c72bd74d 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2371,7 +2371,8 @@ static const struct inode_operations proc_map_files_inode_operations = { .setattr = proc_setattr, }; -static int proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir) +static int +proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir) { struct dentry *dentry = filp->f_path.dentry; struct inode *inode = dentry->d_inode; @@ -2436,8 +2437,10 @@ static int proc_map_files_readdir(struct file *filp, void *dirent, filldir_t fil } if (nr_files) { - fa = flex_array_alloc(sizeof(info), nr_files, GFP_KERNEL); - if (!fa || flex_array_prealloc(fa, 0, nr_files, GFP_KERNEL)) { + fa = flex_array_alloc(sizeof(info), nr_files, + GFP_KERNEL); + if (!fa || flex_array_prealloc(fa, 0, nr_files, + GFP_KERNEL)) { ret = -ENOMEM; if (fa) flex_array_free(fa); @@ -2445,7 +2448,8 @@ static int proc_map_files_readdir(struct file *filp, void *dirent, filldir_t fil mmput(mm); goto out_unlock; } - for (i = 0, vma = mm->mmap, pos = 2; vma; vma = vma->vm_next) { + for (i = 0, vma = mm->mmap, pos = 2; vma; + vma = vma->vm_next) { if (!vma->vm_file) continue; if (++pos <= filp->f_pos) @@ -2453,9 +2457,9 @@ static int proc_map_files_readdir(struct file *filp, void *dirent, filldir_t fil get_file(vma->vm_file); info.file = vma->vm_file; - info.len = snprintf(info.name, sizeof(info.name), - "%lx-%lx", vma->vm_start, - vma->vm_end); + info.len = snprintf(info.name, + sizeof(info.name), "%lx-%lx", + vma->vm_start, vma->vm_end); if (flex_array_put(fa, i++, &info, GFP_KERNEL)) BUG(); } diff --git a/include/linux/mm.h b/include/linux/mm.h index fc110b63f1aa..0b6e7443d3e9 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1493,8 +1493,8 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma) } /* Look up the first VMA which exactly match the interval vm_start ... vm_end */ -static inline struct vm_area_struct * -find_exact_vma(struct mm_struct *mm, unsigned long vm_start, unsigned long vm_end) +static inline struct vm_area_struct *find_exact_vma(struct mm_struct *mm, + unsigned long vm_start, unsigned long vm_end) { struct vm_area_struct *vma = find_vma(mm, vm_start); -- 2.39.5