linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: kuba@kernel.org, neilb@suse.com, mojha@codeaurora.org,
	jkosina@suse.cz, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hashtable: remove a redundant check in hash_for_each_xxx()
Date: Wed, 6 Oct 2021 17:29:02 +0200	[thread overview]
Message-ID: <YV3AvszXKVBA5BNz@kroah.com> (raw)
In-Reply-To: <20211006152100.17795-1-richard.weiyang@gmail.com>

On Wed, Oct 06, 2021 at 03:21:00PM +0000, Wei Yang wrote:
> The three hash_for_each_xxx() helper iterate the hash table with help
> of hlist_for_each_entry_xxx(), which breaks the loop only when obj is
> NULL.
> 
> This means the check during each iteration is redundant. This patch
> removes it.

Are you sure that the compiler didn't already remove it?  Is the code
output the same or different with this change?

How did you test this?

thanks,

greg k-h

  reply	other threads:[~2021-10-06 15:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06 15:21 [PATCH] hashtable: remove a redundant check in hash_for_each_xxx() Wei Yang
2021-10-06 15:29 ` Greg KH [this message]
2021-10-06 21:16 ` NeilBrown
2021-10-07  0:30   ` Wei Yang
2021-10-07  0:50     ` NeilBrown
2021-10-07 23:40       ` Wei Yang

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=YV3AvszXKVBA5BNz@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=jkosina@suse.cz \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mojha@codeaurora.org \
    --cc=neilb@suse.com \
    --cc=richard.weiyang@gmail.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;
as well as URLs for NNTP newsgroup(s).