linux: list: add a function to count list nodes

Add a function to count the nodes of a list.

Taken from linux 6.11-rc1 tag commit 8400291e289e.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
1 file changed