From: Chen Zhongjin <chenzhongjin@huawei.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: <linux-kernel@vger.kernel.org>, <kasan-dev@googlegroups.com>,
<liu3101@purdue.edu>, <nogikh@google.com>, <elver@google.com>,
<akpm@linux-foundation.org>, <andreyknvl@gmail.com>,
<dvyukov@google.com>
Subject: Re: [PATCH -next] kcov: Switch to use list_for_each_entry() helper
Date: Thu, 22 Sep 2022 20:22:19 +0800 [thread overview]
Message-ID: <316fc8ae-b96b-1fb6-4a24-b8bcc6f8b948@huawei.com> (raw)
In-Reply-To: <YyxR2ErlHj6wrR6m@linutronix.de>
On 2022/9/22 20:15, Sebastian Andrzej Siewior wrote:
> On 2022-09-22 18:50:25 [+0800], Chen Zhongjin wrote:
>> --- a/kernel/kcov.c
>> +++ b/kernel/kcov.c
>> @@ -133,10 +133,8 @@ static struct kcov_remote *kcov_remote_add(struct kcov *kcov, u64 handle)
>> static struct kcov_remote_area *kcov_remote_area_get(unsigned int size)
>> {
>> struct kcov_remote_area *area;
>> - struct list_head *pos;
>>
>> - list_for_each(pos, &kcov_remote_areas) {
>> - area = list_entry(pos, struct kcov_remote_area, list);
>> + list_for_each_entry(pos, &kcov_remote_areas, list) {
> so how does this work if you remove pos?
Oops... will fix that.
Thanks so much!
>> if (area->size == size) {
>> list_del(&area->list);
>> return area;
> Sebastian
next prev parent reply other threads:[~2022-09-22 12:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-22 10:50 Chen Zhongjin
2022-09-22 12:15 ` Sebastian Andrzej Siewior
2022-09-22 12:22 ` Chen Zhongjin [this message]
2022-09-22 13:10 ` Sebastian Andrzej Siewior
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=316fc8ae-b96b-1fb6-4a24-b8bcc6f8b948@huawei.com \
--to=chenzhongjin@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=bigeasy@linutronix.de \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liu3101@purdue.edu \
--cc=nogikh@google.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®