[PATCH 06/13] test: dm: wdt: replace cyclic_run() by schedule()

Stefan Roese sr at denx.de
Tue Oct 22 13:12:13 CEST 2024


On 10/3/24 23:27, Rasmus Villemoes wrote:
> This is the last place outside of cyclic.c that references
> cyclic_run() directly. Replace by schedule(), so that cyclic_run() can
> be made private. This also better matches what I believe commit
> 29caf9305b6f ("cyclic: Use schedule() instead of WATCHDOG_RESET()")
> intended to do.
> 
> Signed-off-by: Rasmus Villemoes <ravi at prevas.dk>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   test/dm/wdt.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/test/dm/wdt.c b/test/dm/wdt.c
> index 1df2da23c6c..4d751b7e8cf 100644
> --- a/test/dm/wdt.c
> +++ b/test/dm/wdt.c
> @@ -3,7 +3,6 @@
>    * Copyright 2017 Google, Inc
>    */
>   
> -#include <cyclic.h>
>   #include <dm.h>
>   #include <time.h>
>   #include <wdt.h>
> @@ -14,6 +13,7 @@
>   #include <test/test.h>
>   #include <test/ut.h>
>   #include <linux/delay.h>
> +#include <u-boot/schedule.h>
>   #include <watchdog.h>
>   
>   /* Test that watchdog driver functions are called */
> @@ -131,7 +131,7 @@ static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts)
>   	/* Neither device should be "started", so watchdog_reset() should be a no-op. */
>   	reset_count = state->wdt.reset_count;
>   	val = sandbox_gpio_get_value(gpio, offset);
> -	cyclic_run();
> +	schedule();
>   	ut_asserteq(reset_count, state->wdt.reset_count);
>   	ut_asserteq(val, sandbox_gpio_get_value(gpio, offset));
>   
> @@ -141,19 +141,19 @@ static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts)
>   
>   	/* Make sure both devices have just been pinged. */
>   	timer_test_add_offset(100);
> -	cyclic_run();
> +	schedule();
>   	reset_count = state->wdt.reset_count;
>   	val = sandbox_gpio_get_value(gpio, offset);
>   
>   	/* The gpio watchdog should be pinged, the sandbox one not. */
>   	timer_test_add_offset(30);
> -	cyclic_run();
> +	schedule();
>   	ut_asserteq(reset_count, state->wdt.reset_count);
>   	ut_asserteq(!val, sandbox_gpio_get_value(gpio, offset));
>   
>   	/* After another ~30ms, both devices should get pinged. */
>   	timer_test_add_offset(30);
> -	cyclic_run();
> +	schedule();
>   	ut_asserteq(reset_count + 1, state->wdt.reset_count);
>   	ut_asserteq(val, sandbox_gpio_get_value(gpio, offset));
>   

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list