]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/hwdb-util: drop "variable" with a single use
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 20 Feb 2023 13:19:41 +0000 (14:19 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 20 Feb 2023 14:27:30 +0000 (15:27 +0100)
In 6a34639e76b8b59233a97533b13836d5a44e8d4a arg_hwdb_bin_dir was replaced by
default_hwdb_bin_dir, which is constant. Generally we'd use a #define instead,
but since there's just one use, let's just avoid the indirection altogether.

src/shared/hwdb-util.c

index 0ff686d24b65a478f00bcb37d1d33e8e33e3536e..45910a36e39fb5ac12b6a467bfdf2f0d8c748306 100644 (file)
@@ -21,8 +21,7 @@
 #include "strv.h"
 #include "tmpfile-util.h"
 
-static const char *default_hwdb_bin_dir = "/etc/udev";
-static const char * const conf_file_dirs[] = {
+static const char* const conf_file_dirs[] = {
         "/etc/udev/hwdb.d",
         UDEVLIBEXECDIR "/hwdb.d",
         NULL
@@ -634,7 +633,7 @@ int hwdb_update(const char *root, const char *hwdb_bin_dir, bool strict, bool co
         log_debug("strings dedup'ed: %8zu bytes (%8zu)",
                   trie->strings->dedup_len, trie->strings->dedup_count);
 
-        hwdb_bin = path_join(root, hwdb_bin_dir ?: default_hwdb_bin_dir, "hwdb.bin");
+        hwdb_bin = path_join(root, hwdb_bin_dir ?: "/etc/udev", "hwdb.bin");
         if (!hwdb_bin)
                 return -ENOMEM;