From: Takashi Iwai <tiwai@suse.de>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
perex@suse.cz, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org
Subject: Re: [SOUND] hda_intel: build fix
Date: Mon, 12 Mar 2007 15:43:10 +0100 [thread overview]
Message-ID: <s5hzm6ijzep.wl%tiwai@suse.de> (raw)
In-Reply-To: <20070312135351.GA11974@linux-mips.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
next prev parent reply other threads:[~2007-03-12 14:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-10 19:05 [SOUND] hda_intel: build fix Ralf Baechle
2007-03-10 19:26 ` [SOUND] ice1712: build fixes Ralf Baechle
2007-03-10 19:27 ` Ralf Baechle
2007-03-10 19:35 ` Ralf Baechle
2007-03-12 11:04 ` [SOUND] hda_intel: build fix Takashi Iwai
2007-03-12 13:53 ` Ralf Baechle
2007-03-12 14:43 ` Takashi Iwai [this message]
2007-03-12 15:46 ` Ralf Baechle
2007-03-12 16:38 ` Takashi Iwai
2007-03-13 12:42 ` Ralf Baechle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hzm6ijzep.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@suse.cz \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).