mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 23/28] stat: checkpatch wanking
Date: Tue, 29 Nov 2011 18:14:21 -0800	[thread overview]
Message-ID: <5d748cf8232664cdad000479009db0ca89febd64.1322609673.git.joe@perches.com> (raw)
In-Reply-To: <cover.1322609672.git.joe@perches.com>

Now checkpatch clean.

$ ./scripts/checkpatch.pl -f --terse --nosummary fs/stat.c | \
  cut -f3- -d":" | sort | uniq -c
      3  ERROR: space required after that ',' (ctx:VxO)
      3  ERROR: space required after that ',' (ctx:VxV)
      3  ERROR: space required before that '&' (ctx:OxV)
      3  ERROR: trailing whitespace
      6  WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
      2  WARNING: line over 80 characters
      1  WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
      1  WARNING: Use #include <linux/unistd.h> instead of <asm/unistd.h>

Signed-off-by: Joe Perches <joe@perches.com>
---
 fs/stat.c |   29 ++++++++++++-----------------
 1 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/fs/stat.c b/fs/stat.c
index ff9be35..829d9e9 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -16,9 +16,8 @@
 #include <linux/security.h>
 #include <linux/syscalls.h>
 #include <linux/pagemap.h>
-
-#include <asm/uaccess.h>
-#include <asm/unistd.h>
+#include <linux/uaccess.h>
+#include <linux/unistd.h>
 
 void generic_fillattr(struct inode *inode, struct kstat *stat)
 {
@@ -36,7 +35,6 @@ void generic_fillattr(struct inode *inode, struct kstat *stat)
 	stat->blksize = (1 << inode->i_blkbits);
 	stat->blocks = inode->i_blocks;
 }
-
 EXPORT_SYMBOL(generic_fillattr);
 
 int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
@@ -54,7 +52,6 @@ int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
 	generic_fillattr(inode, stat);
 	return 0;
 }
-
 EXPORT_SYMBOL(vfs_getattr);
 
 int vfs_fstat(unsigned int fd, struct kstat *stat)
@@ -116,11 +113,12 @@ EXPORT_SYMBOL(vfs_lstat);
  * For backward compatibility?  Maybe this should be moved
  * into arch/i386 instead?
  */
-static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * statbuf)
+static int cp_old_stat(struct kstat *stat,
+		       struct __old_kernel_stat __user *statbuf)
 {
 	static int warncount = 5;
 	struct __old_kernel_stat tmp;
-	
+
 	if (warncount > 0) {
 		warncount--;
 		pr_warn("VFS: Warning: %s using old stat() call. Recompile your binary.\n",
@@ -145,12 +143,12 @@ static int cp_old_stat(struct kstat *stat, struct __old_kernel_stat __user * sta
 #if BITS_PER_LONG == 32
 	if (stat->size > MAX_NON_LFS)
 		return -EOVERFLOW;
-#endif	
+#endif
 	tmp.st_size = stat->size;
 	tmp.st_atime = stat->atime.tv_sec;
 	tmp.st_mtime = stat->mtime.tv_sec;
 	tmp.st_ctime = stat->ctime.tv_sec;
-	return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
+	return copy_to_user(statbuf, &tmp, sizeof(tmp)) ? -EFAULT : 0;
 }
 
 SYSCALL_DEFINE2(stat, const char __user *, filename,
@@ -179,7 +177,8 @@ SYSCALL_DEFINE2(lstat, const char __user *, filename,
 	return cp_old_stat(&stat, statbuf);
 }
 
-SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, statbuf)
+SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *,
+		statbuf)
 {
 	struct kstat stat;
 	int error = vfs_fstat(fd, &stat);
@@ -227,7 +226,7 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
 #if BITS_PER_LONG == 32
 	if (stat->size > MAX_NON_LFS)
 		return -EOVERFLOW;
-#endif	
+#endif
 	tmp.st_size = stat->size;
 	tmp.st_atime = stat->atime.tv_sec;
 	tmp.st_mtime = stat->mtime.tv_sec;
@@ -239,7 +238,7 @@ static int cp_new_stat(struct kstat *stat, struct stat __user *statbuf)
 #endif
 	tmp.st_blocks = stat->blocks;
 	tmp.st_blksize = stat->blksize;
-	return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
+	return copy_to_user(statbuf, &tmp, sizeof(tmp)) ? -EFAULT : 0;
 }
 
 SYSCALL_DEFINE2(newstat, const char __user *, filename,
@@ -363,7 +362,7 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf)
 	tmp.st_size = stat->size;
 	tmp.st_blocks = stat->blocks;
 	tmp.st_blksize = stat->blksize;
-	return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
+	return copy_to_user(statbuf, &tmp, sizeof(tmp)) ? -EFAULT : 0;
 }
 
 SYSCALL_DEFINE2(stat64, const char __user *, filename,
@@ -432,7 +431,6 @@ void inode_add_bytes(struct inode *inode, loff_t bytes)
 	__inode_add_bytes(inode, bytes);
 	spin_unlock(&inode->i_lock);
 }
-
 EXPORT_SYMBOL(inode_add_bytes);
 
 void inode_sub_bytes(struct inode *inode, loff_t bytes)
@@ -447,7 +445,6 @@ void inode_sub_bytes(struct inode *inode, loff_t bytes)
 	inode->i_bytes -= bytes;
 	spin_unlock(&inode->i_lock);
 }
-
 EXPORT_SYMBOL(inode_sub_bytes);
 
 loff_t inode_get_bytes(struct inode *inode)
@@ -459,7 +456,6 @@ loff_t inode_get_bytes(struct inode *inode)
 	spin_unlock(&inode->i_lock);
 	return ret;
 }
-
 EXPORT_SYMBOL(inode_get_bytes);
 
 void inode_set_bytes(struct inode *inode, loff_t bytes)
@@ -469,5 +465,4 @@ void inode_set_bytes(struct inode *inode, loff_t bytes)
 	inode->i_blocks = bytes >> 9;
 	inode->i_bytes = bytes & 511;
 }
-
 EXPORT_SYMBOL(inode_set_bytes);
-- 
1.7.6.405.gc1be0


  parent reply	other threads:[~2011-11-30  2:19 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30  2:13 [PATCH 00/28] fs: Logging style neatening and " Joe Perches
2011-11-30  2:13 ` [PATCH 01/28] buffer: Use pr_<level> Joe Perches
2011-11-30  2:14 ` [PATCH 02/28] mbcache: Use current logging styles Joe Perches
2011-11-30  2:14 ` [PATCH 03/28] bio: " Joe Perches
2011-11-30  2:14 ` [PATCH 04/28] libfs: " Joe Perches
2011-11-30  2:14 ` [PATCH 05/28] super: " Joe Perches
2011-11-30  2:14 ` [PATCH 06/28] exec: Use current logging style Joe Perches
2011-11-30  2:14 ` [PATCH 07/28] namespace: Use current logging styles Joe Perches
2011-11-30  2:14 ` [PATCH 08/28] block_dev: Use current logging style Joe Perches
2011-11-30  2:14 ` [PATCH 09/28] dcache: " Joe Perches
2011-11-30  2:14 ` [PATCH 10/28] fcntl: " Joe Perches
2011-11-30  2:14 ` [PATCH 11/28] file: " Joe Perches
2011-11-30  2:14 ` [PATCH 12/28] locks: " Joe Perches
2011-11-30  2:14 ` [PATCH 13/28] open: " Joe Perches
2011-11-30  2:14 ` [PATCH 14/28] stat: " Joe Perches
2011-11-30  2:14 ` [PATCH 15/28] exec: checkpatch wanking Joe Perches
2011-11-30  2:14 ` [PATCH 16/28] namespace: " Joe Perches
2011-11-30  2:22   ` Al Viro
2011-11-30  3:39     ` Joe Perches
2011-11-30  6:50       ` Al Viro
2011-11-30  8:34         ` Joe Perches
2011-11-30  2:14 ` [PATCH 17/28] block_dev: " Joe Perches
2011-11-30  2:14 ` [PATCH 18/28] dcache: " Joe Perches
2011-11-30  2:14 ` [PATCH 19/28] fcntl: " Joe Perches
2011-11-30  2:14 ` [PATCH 20/28] file: " Joe Perches
2011-11-30  2:14 ` [PATCH 21/28] locks: " Joe Perches
2011-11-30  2:14 ` [PATCH 22/28] open: " Joe Perches
2011-11-30  2:14 ` Joe Perches [this message]
2011-11-30  2:14 ` [PATCH 24/28] super: " Joe Perches
2011-11-30  2:14 ` [PATCH 25/28] libfs: " Joe Perches
2011-11-30  2:14 ` [PATCH 26/28] bio: " Joe Perches
2011-11-30  2:14 ` [PATCH 27/28] mbcache: " Joe Perches
2011-11-30  2:14 ` [PATCH 28/28] buffer: " Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d748cf8232664cdad000479009db0ca89febd64.1322609673.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®