From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Chen Zhongjin <chenzhongjin@huawei.com>
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 14:15:20 +0200 [thread overview]
Message-ID: <YyxR2ErlHj6wrR6m@linutronix.de> (raw)
In-Reply-To: <20220922105025.119941-1-chenzhongjin@huawei.com>
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?
> if (area->size == size) {
> list_del(&area->list);
> return area;
Sebastian
next prev parent reply other threads:[~2022-09-22 12:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-22 10:50 [PATCH -next] kcov: Switch to use list_for_each_entry() helper Chen Zhongjin
2022-09-22 12:15 ` Sebastian Andrzej Siewior [this message]
2022-09-22 12:22 ` Chen Zhongjin
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=YyxR2ErlHj6wrR6m@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=chenzhongjin@huawei.com \
--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