aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSantosh Sivaraj <santosh@fossix.org>2021-03-28 05:43:51 +0530
committerVishal Verma <vishal.l.verma@intel.com>2021-05-18 13:47:59 -0600
commit561af4f919b3f1b3d1a213137f1d024420996d56 (patch)
treeca5992a4ab280c59d4cd2f03598ef5071e200b30
parenta2a6fda4d7e93044fca4c67870d2ff7e193d3cf1 (diff)
libndctl: Remove redundant checks and assignments
check_udev already checks for udev allocation failure, remove the redundant check. Link: https://lore.kernel.org/r/20210328001351.2245032-1-santosh@fossix.org Signed-off-by: Santosh Sivaraj <santosh@fossix.org> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
-rw-r--r--ndctl/lib/libndctl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
index bf0968cc..3a496ed0 100644
--- a/ndctl/lib/libndctl.c
+++ b/ndctl/lib/libndctl.c
@@ -323,12 +323,9 @@ NDCTL_EXPORT int ndctl_new(struct ndctl_ctx **ctx)
dbg(c, "timeout = %ld\n", tmo);
}
- if (udev) {
- c->udev = udev;
- c->udev_queue = udev_queue_new(udev);
- if (!c->udev_queue)
- err(c, "failed to retrieve udev queue\n");
- }
+ c->udev_queue = udev_queue_new(udev);
+ if (!c->udev_queue)
+ err(c, "failed to retrieve udev queue\n");
c->kmod_ctx = kmod_ctx;
c->daxctl_ctx = daxctl_ctx;