Commit d5cc42ff authored by Thomas Haller's avatar Thomas Haller

core/trivial: rename NM_ASSERT_VALID_PATH_COMPONENT() helper

All defines from header files must have a NM prefix.
parent 1c5d8d0a
......@@ -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,
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment