From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030221AbXCLOnX (ORCPT ); Mon, 12 Mar 2007 10:43:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030241AbXCLOnX (ORCPT ); Mon, 12 Mar 2007 10:43:23 -0400 Received: from mx1.suse.de ([195.135.220.2]:42947 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030221AbXCLOnV (ORCPT ); Mon, 12 Mar 2007 10:43:21 -0400 Date: Mon, 12 Mar 2007 15:43:10 +0100 Message-ID: From: Takashi Iwai To: Ralf Baechle Cc: Andrew Morton , perex@suse.cz, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [SOUND] hda_intel: build fix In-Reply-To: <20070312135351.GA11974@linux-mips.org> References: <20070310190513.GA24435@linux-mips.org> <20070312135351.GA11974@linux-mips.org> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta27) (fiddleheads) (+CVS-20060704) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org At Mon, 12 Mar 2007 13:53:51 +0000, Ralf Baechle wrote: > > On Mon, Mar 12, 2007 at 12:04:30PM +0100, Takashi Iwai wrote: > > > It's no big problem to remove const in these cases, but allowing const > > with __devinitdata seems the right fix to me... > > Gccs derives the readability of a section used with __attribute(section()) > from the first use, which in case of this driver was a non-const use, so > gcc made .init.data a r/w section. Later uses were marked with const, > so did conflict. Having to ensure that all members of a section are const > or are not const is painful, so this is clearly less than desirable > behaviour on gcc's side. I think gcc picking the most permissive > attributes for a section, that is r/w in this case would be far preferable. > > Here is a small test case btw: > > int foo __attribute__ ((__section__ (".init.data"))) = 23; > const int bar __attribute__ ((__section__ (".init.data"))) = 42; > > Now I'm not a great fan of the patch I've posted but it reflects what real > world gcc is doing so for the time being I don't see much of a chance to > The Right Thing (TM). And the gain from const in this case will be small > anyway. Fair enough. I agree that removing const is the only reasonable fix right now. But from semantics, const is a good thing, and people may try to add it again later if we get rid of them now. So, how about to comment out such as /*const*/ in each place to remind that it's intentional? Also, in your patch to ice1712, you don't have to remove const from the codes in snd_ice1712_read_eeprom() and snd_ice1712_probe() functions. They should work as const pointer. Takashi