Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib/test-kstrtox.c: mark const init data with __initconst instead of __initdata

As long as there is no other non-const variable marked __initdata in the
same compilation unit it doesn't hurt. If there were one however
compilation would fail with

error: $variablename causes a section type conflict

because a section containing const variables is marked read only and so
cannot contain non-const variables.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Uwe Kleine-König and committed by
Linus Torvalds
26d7b99b 17a801f4

+2 -2
+2 -2
lib/test-kstrtox.c
··· 11 11 }; 12 12 13 13 #define DEFINE_TEST_FAIL(test) \ 14 - const struct test_fail test[] __initdata 14 + const struct test_fail test[] __initconst 15 15 16 16 #define DECLARE_TEST_OK(type, test_type) \ 17 17 test_type { \ ··· 21 21 } 22 22 23 23 #define DEFINE_TEST_OK(type, test) \ 24 - const type test[] __initdata 24 + const type test[] __initconst 25 25 26 26 #define TEST_FAIL(fn, type, fmt, test) \ 27 27 { \