[PATCH v2 8/9] bfs: remove multiple assignments

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dmitri Vorobiev
Date: Friday, January 25, 2008 - 2:20 pm

The checkpatch.pl reported several warnings about multiple variable
assignments in the BFS driver sources. This trivial patch fixes these
warnings by giving each assignment its own line.

No functional changes introduced.

This patch was compile-tested by building the BFS driver both
as a module and as a part of the kernel proper.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
Acked-by: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
---
 fs/bfs/dir.c   |   13 +++++++++----
 fs/bfs/file.c  |    6 ++++--
 fs/bfs/inode.c |    7 +++++--
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c
index 2964505..94fed7a 100644
--- a/fs/bfs/dir.c
+++ b/fs/bfs/dir.c
@@ -104,7 +104,9 @@ static int bfs_create(struct inode *dir, struct dentry *dentry, int mode,
 	info->si_freei--;
 	inode->i_uid = current->fsuid;
 	inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid;
-	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
+	inode->i_mtime = CURRENT_TIME_SEC;
+	inode->i_atime = CURRENT_TIME_SEC;
+	inode->i_ctime = CURRENT_TIME_SEC;
 	inode->i_blocks = 0;
 	inode->i_op = &bfs_file_inops;
 	inode->i_fop = &bfs_file_operations;
@@ -200,7 +202,8 @@ static int bfs_unlink(struct inode *dir, struct dentry *dentry)
 	}
 	de->ino = 0;
 	mark_buffer_dirty(bh);
-	dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC;
+	dir->i_ctime = CURRENT_TIME_SEC;
+	dir->i_mtime = CURRENT_TIME_SEC;
 	mark_inode_dirty(dir);
 	inode->i_ctime = dir->i_ctime;
 	inode_dec_link_count(inode);
@@ -220,7 +223,8 @@ static int bfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 	struct bfs_dirent *old_de, *new_de;
 	int error = -ENOENT;
 
-	old_bh = new_bh = NULL;
+	old_bh = NULL;
+	new_bh = NULL;
 	old_inode = old_dentry->d_inode;
 	if (S_ISDIR(old_inode->i_mode))
 		return -EINVAL;
@@ -252,7 +256,8 @@ static int bfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 			goto end_rename;
 	}
 	old_de->ino = 0;
-	old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME_SEC;
+	old_dir->i_ctime = CURRENT_TIME_SEC;
+	old_dir->i_mtime = CURRENT_TIME_SEC;
 	mark_inode_dirty(old_dir);
 	if (new_inode) {
 		new_inode->i_ctime = CURRENT_TIME_SEC;
diff --git a/fs/bfs/file.c b/fs/bfs/file.c
index f32b2a2..ab2fa66 100644
--- a/fs/bfs/file.c
+++ b/fs/bfs/file.c
@@ -111,7 +111,8 @@ static int bfs_get_block(struct inode *inode, sector_t block,
 				create, (unsigned long)block, phys);
 		map_bh(bh_result, sb, phys);
 		info->si_freeb -= phys - bi->i_eblock;
-		info->si_lf_eblk = bi->i_eblock = phys;
+		info->si_lf_eblk = phys;
+		bi->i_eblock = phys;
 		mark_inode_dirty(inode);
 		mark_buffer_dirty(sbh);
 		err = 0;
@@ -140,7 +141,8 @@ static int bfs_get_block(struct inode *inode, sector_t block,
 			create, (unsigned long)block, phys);
 	bi->i_sblock = phys;
 	phys += block;
-	info->si_lf_eblk = bi->i_eblock = phys;
+	info->si_lf_eblk = phys;
+	bi->i_eblock = phys;
 
 	/*
 	 * This assumes nothing can write the inode back while we are here
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c
index 91d5686..7eefafb 100644
--- a/fs/bfs/inode.c
+++ b/fs/bfs/inode.c
@@ -157,7 +157,9 @@ static void bfs_delete_inode(struct inode *inode)
 	}
 
 	inode->i_size = 0;
-	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
+	inode->i_atime = CURRENT_TIME_SEC;
+	inode->i_mtime = CURRENT_TIME_SEC;
+	inode->i_ctime = CURRENT_TIME_SEC;
 	lock_kernel();
 	mark_inode_dirty(inode);
 
@@ -213,7 +215,8 @@ static int bfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 	buf->f_type = BFS_MAGIC;
 	buf->f_bsize = s->s_blocksize;
 	buf->f_blocks = info->si_blocks;
-	buf->f_bfree = buf->f_bavail = info->si_freeb;
+	buf->f_bfree = info->si_freeb;
+	buf->f_bavail = info->si_freeb;
 	buf->f_files = info->si_lasti + 1 - BFS_ROOT_INO;
 	buf->f_ffree = info->si_freei;
 	buf->f_fsid.val[0] = (u32)id;
-- 
1.5.3

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v2 0/9] bfs: assorted cleanups, Dmitri Vorobiev, (Fri Jan 25, 2:20 pm)
[PATCH v2 1/9] bfs: remove a useless variable, Dmitri Vorobiev, (Fri Jan 25, 2:20 pm)
[PATCH v2 2/9] bfs: coding style cleanup in fs/bfs/inode.c, Dmitri Vorobiev, (Fri Jan 25, 2:20 pm)
[PATCH v2 3/9] bfs: coding style cleanup in fs/bfs/bfs.h, Dmitri Vorobiev, (Fri Jan 25, 2:20 pm)
[PATCH v2 4/9] bfs: coding style cleanup in fs/bfs/dir.c, Dmitri Vorobiev, (Fri Jan 25, 2:20 pm)
[PATCH v2 6/9] bfs: coding style cleanup in fs/bfs/file.c, Dmitri Vorobiev, (Fri Jan 25, 2:20 pm)
[PATCH v2 8/9] bfs: remove multiple assignments, Dmitri Vorobiev, (Fri Jan 25, 2:20 pm)
[PATCH v2 9/9] bfs: use the proper header file for inclusion, Dmitri Vorobiev, (Fri Jan 25, 2:20 pm)
Re: [PATCH v2 8/9] bfs: remove multiple assignments, Tigran Aivazian, (Sat Jan 26, 11:35 am)
Re: [PATCH v2 8/9] bfs: remove multiple assignments, Dmitri Vorobiev, (Sat Jan 26, 2:32 pm)
Re: [PATCH v2 8/9] bfs: remove multiple assignments, Dmitri Vorobiev, (Sat Jan 26, 4:48 pm)
Re: [PATCH v2 8/9] bfs: remove multiple assignments, Adrian Bunk, (Sun Jan 27, 7:08 am)
Re: [PATCH v2 8/9] bfs: remove multiple assignments, Dmitri Vorobiev, (Sun Jan 27, 7:39 am)
Re: [PATCH v2 8/9] bfs: remove multiple assignments, Joel Schopp, (Mon Jan 28, 12:02 am)
Re: [PATCH v2 8/9] bfs: remove multiple assignments, Dmitri Vorobiev, (Wed Jan 30, 6:36 am)