]> git.baikalelectronics.ru Git - uboot.git/commit
cyclic: drop redundant cyclic_ready flag
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Fri, 28 Oct 2022 11:50:51 +0000 (13:50 +0200)
committerStefan Roese <sr@denx.de>
Wed, 2 Nov 2022 07:41:42 +0000 (08:41 +0100)
commit72c14516f39e088dafb1086e69db1d4b1bb1cb8f
tree6be338c661d689c9cb1b7e64dd046b283785a0e0
parentbe89253b260a80fc3d13544faa9799b6a6259abd
cyclic: drop redundant cyclic_ready flag

We're already relying on gd->cyclic being NULL before cyclic_init() is
called - i.e., we're relying on all of gd being zeroed before entering
any C code. And when we do populate gd->cyclic, its ->cyclic_ready
member is automatically set to true. So we can actually just rely on
testing gd->cyclic itself.

The only wrinkle is that cyclic_uninit() actually did set
->cyclic_ready to false. However, since it doesn't free gd->cyclic,
the cyclic infrastructure is actually still ready (i.e., the list_head
is properly initialized as an empty list).

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Stefan Roese <sr@denx.de>
Tested-by: Tim Harvey <tharvey@gateworks.com> # imx8mm-venice-*
common/cyclic.c
include/cyclic.h