From 07a7a1c7eebfa9220093b6f1ec0def354a669249 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 28 Feb 2022 16:16:48 +0100 Subject: [PATCH 1/3] gitignore: Add plymouthd-fd-escrow to gitignore Add the new plymouthd-fd-escrow binary to gitignore. Signed-off-by: Hans de Goede --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cb9483a1..3e4797a1 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ plymouth-set-default-theme plymouth-log-viewer plymouth-upstart-bridge plymouthd +plymouthd-fd-escrow *.pc tags *.bck From da821831d69513998c92d09341cef314c1a36354 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 28 Feb 2022 16:17:53 +0100 Subject: [PATCH 2/3] ply-device-manager: Fix double-assignment of subsystem The subsystem variable is also initialized with udev_device_get_subsystem () a couple of lines lower. Remove the first initialization, so that udev_device_get_subsystem () does not get called unnecessary when the function exits early because of the action value. Signed-off-by: Hans de Goede --- src/libply-splash-core/ply-device-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c index aed7bac2..09fbb6ed 100644 --- a/src/libply-splash-core/ply-device-manager.c +++ b/src/libply-splash-core/ply-device-manager.c @@ -411,7 +411,7 @@ verify_add_or_change (ply_device_manager_t *manager, const char *device_path, struct udev_device *device) { - const char *subsystem = udev_device_get_subsystem (device); + const char *subsystem; if (strcmp (action, "add") && strcmp (action, "change")) return false; From 083763e9e5a3057d9b2e625b736e66ce3f109785 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 28 Feb 2022 16:20:43 +0100 Subject: [PATCH 3/3] ply-device-manager: Remove unnecessary subsystem != NULL check The ply-device-manager.c already assumes that the return value of udev_device_get_subsystem () is never NULL in many places, including in the condition of the "else if" just below the check which is being removed. Remove the one lonely check for it being NULL for consistency. Signed-off-by: Hans de Goede --- src/libply-splash-core/ply-device-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c index 09fbb6ed..bb548ef8 100644 --- a/src/libply-splash-core/ply-device-manager.c +++ b/src/libply-splash-core/ply-device-manager.c @@ -279,7 +279,7 @@ create_devices_for_udev_device (ply_device_manager_t *manager, subsystem = udev_device_get_subsystem (device); ply_trace ("device subsystem is %s", subsystem); - if (subsystem != NULL && strcmp (subsystem, SUBSYSTEM_DRM) == 0) { + if (strcmp (subsystem, SUBSYSTEM_DRM) == 0) { ply_trace ("found DRM device %s", device_path); renderer_type = PLY_RENDERER_TYPE_DRM; } else if (strcmp (subsystem, SUBSYSTEM_FRAME_BUFFER) == 0) {