Skip to content

Commit 01eda2e

Browse files
Alexey Dobriyantorvalds
Alexey Dobriyan
authored andcommitted
kstrtox: fix compile warnings in test
Fix the following warnings: CC [M] lib/test-kstrtox.o lib/test-kstrtox.c: In function 'test_kstrtou64_ok': lib/test-kstrtox.c:318: warning: this decimal constant is unsigned only in ISO C90 ... Signed-off-by: Alexey Dobriyan <[email protected]> Reported-by: Geert Uytterhoeven <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 592ce31 commit 01eda2e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

lib/test-kstrtox.c

+16-16
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,12 @@ static void __init test_kstrtou64_ok(void)
315315
{"65537", 10, 65537},
316316
{"2147483646", 10, 2147483646},
317317
{"2147483647", 10, 2147483647},
318-
{"2147483648", 10, 2147483648},
319-
{"2147483649", 10, 2147483649},
320-
{"4294967294", 10, 4294967294},
321-
{"4294967295", 10, 4294967295},
322-
{"4294967296", 10, 4294967296},
323-
{"4294967297", 10, 4294967297},
318+
{"2147483648", 10, 2147483648ULL},
319+
{"2147483649", 10, 2147483649ULL},
320+
{"4294967294", 10, 4294967294ULL},
321+
{"4294967295", 10, 4294967295ULL},
322+
{"4294967296", 10, 4294967296ULL},
323+
{"4294967297", 10, 4294967297ULL},
324324
{"9223372036854775806", 10, 9223372036854775806ULL},
325325
{"9223372036854775807", 10, 9223372036854775807ULL},
326326
{"9223372036854775808", 10, 9223372036854775808ULL},
@@ -369,12 +369,12 @@ static void __init test_kstrtos64_ok(void)
369369
{"65537", 10, 65537},
370370
{"2147483646", 10, 2147483646},
371371
{"2147483647", 10, 2147483647},
372-
{"2147483648", 10, 2147483648},
373-
{"2147483649", 10, 2147483649},
374-
{"4294967294", 10, 4294967294},
375-
{"4294967295", 10, 4294967295},
376-
{"4294967296", 10, 4294967296},
377-
{"4294967297", 10, 4294967297},
372+
{"2147483648", 10, 2147483648LL},
373+
{"2147483649", 10, 2147483649LL},
374+
{"4294967294", 10, 4294967294LL},
375+
{"4294967295", 10, 4294967295LL},
376+
{"4294967296", 10, 4294967296LL},
377+
{"4294967297", 10, 4294967297LL},
378378
{"9223372036854775806", 10, 9223372036854775806LL},
379379
{"9223372036854775807", 10, 9223372036854775807LL},
380380
};
@@ -418,10 +418,10 @@ static void __init test_kstrtou32_ok(void)
418418
{"65537", 10, 65537},
419419
{"2147483646", 10, 2147483646},
420420
{"2147483647", 10, 2147483647},
421-
{"2147483648", 10, 2147483648},
422-
{"2147483649", 10, 2147483649},
423-
{"4294967294", 10, 4294967294},
424-
{"4294967295", 10, 4294967295},
421+
{"2147483648", 10, 2147483648U},
422+
{"2147483649", 10, 2147483649U},
423+
{"4294967294", 10, 4294967294U},
424+
{"4294967295", 10, 4294967295U},
425425
};
426426
TEST_OK(kstrtou32, u32, "%u", test_u32_ok);
427427
}

0 commit comments

Comments
 (0)