From: Andrew Goodbody Date: Mon, 6 Oct 2025 10:54:56 +0000 (+0100) Subject: test: Remove not needed null check X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aebf3a98bffa80c3e8f38f3a768bcd78ccbf401a;p=pandora-u-boot.git test: Remove not needed null check In ut_report() there is a null check for stats but stats was already dereferenced on the line before and is again dereferenced later in the same function. Also the two places where ut_report() is called from will have initialised the parameter so there is no chance that stats will be null. So to prevent static analysis complaining of a use before check just remove the check. This issue was found by Smatch. Signed-off-by: Andrew Goodbody --- diff --git a/test/test-main.c b/test/test-main.c index cabc736a524..3254325e8b1 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -687,7 +687,7 @@ void ut_report(struct ut_stats *stats, int run_count) else printf("Tests"); printf(" run: %d, ", stats->test_count); - if (stats && stats->test_count) { + if (stats->test_count) { ulong dur = stats->duration_ms; printf("%ld ms, average: %ld ms, ", dur,