mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 18:11:00 +03:00
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 <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Chris Dunlop <chris@onthe.net.au> Signed-off-by: Tobin C. Harding <me@tobin.cc> Closes #6685 Close #6719
This commit is contained in:
parent
b97948276d
commit
80cc2f6111
@ -4562,7 +4562,7 @@ convoff(struct inode *ip, flock64_t *lckdat, int whence, offset_t offset)
|
|||||||
int error;
|
int error;
|
||||||
|
|
||||||
if ((lckdat->l_whence == 2) || (whence == 2)) {
|
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);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user