Staging: lustre: llite: Simplify error handling
authorTina Ruchandani <ruchandani.tina@gmail.com>
Sat, 25 Oct 2014 23:35:49 +0000 (16:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Oct 2014 10:55:00 +0000 (18:55 +0800)
This patch fixes the following checkpatch error:
ERROR: do not use assignment in if condition
2172: FILE: drivers/staging/lustre/lustre/llite/llite_lib.c:2172:
        if (!inode || !(sbi = ll_i2sbi(inode))) {

Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com>
Suggested-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/llite_lib.c

index 43ab250b087eda306446c303afcf6d83788a9e99..74cd4515ac504fd0dc30ba8abdaa6fa4da6a5406 100644 (file)
@@ -2169,7 +2169,13 @@ int ll_obd_statfs(struct inode *inode, void *arg)
        __u32 flags;
        int len = 0, rc;
 
-       if (!inode || !(sbi = ll_i2sbi(inode))) {
+       if (!inode) {
+               rc = -EINVAL;
+               goto out_statfs;
+       }
+
+       sbi = ll_i2sbi(inode);
+       if (!sbi) {
                rc = -EINVAL;
                goto out_statfs;
        }