]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: hexdump: fix misplaced return
authorSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Tue, 4 Dec 2018 20:30:08 +0000 (21:30 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 12 Dec 2018 17:14:21 +0000 (12:14 -0500)
One of the hexdump tests in test/lib/hexdump.c returns right at the
start of the function without testing anything.

Fix this by moving the 'return 0;' statement to the end of the function.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
test/lib/hexdump.c

index e8b3e566e0f6bc2102c1bb77736a59851586d2d9..567b57686a5ce0f5423eff18b56c5f1c1e9b4e56 100644 (file)
@@ -11,8 +11,6 @@
 
 static int lib_test_hex_to_bin(struct unit_test_state *uts)
 {
-       return 0;
-
        ut_asserteq(0x0, hex_to_bin('0'));
        ut_asserteq(0x1, hex_to_bin('1'));
        ut_asserteq(0x2, hex_to_bin('2'));
@@ -30,6 +28,8 @@ static int lib_test_hex_to_bin(struct unit_test_state *uts)
        ut_asserteq(0xe, hex_to_bin('e'));
        ut_asserteq(0xf, hex_to_bin('f'));
        ut_asserteq(-1, hex_to_bin('g'));
+
+       return 0;
 }
 
 DM_TEST(lib_test_hex_to_bin, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);