]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootspec: simplify find_default_boot_entry()
authorLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2019 16:51:15 +0000 (17:51 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 5 Mar 2019 15:50:58 +0000 (16:50 +0100)
If the only caller passes NULL for the two paths, let's remove the
parameter altogether.

src/shared/bootspec.c
src/shared/bootspec.h
src/systemctl/systemctl.c

index ae20b34a407226ca44839d7e921613adffab2daf..d5bd0ff75e17b766f6261288ebc7c93b80bcdf78 100644 (file)
@@ -1295,8 +1295,6 @@ found:
 }
 
 int find_default_boot_entry(
-                const char *esp_path,
-                const char *xbootldr_path,
                 BootConfig *config,
                 const BootEntry **e) {
 
@@ -1306,13 +1304,13 @@ int find_default_boot_entry(
         assert(config);
         assert(e);
 
-        r = find_esp_and_warn(esp_path, false, &esp_where, NULL, NULL, NULL, NULL);
+        r = find_esp_and_warn(NULL, false, &esp_where, NULL, NULL, NULL, NULL);
         if (r == -ENOKEY) /* find_esp_and_warn() doesn't warn about this case */
                 return log_error_errno(r, "Cannot find the ESP partition mount point.");
         if (r < 0) /* But it logs about all these cases, hence don't log here again */
                 return r;
 
-        r = find_xbootldr_and_warn(xbootldr_path, false, &xbootldr_where, NULL);
+        r = find_xbootldr_and_warn(NULL, false, &xbootldr_where, NULL);
         if (r < 0 && r != -ENOKEY)
                 return r;
 
index f1849025586c253b082049b3ad1ac43878effb4b..695e86d8f7baea1f4493594ba3714882da34d310 100644 (file)
@@ -50,4 +50,4 @@ static inline const char* boot_entry_title(const BootEntry *entry) {
 int find_esp_and_warn(const char *path, bool unprivileged_mode, char **ret_path, uint32_t *ret_part, uint64_t *ret_pstart, uint64_t *ret_psize, sd_id128_t *ret_uuid);
 int find_xbootldr_and_warn(const char *path, bool unprivileged_mode, char **ret_path,sd_id128_t *ret_uuid);
 
-int find_default_boot_entry(const char *esp_path, const char *xbootldr_path, BootConfig *config, const BootEntry **e);
+int find_default_boot_entry(BootConfig *config, const BootEntry **e);
index 0b31a4c9da85abed641b4b9e0cdb07ce99b14d5c..d88435f8e9769c3d98f141d9c11a99323ac86a82 100644 (file)
@@ -3535,7 +3535,7 @@ static int load_kexec_kernel(void) {
         if (access(KEXEC, X_OK) < 0)
                 return log_error_errno(errno, KEXEC" is not available: %m");
 
-        r = find_default_boot_entry(NULL, NULL, &config, &e);
+        r = find_default_boot_entry(&config, &e);
         if (r < 0)
                 return r;