From 53354d370ee3ea036f2d3602d268e42cdc968345 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Wed, 26 Oct 2022 05:05:30 +0900
Subject: [PATCH] sd-device: drop unused device_copy_properties()

Conflict:adapt context
Reference:https://github.com/systemd/systemd/commit/53354d370ee3ea036f2d3602d268e42cdc968345

---
 src/libsystemd/sd-device/device-private.c     | 26 -------------------
 src/libsystemd/sd-device/device-private.h     |  1 -
 .../sd-device/test-sd-device-monitor.c        | 10 -------
 3 files changed, 37 deletions(-)

diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c
index f6041c7165..cfe4af0fcc 100644
--- a/src/libsystemd/sd-device/device-private.c
+++ b/src/libsystemd/sd-device/device-private.c
@@ -737,32 +737,6 @@ int device_clone_with_db(sd_device *device, sd_device **ret) {
         return 0;
 }
 
-int device_copy_properties(sd_device *device_dst, sd_device *device_src) {
-        const char *property, *value;
-        int r;
-
-        assert(device_dst);
-        assert(device_src);
-
-        r = device_properties_prepare(device_src);
-        if (r < 0)
-                return r;
-
-        ORDERED_HASHMAP_FOREACH_KEY(value, property, device_src->properties_db) {
-                r = device_add_property_aux(device_dst, property, value, true);
-                if (r < 0)
-                        return r;
-        }
-
-        ORDERED_HASHMAP_FOREACH_KEY(value, property, device_src->properties) {
-                r = device_add_property_aux(device_dst, property, value, false);
-                if (r < 0)
-                        return r;
-        }
-
-        return 0;
-}
-
 void device_cleanup_tags(sd_device *device) {
         assert(device);
 
diff --git a/src/libsystemd/sd-device/device-private.h b/src/libsystemd/sd-device/device-private.h
index 90da7f4317..6e96cc264a 100644
--- a/src/libsystemd/sd-device/device-private.h
+++ b/src/libsystemd/sd-device/device-private.h
@@ -56,7 +56,6 @@ int device_get_properties_strv(sd_device *device, char ***ret);
 int device_rename(sd_device *device, const char *name);
 int device_shallow_clone(sd_device *device, sd_device **ret);
 int device_clone_with_db(sd_device *device, sd_device **ret);
-int device_copy_properties(sd_device *device_dst, sd_device *device_src);
 int device_new_from_synthetic_event(sd_device **new_device, const char *syspath, const char *action);
 
 int device_tag_index(sd_device *dev, sd_device *dev_old, bool add);
diff --git a/src/libsystemd/sd-device/test-sd-device-monitor.c b/src/libsystemd/sd-device/test-sd-device-monitor.c
index 66ca63600d..9e64ba01c6 100644
--- a/src/libsystemd/sd-device/test-sd-device-monitor.c
+++ b/src/libsystemd/sd-device/test-sd-device-monitor.c
@@ -293,15 +293,6 @@ static void test_sd_device_monitor_filter_remove(sd_device *device) {
         assert_se(sd_event_loop(sd_device_monitor_get_event(monitor_client)) == 100);
 }
 
-static void test_device_copy_properties(sd_device *device) {
-        _cleanup_(sd_device_unrefp) sd_device *copy = NULL;
-
-        assert_se(device_shallow_clone(device, &copy) >= 0);
-        assert_se(device_copy_properties(copy, device) >= 0);
-
-        test_send_receive_one(copy, false, false, false);
-}
-
 int main(int argc, char *argv[]) {
         _cleanup_(sd_device_unrefp) sd_device *loopback = NULL, *sda = NULL;
         int r;
@@ -333,7 +324,6 @@ int main(int argc, char *argv[]) {
         test_tag_filter(loopback);
         test_sysattr_filter(loopback, "ifindex");
         test_sd_device_monitor_filter_remove(loopback);
-        test_device_copy_properties(loopback);
 
         r = sd_device_new_from_subsystem_sysname(&sda, "block", "sda");
         if (r < 0) {
-- 
2.39.1

