anitazha / rpms / ndctl

Forked from rpms/ndctl 2 years ago
Clone

Blame SOURCES/0022-libndctl-Remove-redundant-checks-and-assignments.patch

e0018b
From 561af4f919b3f1b3d1a213137f1d024420996d56 Mon Sep 17 00:00:00 2001
e0018b
From: Santosh Sivaraj <santosh@fossix.org>
e0018b
Date: Sun, 28 Mar 2021 05:43:51 +0530
e0018b
Subject: [PATCH 022/217] libndctl: Remove redundant checks and assignments
e0018b
e0018b
check_udev already checks for udev allocation failure, remove the redundant
e0018b
check.
e0018b
e0018b
Link: https://lore.kernel.org/r/20210328001351.2245032-1-santosh@fossix.org
e0018b
Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
e0018b
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
e0018b
---
e0018b
 ndctl/lib/libndctl.c | 9 +++------
e0018b
 1 file changed, 3 insertions(+), 6 deletions(-)
e0018b
e0018b
diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
e0018b
index bf0968c..3a496ed 100644
e0018b
--- a/ndctl/lib/libndctl.c
e0018b
+++ b/ndctl/lib/libndctl.c
e0018b
@@ -323,12 +323,9 @@ NDCTL_EXPORT int ndctl_new(struct ndctl_ctx **ctx)
e0018b
 		dbg(c, "timeout = %ld\n", tmo);
e0018b
 	}
e0018b
 
e0018b
-	if (udev) {
e0018b
-		c->udev = udev;
e0018b
-		c->udev_queue = udev_queue_new(udev);
e0018b
-		if (!c->udev_queue)
e0018b
-			err(c, "failed to retrieve udev queue\n");
e0018b
-	}
e0018b
+	c->udev_queue = udev_queue_new(udev);
e0018b
+	if (!c->udev_queue)
e0018b
+		err(c, "failed to retrieve udev queue\n");
e0018b
 
e0018b
 	c->kmod_ctx = kmod_ctx;
e0018b
 	c->daxctl_ctx = daxctl_ctx;
e0018b
-- 
e0018b
2.27.0
e0018b