]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: cmd: mbr: Fix Smatch static checker warning
authorAlexander Gendin <agendin@matrox.com>
Sat, 3 Feb 2024 02:56:19 +0000 (02:56 +0000)
committerTom Rini <trini@konsulko.com>
Sat, 2 Mar 2024 17:25:20 +0000 (12:25 -0500)
This patch fixes Smatch static checker warning:
        test/cmd/mbr.c:243 mbr_test_run()
        warn: sizeof(NUMBER)?

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Alexander Gendin <agendin@matrox.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
test/cmd/mbr.c

index 46b78e706ca2a4e7e5feb28cacd13d54f4868108..235b363290e8f0df3e7a9ce07b57b62a9aba4e2c 100644 (file)
@@ -240,7 +240,11 @@ static int mbr_test_run(struct unit_test_state *uts)
        ut_assert(ofnode_valid(node));
        ut_assertok(lists_bind_fdt(gd->dm_root, node, &dev, NULL, false));
 
-       mbr_parts_max = sizeof('\0') + 2 +
+       /*
+        * 1 byte for null character
+        * 2 reserved bytes
+        */
+       mbr_parts_max = 1 + 2 +
                strlen(mbr_parts_header) +
                strlen(mbr_parts_p1) +
                strlen(mbr_parts_p2) +