From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754900AbbDHXwl (ORCPT ); Wed, 8 Apr 2015 19:52:41 -0400 Received: from one.firstfloor.org ([193.170.194.197]:40152 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751431AbbDHXwk (ORCPT ); Wed, 8 Apr 2015 19:52:40 -0400 Date: Thu, 9 Apr 2015 01:52:39 +0200 From: Andi Kleen To: Andrew Morton Cc: Andi Kleen , linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 2/2] test-hexdump.c: Fix initconst confusion Message-ID: <20150408235239.GU2366@two.firstfloor.org> References: <1428498405-7019-1-git-send-email-andi@firstfloor.org> <1428498405-7019-2-git-send-email-andi@firstfloor.org> <20150408153554.65c87de78f1c2289483f67e8@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150408153554.65c87de78f1c2289483f67e8@linux-foundation.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 08, 2015 at 03:35:54PM -0700, Andrew Morton wrote: > > > > --- a/lib/test-hexdump.c > > +++ b/lib/test-hexdump.c > > @@ -18,26 +18,26 @@ static const unsigned char data_b[] = { > > > > static const unsigned char data_a[] = ".2.{....p..$}.4...1.....L...C..."; > > > > -static const char *test_data_1_le[] __initconst = { > > +static const char * const test_data_1_le[] __initconst = { > > const char * const __initconst This one didn't cause any warnings elsewhere. > > > "be", "32", "db", "7b", "0a", "18", "93", "b2", > > "70", "ba", "c4", "24", "7d", "83", "34", "9b", > > "a6", "9c", "31", "ad", "9c", "0f", "ac", "e9", > > "4c", "d1", "19", "99", "43", "b1", "af", "0c", > > }; > > > > +static const char *test_data_2_le[] __initdata = { > > +static const char *test_data_4_le[] __initdata = { > > +static const char *test_data_8_le[] __initdata = { > > const char * __initdata > > Why is test_data_1_le[] different? > > Can we make them all "const char * const __initconst"? That would make > checkpatch happy ;) I tried it, but it would have needed a lot more changes to shut up warnings later in the code. This was the least intrusive. checkpatch is a bit stupid about this, but then C declarations are difficult to parse... -Andi -- ak@linux.intel.com -- Speaking for myself only.