From 4457e5c61d825a2673547e4cd60570a77fbcc3cd Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Thu, 3 Oct 2024 23:27:51 +0200 Subject: cyclic: introduce u-boot/schedule.h I noticed an "unnecessary" include of in global_data.h, in the sense that nothing in cyclic.h is needed in order to define 'struct global_data'. Well, it's not unnecessary, as it implicitly ensures that everybody gets a declaration of schedule(), and schedule() is (obviously) called all over the tree. Almost none of those places directly include , but for historical reasons, many do include (most schedule() instances are replacements of WATCHDOG_RESET()). However, very few TUs actually need the declarations of the cyclic_register() and struct cyclic_info, and they also don't really need anything from the watchdog.h header. So introduce a new header which just contains a declaration of schedule(), which can then be included from all the places that do call schedule(). I removed the direct reference to cyclic_run(), because we shouldn't have two public functions for doing roughly the same without being very explicit about when one should call one or the other. Testing of later patches that explicitly include when schedule() is used revealed a problem with host tool build on win32, which apparently picked up a host . To avoid that problem, put the new header in include/u-boot/ and hence make the include statements say . Signed-off-by: Rasmus Villemoes Reviewed-by: Simon Glass Reviewed-by: Stefan Roese --- common/cyclic.c | 1 + 1 file changed, 1 insertion(+) (limited to 'common') diff --git a/common/cyclic.c b/common/cyclic.c index ec38fad6775..38d815bec35 100644 --- a/common/cyclic.c +++ b/common/cyclic.c @@ -15,6 +15,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; -- cgit v1.2.3 From 307449de9058657eef544043013e8655468b3032 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Thu, 3 Oct 2024 23:27:56 +0200 Subject: cyclic: make cyclic_run static The only caller left is schedule(); everybody outside cyclic.c now calls or references schedule(). Signed-off-by: Rasmus Villemoes Reviewed-by: Simon Glass Reviewed-by: Stefan Roese --- common/cyclic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/cyclic.c b/common/cyclic.c index 38d815bec35..196797fd61e 100644 --- a/common/cyclic.c +++ b/common/cyclic.c @@ -45,7 +45,7 @@ void cyclic_unregister(struct cyclic_info *cyclic) hlist_del(&cyclic->list); } -void cyclic_run(void) +static void cyclic_run(void) { struct cyclic_info *cyclic; struct hlist_node *tmp; -- cgit v1.2.3