chiark / gitweb /
[PATCH] trivial namedev cleanup
[elogind.git] / namedev_parse.c
index 981daa7b3b1d3e5e6a173c2e75e8b3d308d37ee3..eabd9c98bb1957f089af68b14e958cf7d22fd009 100644 (file)
@@ -171,6 +171,18 @@ static int namedev_parse(const char *filename, void *data)
                        if (retval)
                                break;
 
                        if (retval)
                                break;
 
+                       if (strcasecmp(temp2, FIELD_KERNEL) == 0) {
+                               strfieldcpy(dev.kernel, temp3);
+                               valid = 1;
+                               continue;
+                       }
+
+                       if (strcasecmp(temp2, FIELD_SUBSYSTEM) == 0) {
+                               strfieldcpy(dev.subsystem, temp3);
+                               valid = 1;
+                               continue;
+                       }
+
                        if (strcasecmp(temp2, FIELD_BUS) == 0) {
                                strfieldcpy(dev.bus, temp3);
                                valid = 1;
                        if (strcasecmp(temp2, FIELD_BUS) == 0) {
                                strfieldcpy(dev.bus, temp3);
                                valid = 1;
@@ -215,18 +227,6 @@ static int namedev_parse(const char *filename, void *data)
                                continue;
                        }
 
                                continue;
                        }
 
-                       if (strcasecmp(temp2, FIELD_KERNEL) == 0) {
-                               strfieldcpy(dev.kernel, temp3);
-                               valid = 1;
-                               continue;
-                       }
-
-                       if (strcasecmp(temp2, FIELD_SUBSYSTEM) == 0) {
-                               strfieldcpy(dev.subsystem, temp3);
-                               valid = 1;
-                               continue;
-                       }
-
                        if (strcasecmp(temp2, FIELD_DRIVER) == 0) {
                                strfieldcpy(dev.driver, temp3);
                                valid = 1;
                        if (strcasecmp(temp2, FIELD_DRIVER) == 0) {
                                strfieldcpy(dev.driver, temp3);
                                valid = 1;