[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6AADFAC011213A4C87B956458587ADB47CD825@SZXEMI508-MBX.china.huawei.com>
Date: Fri, 28 Apr 2017 08:06:50 +0000
From: "weiyongjun (A)" <weiyongjun1@...wei.com>
To: Vinod Koul <vinod.koul@...el.com>
CC: Wei Yongjun <weiyj.lk@...il.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
"Takashi Iwai" <tiwai@...e.com>,
Pardha Saradhi K <pardha.saradhi.kesapragada@...el.com>,
G Kranthi <gudishax.kranthikumar@...el.com>,
Hardik T Shah <hardik.t.shah@...el.com>,
Jeeja KP <jeeja.kp@...el.com>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH -next] ASoC: Intel: Skylake: Fix to use
list_for_each_safe() when delete items
> On Tue, Apr 25, 2017 at 07:57:57AM +0000, weiyongjun (A) wrote:
> > > >
> > > > Since we will remove items off the list using list_del() we need
> > > > to use a safe version of the list_for_each() macro aptly named
> > > > list_for_each_safe().
> > >
> > > ah yes, god catch
> > >
> > > > This is detected by Coccinelle semantic patch.
> > >
> > > It is a good practice to include the script you used, do you mind adding
> > > that in the log?
> > >
> >
> > Sure.
>
> Sorry I meant this should be in changelog of the patch :)
Oh, a similar patch has been applied. Please ignore this one.
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=550b349af0f0e33fedb252aca8dc144299aca308
>
> >
> > @@
> > iterator name list_for_each;
> > expression E;
> > expression pos, head;
> > identifier l;
> > @@
> > * list_for_each(pos, head)
> > {
> > ...
> > * \(list_del\|list_del_init\|list_move\|list_move_tail\)(pos, ...);
> > ... when != \(goto l; \| break; \| return E; \| return;\)
> > }
> >
> > @@
> > expression E;
> > expression pos, head, ep;
> > identifier list;
> > identifier l;
> > @@
> > * list_for_each(pos, head)
> > {
> > ...
> > * ep = list_entry(pos, ..., list);
> > ...
> > * \(list_del\|list_del_init\|list_move\|list_move_tail\)(&ep->list, ...);
> > ... when != \(goto l; \| break; \| return E; \| return;\)
> > }
> >
> > @@
> > iterator name list_for_each_prev;
> > expression E;
> > expression pos, head;
> > identifier l;
> > @@
> > * list_for_each_prev(pos, head)
> > {
> > ...
> > * \(list_del\|list_del_init\)(pos);
> > ... when != \(goto l; \| break; \| return E; \| return;\)
> > }
> >
> > @@
> > iterator name list_for_each_entry;
> > expression E;
> > expression pos, head;
> > identifier l, member;
> > @@
> >
> > * list_for_each_entry(pos, head, member)
> > {
> > ...
> > * \(list_del\|list_del_init\)(&pos->member);
> > ... when != \(goto l; \| break; \| return E; \| return;\)
> > }
> >
> > @@
> > iterator name list_for_each_entry_from;
> > expression E;
> > expression pos, head;
> > identifier l, member;
> > @@
> >
> > * list_for_each_entry_from(pos, head, member)
> > {
> > ...
> > * \(list_del\|list_del_init\)(&pos->member);
> > ... when != \(goto l; \| break; \| return E; \| return;\)
> > }
> >
> > @@
> > iterator name list_for_each_entry_reverse;
> > expression E;
> > expression pos, head;
> > identifier l, member;
> > @@
> >
> > * list_for_each_entry_reverse(pos, head, member)
> > {
> > ...
> > * \(list_del\|list_del_init\)(&pos->member);
> > ... when != \(goto l; \| break; \| return E; \| return;\)
> > }
>
> --
> ~Vinod
Powered by blists - more mailing lists