diff options
author | Tobin Harding <[email protected]> | 2017-10-06 13:33:44 +1100 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2017-10-16 10:57:55 -0700 |
commit | 80cc2f6111d4300d5293f7d95d4b0c77d9df8bd9 (patch) | |
tree | 2308f5749dc84bb691b6328ad4a8e6436048c294 /module/zfs/zfs_vnops.c | |
parent | b97948276d86343e3f4a9aa1232af9e02106ceeb (diff) |
Remove unnecessary equality check
Currently `if` statement includes an assignment (from a function return
value) and a equality check. The parenthesis are in the incorrect place,
currently the code clobbers the function return value because of this.
We can fix this by simplifying the `if` statement.
`if (foo != 0)`
can be more succinctly expressed as
`if (foo)`
Remove the equality check, add parenthesis to correct the statement.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Chris Dunlop <[email protected]>
Signed-off-by: Tobin C. Harding <[email protected]>
Closes #6685
Close #6719
Diffstat (limited to 'module/zfs/zfs_vnops.c')
-rw-r--r-- | module/zfs/zfs_vnops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 259bfb309..a88f2482e 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -4562,7 +4562,7 @@ convoff(struct inode *ip, flock64_t *lckdat, int whence, offset_t offset) int error; if ((lckdat->l_whence == 2) || (whence == 2)) { - if ((error = zfs_getattr(ip, &vap, 0, CRED()) != 0)) + if ((error = zfs_getattr(ip, &vap, 0, CRED()))) return (error); } |