From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ALSA: pcm: Mostly constify constraints
Date: Thu, 5 Jul 2012 10:28:42 +0100 [thread overview]
Message-ID: <20120705092841.GI4111@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <s5hhatm4rgp.wl%tiwai@suse.de>
[-- Attachment #1.1: Type: text/plain, Size: 1020 bytes --]
On Thu, Jul 05, 2012 at 09:06:30AM +0200, Takashi Iwai wrote:
> Mark Brown wrote:
> > There is no need for the constraints to be modified while being
> > applied
> Many drivers pass the local instance to rule->private, and it's not
> always guaranteed to be const. For example, you can imagine some
> state modified kept in the struct while it's modified via rules.
> In short: you'd have seen many compile warnings for non-ASoC drivers
> if you run make once with this patch ;)
Well, that's trivial to fix.
> As a safe side fix, how about just adding const to
> snd_pcm_hw_constraint_list() & co, and expclitly cast to non-const
> later?
My inclination for something like this is to put the casts with the
users since that way we get the type safety through most of the code and
we can see that dropping the const is safe since we're just getting back
our own data. If we can see the APIs immediately dropping the const I'd
expect we'd get people spending time on code review trying to figure out
if it's safe.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2012-07-05 9:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-04 17:35 [PATCH] ALSA: pcm: Mostly constify constraints Mark Brown
2012-07-05 7:06 ` Takashi Iwai
2012-07-05 9:28 ` Mark Brown [this message]
2012-07-05 9:55 ` Takashi Iwai
2012-07-05 10:35 ` Mark Brown
2012-07-05 10:41 ` Takashi Iwai
2012-07-05 11:14 ` Mark Brown
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=20120705092841.GI4111@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/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 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.