Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757927AbdHYR74 (ORCPT ); Fri, 25 Aug 2017 13:59:56 -0400 Received: from mga05.intel.com ([192.55.52.43]:16570 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757682AbdHYR7x (ORCPT ); Fri, 25 Aug 2017 13:59:53 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,426,1498546800"; d="scan'208";a="894111182" Message-ID: <1503683627.25945.114.camel@linux.intel.com> Subject: Re: [PATCH] x86/platform/intel-mid: make several arrays static, makes code smaller From: Andy Shevchenko To: Lukas Wunner , Colin King Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, Bjorn Helgaas , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 25 Aug 2017 20:53:47 +0300 In-Reply-To: <20170825175104.GA19150@wunner.de> References: <20170825163206.23250-1-colin.king@canonical.com> <20170825175104.GA19150@wunner.de> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1076 Lines: 29 On Fri, 2017-08-25 at 19:51 +0200, Lukas Wunner wrote: > On Fri, Aug 25, 2017 at 05:32:06PM +0100, Colin King wrote: > > --- a/arch/x86/platform/intel-mid/pwr.c > > +++ b/arch/x86/platform/intel-mid/pwr.c > > @@ -444,7 +444,7 @@ static int mid_set_initial_state(struct mid_pwr > > *pwr, const u32 *states) > >  static int pnw_set_initial_state(struct mid_pwr *pwr) > >  { > >   /* On Penwell SRAM must stay powered on */ > > - const u32 states[] = { > > + static const u32 states[] = { > >   0xf00fffff, /* PM_SSC(0) */ > >   0xffffffff, /* PM_SSC(1) */ > >   0xffffffff, /* PM_SSC(2) */ > > That's a known gcc bug: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68725 > > There are hundreds of constant compound literals that are generated > on the stack rather than stored in rodata, do you intend to file > patches for all of them?  Adding static everywhere is just a > workaround that bloats the code.  Fixing the root cause in gcc would > make more sense. That is a good point. -- Andy Shevchenko Intel Finland Oy