From: Saeed Mahameed <saeedm@mellanox.com>
To: "davem@davemloft.net" <davem@davemloft.net>,
"Julia.Lawall@inria.fr" <Julia.Lawall@inria.fr>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
"kuba@kernel.org" <kuba@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"leon@kernel.org" <leon@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/7] net/mlx5: drop unnecessary list_empty
Date: Tue, 28 Jul 2020 07:53:08 +0000 [thread overview]
Message-ID: <86e8f054d029991167a9fe0a4bdfedff94e38022.camel@mellanox.com> (raw)
In-Reply-To: <20200727.101059.1257161436665415755.davem@davemloft.net>
On Mon, 2020-07-27 at 10:10 -0700, David Miller wrote:
> From: Julia Lawall <Julia.Lawall@inria.fr>
> Date: Sun, 26 Jul 2020 12:58:29 +0200
>
> > list_for_each_entry is able to handle an empty list.
> > The only effect of avoiding the loop is not initializing the
> > index variable.
> > Drop list_empty tests in cases where these variables are not
> > used.
> >
> > Note that list_for_each_entry is defined in terms of
> list_first_entry,
> > which indicates that it should not be used on an empty list. But
> in
> > list_for_each_entry, the element obtained by list_first_entry is
> not
> > really accessed, only the address of its list_head field is
> compared
> > to the address of the list head, so the list_first_entry is safe.
> >
> > The semantic patch that makes this change is as follows (with
> another
> > variant for the no brace case): (http://coccinelle.lip6.fr/)
> ...
> > Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
>
> Saeed, please pick this up.
>
> Thank you.
Applied to net-next-mlx5.
Thanks !
next prev parent reply other threads:[~2020-07-28 7:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-26 10:58 [PATCH 0/7] drop unnecessary list_empty Julia Lawall
2020-07-26 10:58 ` [PATCH 4/7] net/mlx5: " Julia Lawall
2020-07-27 17:10 ` David Miller
2020-07-28 7:53 ` Saeed Mahameed [this message]
2020-07-30 22:28 ` [PATCH 0/7] " Mark Brown
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=86e8f054d029991167a9fe0a4bdfedff94e38022.camel@mellanox.com \
--to=saeedm@mellanox.com \
--cc=Julia.Lawall@inria.fr \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).