test: cmd: mbr: Fix Smatch static checker warning
PATCH 1/1 test: cmd: mbr: Fix Smatch static checker warning
This patch fixes Smatch static checker warning:
test/cmd/mbr.c:243 mbr_test_run()
warn: sizeof(NUMBER)?Reported-by Dan Carpenter <[email protected]>
Signed-off-by Alexander Gendin <[email protected]>
--- test/cmd/mbr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
test/cmd/mbr.c +5 -1
@@ -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) +
Signature · 1 line
2.41.0
Quoted 6 lines · Alexander Gendin
This patch fixes Smatch static checker warning:
test/cmd/mbr.c:243 mbr_test_run() warn: sizeof(NUMBER)?Reported-by Dan Carpenter <[email protected]>Signed-off-by Alexander Gendin <[email protected]>
Reviewed-by Heinrich Schuchardt <[email protected]>
Quoted 21 lines
--- test/cmd/mbr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)test/cmd/mbr.c +5
-1@@ -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) +
Quoted 7 lines · Alexander Gendin
This patch fixes Smatch static checker warning:
test/cmd/mbr.c:243 mbr_test_run() warn: sizeof(NUMBER)?Reported-by Dan Carpenter <[email protected]>Signed-off-by Alexander Gendin <[email protected]>Reviewed-by Heinrich Schuchardt <[email protected]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom