lib/test-kstrtox.c: mark const init data with __initconst instead of __initdata
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 29 May 2012 22:07:31 +0000 (15:07 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 May 2012 23:22:32 +0000 (16:22 -0700)
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>
lib/test-kstrtox.c

index d55769d63cb8b3efb8182a0f58a73ed496768b21..bea3f3fa3f02a920fb92b9293c0adf06d72a52a6 100644 (file)
@@ -11,7 +11,7 @@ struct test_fail {
 };
 
 #define DEFINE_TEST_FAIL(test) \
-       const struct test_fail test[] __initdata
+       const struct test_fail test[] __initconst
 
 #define DECLARE_TEST_OK(type, test_type)       \
        test_type {                             \
@@ -21,7 +21,7 @@ struct test_fail {
        }
 
 #define DEFINE_TEST_OK(type, test)     \
-       const type test[] __initdata
+       const type test[] __initconst
 
 #define TEST_FAIL(fn, type, fmt, test)                                 \
 {                                                                      \