From: Dmitri Vorobiev <dmitri.vorobiev@gmail.com>
To: trivial@kernel.org, tigran@aivazian.fsnet.co.uk,
linux-fsdevel@vger.kernel.org
Subject: [PATCH v2 8/9] bfs: remove multiple assignments
Date: Sat, 26 Jan 2008 00:20:26 +0300 [thread overview]
Message-ID: <1201296027-6900-9-git-send-email-dmitri.vorobiev@gmail.com> (raw)
In-Reply-To: <1201296027-6900-1-git-send-email-dmitri.vorobiev@gmail.com>
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
next prev parent reply other threads:[~2008-01-25 21:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-25 21:20 [PATCH v2 0/9] bfs: assorted cleanups Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 1/9] bfs: remove a useless variable Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 2/9] bfs: coding style cleanup in fs/bfs/inode.c Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 3/9] bfs: coding style cleanup in fs/bfs/bfs.h Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 4/9] bfs: coding style cleanup in fs/bfs/dir.c Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 5/9] bfs: move function prototype to the proper header file Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 6/9] bfs: coding style cleanup in fs/bfs/file.c Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 7/9] bfs: coding style cleanup in include/linux/bfs_fs.h Dmitri Vorobiev
2008-01-25 21:20 ` Dmitri Vorobiev [this message]
2008-01-26 18:35 ` [PATCH v2 8/9] bfs: remove multiple assignments Tigran Aivazian
2008-01-26 21:32 ` Dmitri Vorobiev
2008-01-26 23:48 ` Dmitri Vorobiev
2008-01-28 7:02 ` Joel Schopp
2008-01-30 13:06 ` Al Viro
2008-01-30 13:36 ` Dmitri Vorobiev
2008-01-27 14:08 ` Adrian Bunk
2008-01-27 14:39 ` Dmitri Vorobiev
2008-01-25 21:20 ` [PATCH v2 9/9] bfs: use the proper header file for inclusion Dmitri Vorobiev
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=1201296027-6900-9-git-send-email-dmitri.vorobiev@gmail.com \
--to=dmitri.vorobiev@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=tigran@aivazian.fsnet.co.uk \
--cc=trivial@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).