[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH 2/2] Remove needless checks on ParametersKey validity



It used to be the case that XENBUS would tolerate a lack of Parameters key
in its Service key but that has not been true for some time, so remove
validity checks that are no longer needed.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 src/xenbus/bus.c     | 15 ++++++---------
 src/xenbus/fdo.c     | 12 ++++--------
 src/xenfilt/driver.c |  3 ---
 3 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/src/xenbus/bus.c b/src/xenbus/bus.c
index af95422..bf0bec7 100644
--- a/src/xenbus/bus.c
+++ b/src/xenbus/bus.c
@@ -190,6 +190,7 @@ BusInitialize(
 {
     PXENBUS_BUS_CONTEXT         Context;
     HANDLE                      ParametersKey;
+    ULONG                       InterceptDmaAdapter;
     NTSTATUS                    status;
 
     Trace("====>\n");
@@ -206,15 +207,11 @@ BusInitialize(
 
     Context->InterceptDmaAdapter = 0;
 
-    if (ParametersKey != NULL) {
-        ULONG   InterceptDmaAdapter;
-
-        status = RegistryQueryDwordValue(ParametersKey,
-                                         "InterceptDmaAdapter",
-                                         &InterceptDmaAdapter);
-        if (NT_SUCCESS(status))
-            Context->InterceptDmaAdapter = InterceptDmaAdapter;
-    }
+    status = RegistryQueryDwordValue(ParametersKey,
+                                     "InterceptDmaAdapter",
+                                     &InterceptDmaAdapter);
+    if (NT_SUCCESS(status))
+        Context->InterceptDmaAdapter = InterceptDmaAdapter;
 
     Interface->Size = sizeof (BUS_INTERFACE_STANDARD);
     Interface->Version = 1;
diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 7c6f5cd..59442bd 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -971,15 +971,11 @@ FdoScan(
             StoreClasses = NULL;
         }
 
-        if (ParametersKey != NULL) {
-            status = RegistryQuerySzValue(ParametersKey,
-                                          "SyntheticClasses",
-                                          &SyntheticClasses);
-            if (!NT_SUCCESS(status))
-                SyntheticClasses = NULL;
-        } else {
+        status = RegistryQuerySzValue(ParametersKey,
+                                      "SyntheticClasses",
+                                      &SyntheticClasses);
+        if (!NT_SUCCESS(status))
             SyntheticClasses = NULL;
-        }
 
         Classes = FdoCombineAnsi(StoreClasses, SyntheticClasses);
 
diff --git a/src/xenfilt/driver.c b/src/xenfilt/driver.c
index 86c6800..36a761c 100644
--- a/src/xenfilt/driver.c
+++ b/src/xenfilt/driver.c
@@ -486,8 +486,6 @@ DriverAddDevice(
     ASSERT3P(DriverObject, ==, __DriverGetDriverObject());
 
     ParametersKey = __DriverGetParametersKey();
-    if (ParametersKey == NULL)
-        goto done;
 
     status = DriverQueryId(PhysicalDeviceObject, BusQueryDeviceID, &DeviceID);
     if (!NT_SUCCESS(status))
@@ -522,7 +520,6 @@ DriverAddDevice(
     ExFreePool(InstanceID);
     ExFreePool(DeviceID);
 
-done:
     return STATUS_SUCCESS;
 
 fail4:
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.