From d5cc42ff6f12abd82a0b703f83cd77963bcffde4 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 8 Mar 2016 17:35:41 +0100 Subject: [PATCH] core/trivial: rename NM_ASSERT_VALID_PATH_COMPONENT() helper All defines from header files must have a NM prefix. --- src/devices/adsl/nm-atm-manager.c | 2 +- src/devices/adsl/nm-device-adsl.c | 2 +- src/devices/nm-device-infiniband.c | 2 +- src/nm-core-utils.c | 6 +++--- src/nm-core-utils.h | 2 +- src/platform/nm-linux-platform.c | 6 +++--- src/platform/nm-platform.c | 8 ++++---- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/devices/adsl/nm-atm-manager.c b/src/devices/adsl/nm-atm-manager.c index a3fa4901f..670857521 100644 --- a/src/devices/adsl/nm-atm-manager.c +++ b/src/devices/adsl/nm-atm-manager.c @@ -117,7 +117,7 @@ adsl_add (NMAtmManager *self, GUdevDevice *udev_device) nm_log_dbg (LOGD_HW, "(%s): found ATM device", ifname); atm_index_path = g_strdup_printf ("/sys/class/atm/%s/atmindex", - ASSERT_VALID_PATH_COMPONENT (ifname)); + NM_ASSERT_VALID_PATH_COMPONENT (ifname)); atm_index = (int) nm_platform_sysctl_get_int_checked (NM_PLATFORM_GET, atm_index_path, 10, 0, G_MAXINT, diff --git a/src/devices/adsl/nm-device-adsl.c b/src/devices/adsl/nm-device-adsl.c index e7a91e0ae..86abaf845 100644 --- a/src/devices/adsl/nm-device-adsl.c +++ b/src/devices/adsl/nm-device-adsl.c @@ -535,7 +535,7 @@ carrier_update_cb (gpointer user_data) char *path; path = g_strdup_printf ("/sys/class/atm/%s/carrier", - ASSERT_VALID_PATH_COMPONENT (nm_device_get_iface (NM_DEVICE (self)))); + NM_ASSERT_VALID_PATH_COMPONENT (nm_device_get_iface (NM_DEVICE (self)))); carrier = (int) nm_platform_sysctl_get_int_checked (NM_PLATFORM_GET, path, 10, 0, 1, -1); g_free (path); diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c index 79bcb57c9..e899752d7 100644 --- a/src/devices/nm-device-infiniband.c +++ b/src/devices/nm-device-infiniband.c @@ -85,7 +85,7 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) transport_mode = nm_setting_infiniband_get_transport_mode (s_infiniband); mode_path = g_strdup_printf ("/sys/class/net/%s/mode", - ASSERT_VALID_PATH_COMPONENT (nm_device_get_iface (dev))); + NM_ASSERT_VALID_PATH_COMPONENT (nm_device_get_iface (dev))); if (!g_file_test (mode_path, G_FILE_TEST_EXISTS)) { g_free (mode_path); diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c index ca0762668..52db9ced8 100644 --- a/src/nm-core-utils.c +++ b/src/nm-core-utils.c @@ -2508,8 +2508,8 @@ _get_property_path (const char *ifname, static char path[sizeof (IPV6_PROPERTY_DIR) + IFNAMSIZ + 32]; int len; - ifname = ASSERT_VALID_PATH_COMPONENT (ifname); - property = ASSERT_VALID_PATH_COMPONENT (property); + ifname = NM_ASSERT_VALID_PATH_COMPONENT (ifname); + property = NM_ASSERT_VALID_PATH_COMPONENT (property); len = g_snprintf (path, sizeof (path), @@ -2574,7 +2574,7 @@ nm_utils_is_valid_path_component (const char *name) } const char * -ASSERT_VALID_PATH_COMPONENT (const char *name) +NM_ASSERT_VALID_PATH_COMPONENT (const char *name) { if (G_LIKELY (nm_utils_is_valid_path_component (name))) return name; diff --git a/src/nm-core-utils.h b/src/nm-core-utils.h index 81cc39d58..c51b02de8 100644 --- a/src/nm-core-utils.h +++ b/src/nm-core-utils.h @@ -340,7 +340,7 @@ gint32 nm_utils_get_monotonic_timestamp_s (void); gint64 nm_utils_monotonic_timestamp_as_boottime (gint64 timestamp, gint64 timestamp_ticks_per_ns); gboolean nm_utils_is_valid_path_component (const char *name); -const char *ASSERT_VALID_PATH_COMPONENT (const char *name); +const char *NM_ASSERT_VALID_PATH_COMPONENT (const char *name); const char *nm_utils_ip6_property_path (const char *ifname, const char *property); const char *nm_utils_ip4_property_path (const char *ifname, const char *property); diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 35a1c8cc3..14ce74d5a 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -4271,7 +4271,7 @@ link_get_physical_port_id (NMPlatform *platform, int ifindex) if (!ifname) return NULL; - ifname = ASSERT_VALID_PATH_COMPONENT (ifname); + ifname = NM_ASSERT_VALID_PATH_COMPONENT (ifname); path = g_strdup_printf ("/sys/class/net/%s/phys_port_id", ifname); id = sysctl_get (platform, path); @@ -4291,7 +4291,7 @@ link_get_dev_id (NMPlatform *platform, int ifindex) if (!ifname) return 0; - ifname = ASSERT_VALID_PATH_COMPONENT (ifname); + ifname = NM_ASSERT_VALID_PATH_COMPONENT (ifname); path = g_strdup_printf ("/sys/class/net/%s/dev_id", ifname); id = sysctl_get (platform, path); @@ -4967,7 +4967,7 @@ infiniband_partition_add (NMPlatform *platform, int parent, int p_key, const NMP ifname = g_strdup_printf ("%s.%04x", obj_parent->link.name, p_key); - path = g_strdup_printf ("/sys/class/net/%s/create_child", ASSERT_VALID_PATH_COMPONENT (obj_parent->link.name)); + path = g_strdup_printf ("/sys/class/net/%s/create_child", NM_ASSERT_VALID_PATH_COMPONENT (obj_parent->link.name)); id = g_strdup_printf ("0x%04x", p_key); if (!nm_platform_sysctl_set (platform, path, id)) return FALSE; diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 1d707adaf..06b6442c6 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -1627,9 +1627,9 @@ link_option_path (NMPlatform *self, int master, const char *category, const char return NULL; return g_strdup_printf ("/sys/class/net/%s/%s/%s", - ASSERT_VALID_PATH_COMPONENT (name), - ASSERT_VALID_PATH_COMPONENT (category), - ASSERT_VALID_PATH_COMPONENT (option)); + NM_ASSERT_VALID_PATH_COMPONENT (name), + NM_ASSERT_VALID_PATH_COMPONENT (category), + NM_ASSERT_VALID_PATH_COMPONENT (option)); } static gboolean @@ -1918,7 +1918,7 @@ nm_platform_link_infiniband_get_properties (NMPlatform *self, /* Could not get the link information via netlink. To support older kernels, * fallback to reading sysfs. */ - iface = ASSERT_VALID_PATH_COMPONENT (plink->name); + iface = NM_ASSERT_VALID_PATH_COMPONENT (plink->name); /* Fall back to reading sysfs */ path = g_strdup_printf ("/sys/class/net/%s/mode", iface);