]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/zfs_vnops.c
Remove unnecessary equality check
authorTobin Harding <me@tobin.cc>
Fri, 6 Oct 2017 02:33:44 +0000 (13:33 +1100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 6 Oct 2017 02:33:44 +0000 (19:33 -0700)
commitd95a59805f8f00046bb449fb12161e1f0caf65fb
treed9a41c964237a86d9c360e332e7067104456cf14
parenteea2e2413220b34a3da0911dee554df20bdd0c47
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
module/zfs/zfs_vnops.c