All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hexdump: Make test data really const
@ 2015-04-16 19:32 Geert Uytterhoeven
  2015-04-20 22:28 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2015-04-16 19:32 UTC (permalink / raw)
  To: Andrew Morton, Andy Shevchenko, Andi Kleen
  Cc: linux-kernel, Geert Uytterhoeven

lib/test-hexdump.c: In function ‘test_hexdump’:
lib/test-hexdump.c:74: warning: assignment discards qualifiers from pointer target type

Make all test data "const char * const" and "__initconst", and the
"result" variable "const char * const" to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 lib/test-hexdump.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/test-hexdump.c b/lib/test-hexdump.c
index 9846ff7428b3120f..5241df36eedf922b 100644
--- a/lib/test-hexdump.c
+++ b/lib/test-hexdump.c
@@ -25,19 +25,19 @@ static const char * const test_data_1_le[] __initconst = {
 	"4c", "d1", "19", "99", "43", "b1", "af", "0c",
 };
 
-static const char *test_data_2_le[] __initdata = {
+static const char * const test_data_2_le[] __initconst = {
 	"32be", "7bdb", "180a", "b293",
 	"ba70", "24c4", "837d", "9b34",
 	"9ca6", "ad31", "0f9c", "e9ac",
 	"d14c", "9919", "b143", "0caf",
 };
 
-static const char *test_data_4_le[] __initdata = {
+static const char * const test_data_4_le[] __initconst = {
 	"7bdb32be", "b293180a", "24c4ba70", "9b34837d",
 	"ad319ca6", "e9ac0f9c", "9919d14c", "0cafb143",
 };
 
-static const char *test_data_8_le[] __initdata = {
+static const char * const test_data_8_le[] __initconst = {
 	"b293180a7bdb32be", "9b34837d24c4ba70",
 	"e9ac0f9cad319ca6", "0cafb1439919d14c",
 };
@@ -48,7 +48,7 @@ static void __init test_hexdump(size_t len, int rowsize, int groupsize,
 	char test[32 * 3 + 2 + 32 + 1];
 	char real[32 * 3 + 2 + 32 + 1];
 	char *p;
-	const char **result;
+	const char * const *result;
 	size_t l = len;
 	int gs = groupsize, rs = rowsize;
 	unsigned int i;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hexdump: Make test data really const
  2015-04-16 19:32 [PATCH] hexdump: Make test data really const Geert Uytterhoeven
@ 2015-04-20 22:28 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2015-04-20 22:28 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Andy Shevchenko, Andi Kleen, linux-kernel

On Thu, 16 Apr 2015 21:32:09 +0200 Geert Uytterhoeven <geert@linux-m68k.org> wrote:

> lib/test-hexdump.c: In function ___test_hexdump___:
> lib/test-hexdump.c:74: warning: assignment discards qualifiers from pointer target type
> 
> Make all test data "const char * const" and "__initconst", and the
> "result" variable "const char * const" to fix this.

Linus has already fixed the warning with 17974c054db303.

I think what remains of your patch makes sense, but we don't actually
have a changelog which explains why we're doing it.

Please cook up a fresh patch when convenient?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-20 22:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-16 19:32 [PATCH] hexdump: Make test data really const Geert Uytterhoeven
2015-04-20 22:28 ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.