Whamcloud - gitweb
LU-6502 lnet: remove unnecessary NULL check 79/15779/2
authorAmir Shehata <amir.shehata@intel.com>
Tue, 28 Jul 2015 20:29:18 +0000 (13:29 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 3 Aug 2015 01:52:50 +0000 (01:52 +0000)
In LNetCtl():IOC_LIBCFS_GET_NET there is a check for config == NULL
This is not necessary as it'll never be NULL.  That's ensured before
the call to LNetCtl.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Change-Id: Ib4d1ca5ca4a342f134e3102bcaf167e60f978b5f
Reviewed-on: http://review.whamcloud.com/15779
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/lnet/api-ni.c

index 2f7bbf3..7f6dd56 100644 (file)
@@ -1946,7 +1946,7 @@ LNetCtl(unsigned int cmd, void *arg)
 
                net_config = (struct lnet_ioctl_net_config *)
                        config->cfg_bulk;
 
                net_config = (struct lnet_ioctl_net_config *)
                        config->cfg_bulk;
-               if (config == NULL || net_config == NULL)
+               if (net_config == NULL)
                        return -1;
 
                return lnet_get_net_config(config->cfg_count,
                        return -1;
 
                return lnet_get_net_config(config->cfg_count,