public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Jean-Francois Moine <moinejf@free.fr>
Cc: lgirdwood@gmail.com, Xiubo Li <Li.Xiubo@freescale.com>,
	alsa-devel@alsa-project.org, kuninori.morimoto.gx@renesas.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: simple-card: simplify code
Date: Tue, 14 Jan 2014 18:00:05 +0000	[thread overview]
Message-ID: <20140114180005.GT15567@sirena.org.uk> (raw)
In-Reply-To: <20140114171258.2d027ee5@armhf>

[-- Attachment #1: Type: text/plain, Size: 1690 bytes --]

On Tue, Jan 14, 2014 at 05:12:58PM +0100, Jean-Francois Moine wrote:
> Mark Brown <broonie@kernel.org> wrote:

> > Please send this as a patch series to aid review, one patch doing four
> > different changes is much harder to review.

> As there are other bugs to fix, I may put back the 'of_device_is_available',
> but there are not 3 different changes: I just explain the visible
> effects of the patch. The patch itself is, as the subject says,
> 'simplify code', that is, 'have a simpler code with no change in the
> logic'.

There's several different simplifications going on here, or at least it
sounded that way.  For example creating a private data struct doesn't
seem obviously related to deleting unused fields from the platform data.
The larger a change is the more benefit there is from a series of
mechanical individual updates rather than several at once.

> > >  		ret = asoc_simple_card_sub_parse_of(np,
> > > -						  &info->cpu_dai,
> > > -						  of_cpu);
> > > +						  &priv->cpu_dai,
> > > +					  (struct device_node **)
> > > +						  &dai_link->cpu_of_node,
> > > +						  &dai_link->cpu_dai_name);

> > What's this cast here for?  That code doesn't look at all safe.

> dai_link->cpu_of_node is 'const struct device_node *' and both
> of_clk_get() and of_node_put() want 'struct device_node *'. So, there
> must be a cast somewhere.

> Do you prefer I put these ones when calling the 'of_xx' functions?

No, I think this stuff needs to actually be type safe with no dodgy
casts.  I'm not sure why we're doing an of_node_put(), for the
of_clk_get() it's not immediately obvious why it's not taking a const
clk.  Or perhaps the pointer shouldn't be stored as const.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      reply	other threads:[~2014-01-14 18:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-14 11:36 [PATCH] ASoC: simple-card: simplify code Jean-Francois Moine
2014-01-14 14:20 ` Mark Brown
2014-01-14 16:12   ` Jean-Francois Moine
2014-01-14 18:00     ` Mark Brown [this message]

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=20140114180005.GT15567@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=Li.Xiubo@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=moinejf@free.fr \
    /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