Re: [PATCH] hashtable: remove a redundant check in hash_for_each_xxx()

From: Greg KH
Date: Wed Oct 06 2021 - 11:29:12 EST


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