[PATCH] Fix DEFAULT_TIMEOUT_SEC

4 views
Skip to first unread message

Christian Storm

unread,
Nov 13, 2022, 5:21:37 AM11/13/22
to efibootg...@googlegroups.com, Christian Storm
From: Christian Storm <christi...@siemens.com>

DEFAULT_TIMEOUT_SEC in include/bootguard.h was unused
and the default timeout value of 30 was hard-coded in
env/env_api_fat.c. Introduce DEFAULT_TIMEOUT_SEC proper
in include/env_api.h and make use of it.

Signed-off-by: Christian Storm <christi...@siemens.com>
---
env/env_api_fat.c | 2 +-
include/bootguard.h | 2 --
include/env_api.h | 2 ++
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/env/env_api_fat.c b/env/env_api_fat.c
index a08100b..d588e7f 100644
--- a/env/env_api_fat.c
+++ b/env/env_api_fat.c
@@ -450,7 +450,7 @@ BGENV *bgenv_create_new(void)
env_new->data->revision = new_rev;
env_new->data->in_progress = 1;
/* set default watchdog timeout */
- env_new->data->watchdog_timeout_sec = 30;
+ env_new->data->watchdog_timeout_sec = DEFAULT_TIMEOUT_SEC;

return env_new;

diff --git a/include/bootguard.h b/include/bootguard.h
index 588b122..6a70187 100644
--- a/include/bootguard.h
+++ b/include/bootguard.h
@@ -31,8 +31,6 @@ typedef int BG_STATUS;
#define BG_CONFIG_ERROR BGERR(110)
#define BG_NOT_IMPLEMENTED BGERR(200)

-#define DEFAULT_TIMEOUT_SEC 60
-
extern EFI_HANDLE this_image;

typedef struct _BG_LOADER_PARAMS {
diff --git a/include/env_api.h b/include/env_api.h
index e6b58d4..b796682 100644
--- a/include/env_api.h
+++ b/include/env_api.h
@@ -41,6 +41,8 @@
}
#endif

+#define DEFAULT_TIMEOUT_SEC 30
+
extern bool bgenv_verbosity;

#define VERBOSE(o, ...) \
--
2.38.1

Jan Kiszka

unread,
Nov 15, 2022, 1:37:51 AM11/15/22
to Christian Storm, efibootg...@googlegroups.com
Thanks, applied.

Jan

--
Siemens AG, Technology
Competence Center Embedded Linux

Reply all
Reply to author
Forward
0 new messages