aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Zhen <[email protected]>2016-03-22 19:03:55 -0400
committerGreg Kroah-Hartman <[email protected]>2016-03-28 07:30:36 -0700
commit77f716360939767016e2ceab17f8234d0cabc61b (patch)
treea7a429d972a28287ecd32b33c640a7456abe30a0
parent4e31dad14dfec5746bdaa593db0cf0d8a6736b1c (diff)
staging: lustre: libcfs: invert test condition for libcfs_ioctl
Invert the test of error returned by the handle_ioctl pointer. This reduces the code by one indentation level. Signed-off-by: Liang Zhen <[email protected]> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435 Reviewed-on: http://review.whamcloud.com/11313 Reviewed-by: Bobi Jam <[email protected]> Reviewed-by: Johann Lombardi <[email protected]> Reviewed-by: Oleg Drokin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/lustre/lnet/libcfs/module.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/staging/lustre/lnet/libcfs/module.c b/drivers/staging/lustre/lnet/libcfs/module.c
index cce6ce35bd80..97fc905ad78a 100644
--- a/drivers/staging/lustre/lnet/libcfs/module.c
+++ b/drivers/staging/lustre/lnet/libcfs/module.c
@@ -165,12 +165,13 @@ static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd,
down_read(&ioctl_list_sem);
list_for_each_entry(hand, &ioctl_list, item) {
err = hand->handle_ioctl(cmd, hdr);
- if (err != -EINVAL) {
- if (err == 0)
- err = libcfs_ioctl_popdata(arg,
- hdr, hdr->ioc_len);
- break;
- }
+ if (err == -EINVAL)
+ continue;
+
+ if (!err)
+ err = libcfs_ioctl_popdata(arg, hdr,
+ hdr->ioc_len);
+ break;
}
up_read(&ioctl_list_sem);
break; }