anitazha / rpms / ndctl

Forked from rpms/ndctl 2 years ago
Clone

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

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