mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xiaomeng Tong <xiam0nd.tong@gmail.com>
To: broonie@kernel.org
Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com,
	linux-kernel@vger.kernel.org, perex@perex.cz,
	stable@vger.kernel.org, tiwai@suse.com, xiam0nd.tong@gmail.com
Subject: Re: [PATCH] soc: soc-dapm: fix two incorrect uses of list iterator
Date: Tue, 29 Mar 2022 09:28:48 +0800	[thread overview]
Message-ID: <20220329012848.9564-1-xiam0nd.tong@gmail.com> (raw)
In-Reply-To: <YkHi98GDDWNie7GP@sirena.org.uk>

On Mon, 28 Mar 2022 17:31:51 +0100, Mark Brown wrote:
> On Sun, Mar 27, 2022 at 04:21:38PM +0800, Xiaomeng Tong wrote:
> 
> >  		case snd_soc_dapm_pre:
> > -			if (!w->event)
> > +			if (!w->event) {
> >  				list_for_each_entry_safe_continue(w, n, list,
> >  								  power_list);
> > +				break;
> > +			}
> 
> This doesn't make much sense.  The intent here seems to clearly be to
> continue; the loop but this doesn't do that - instead it appears that
> continue doesn't actually do the equivalent of a continue but rather
> skips over an entry.  This should instead be replaced with a plain
> continue statement.
> 

Yes, you are right. Sorry for a slip of the pen in commit message:
should be "to *continue* the outer list_for_each_entry_safe() loop"
not "to break ...".

I have resend a PATCH v2 for the fix as you suggested, and cc you.
Thank you.

> THe naming of _continue() needs fixing I think - it's just asking to be
> a bug.  Fortunately there's very few users.

--
Xiaomeng Tong

      reply	other threads:[~2022-03-29  1:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-27  8:21 Xiaomeng Tong
2022-03-28 16:31 ` Mark Brown
2022-03-29  1:28   ` Xiaomeng Tong [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=20220329012848.9564-1-xiam0nd.tong@gmail.com \
    --to=xiam0nd.tong@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    /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

all inboxes | Powered by JetHome®