summaryrefslogtreecommitdiff
path: root/arch/linux/common/modules.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/linux/common/modules.h')
-rw-r--r--arch/linux/common/modules.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/arch/linux/common/modules.h b/arch/linux/common/modules.h
index 9b895ee8..6fbe13bd 100644
--- a/arch/linux/common/modules.h
+++ b/arch/linux/common/modules.h
@@ -26,12 +26,7 @@
static gboolean
remove_module_devices(gpointer key, gpointer value, gpointer data)
{
- if (!strncmp((gchar *) key, "MOD", 3)) {
- g_free((gchar *) key);
- g_free((GtkTreeIter *) value);
- return TRUE;
- }
- return FALSE;
+ return g_str_has_prefix(key, "MOD");
}
static void
@@ -42,9 +37,9 @@ scan_modules_do(void)
if (module_list) {
g_free(module_list);
- module_list = NULL;
}
-
+
+ module_list = NULL;
g_hash_table_foreach_remove(moreinfo, remove_module_devices, NULL);
lsmod = popen("/sbin/lsmod", "r");
@@ -103,8 +98,8 @@ scan_modules_do(void)
}
/* append this module to the list of modules */
- module_list = g_strdup_printf("%s$%s$%s=%s\n",
- module_list ? module_list : "",
+ module_list = h_strdup_cprintf("$%s$%s=%s\n",
+ module_list,
hashkey,
modname,
description ? description : "");
@@ -134,7 +129,7 @@ scan_modules_do(void)
if (deps && strlen(deps)) {
gchar **tmp = g_strsplit(deps, ",", 0);
- strmodule = g_strconcat(strmodule,
+ strmodule = h_strconcat(strmodule,
"\n[Dependencies]\n",
g_strjoinv("=\n", tmp),
"=\n", NULL);