All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
To: Jean-Francois Moine <moinejf-GANU6spQydw@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>,
	Xiubo Li <Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	Benoit Cousson <bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
	Kuninori Morimoto
	<kuninori.morimoto.gx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [alsa-devel] [PATCH v3 2/2] ASoC: simple-card: add multi-CODECs in DT
Date: Fri, 07 Nov 2014 21:07:03 +0100	[thread overview]
Message-ID: <545D2667.4070707@metafoo.de> (raw)
In-Reply-To: <20141107200557.78971e08@armhf>

On 11/07/2014 08:05 PM, Jean-Francois Moine wrote:
> On Fri, 7 Nov 2014 12:30:35 +0000
> Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
>
>>>   	} else {
>>> -		clk = of_clk_get(args.np, 0);
>>> +		clk = of_clk_get((struct device_node *) dai_np, 0);
>>
>> Adding this cast looks suspicous - why?  As far as I can tell the
>> original code didn't need one.
>
> Right, 'args.np' was (struct device_node *), but, now, 'dai_np' is
> (const struct device_node *).
>
> Changing 'dai_np' to (struct device_node *) in the
> asoc_simple_card_sub_parse_of() argument asks for a cast in calling
> this function because the field 'of_node' of the struct
> snd_soc_dai_link_component is (const struct device_node *).
>
> Do you better like this last cast?

Casting const away is usually a sign that something is wrong and has the 
potential to result in undefined behavior. The correct fix in this case is 
probably to make the np argument for of_clk_get() const.

- Lars

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-11-07 20:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04 10:25 [PATCH v3 0/2] ASoC: simple-card: Add multi-CODEC support Jean-Francois Moine
     [not found] ` <cover.1415096705.git.moinejf-GANU6spQydw@public.gmane.org>
2014-11-03 17:42   ` [PATCH v3 1/2] ASoC: core: add multi-codec support in DT Jean-Francois Moine
     [not found]     ` <6b04d690576a0036b401d00784299ee576051c0d.1415096705.git.moinejf-GANU6spQydw@public.gmane.org>
2014-11-07 14:01       ` Mark Brown
2014-11-04 10:21   ` [PATCH v3 2/2] ASoC: simple-card: add multi-CODECs " Jean-Francois Moine
     [not found]     ` <53ef077d2174f8eb5b861d6cebe7c9e732f06d52.1415096705.git.moinejf-GANU6spQydw@public.gmane.org>
2014-11-07 12:30       ` Mark Brown
     [not found]         ` <20141107123035.GO8509-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-11-07 19:05           ` Jean-Francois Moine
2014-11-07 20:07             ` Lars-Peter Clausen [this message]
     [not found]               ` <545D2667.4070707-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2014-11-09 18:42                 ` [alsa-devel] " Jean-Francois Moine
2014-11-08  9:48             ` 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=545D2667.4070707@metafoo.de \
    --to=lars-qo5elluwu/uelga04laivw@public.gmane.org \
    --cc=Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jsarha-l0cyMroinI0@public.gmane.org \
    --cc=kuninori.morimoto.gx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=moinejf-GANU6spQydw@public.gmane.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 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.