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 <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Liang Zhen 2016-03-22 19:03:55 -04:00 committed by Greg Kroah-Hartman
parent 4e31dad14d
commit 77f7163609

View File

@ -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; }