From 77f716360939767016e2ceab17f8234d0cabc61b Mon Sep 17 00:00:00 2001 From: Liang Zhen Date: Tue, 22 Mar 2016 19:03:55 -0400 Subject: [PATCH] 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 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435 Reviewed-on: http://review.whamcloud.com/11313 Reviewed-by: Bobi Jam Reviewed-by: Johann Lombardi Reviewed-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lnet/libcfs/module.c | 13 +++++++------ 1 file 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; } -- 2.20.1