]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
staging: lustre: libcfs: invert test condition for libcfs_ioctl
authorLiang Zhen <liang.zhen@intel.com>
Tue, 22 Mar 2016 23:03:55 +0000 (19:03 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
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>
drivers/staging/lustre/lnet/libcfs/module.c

index cce6ce35bd8085012f3d28914af713aa81728171..97fc905ad78ad0ff9fed1454cff9ec1cf44ce827 100644 (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; }