Whamcloud - gitweb
LU-12678 lnet: change list_for_each in ksocknal_debug_peerhash 36/36836/3
authorMr NeilBrown <neilb@suse.de>
Mon, 18 Nov 2019 01:24:09 +0000 (12:24 +1100)
committerOleg Drokin <green@whamcloud.com>
Fri, 10 Jan 2020 07:42:16 +0000 (07:42 +0000)
commit659bb641e2a1c55dd293533388f86a6adfec8a2b
treeef2d9bc2b968e4ff81f89803e0c71ad7904e1059
parent179d50565e0bd6679bbdee5032ab0a608550d19e
LU-12678 lnet: change list_for_each in ksocknal_debug_peerhash

This list_for_each() loop searches for a particular entry,
then acts of in.  It currently acts after the loop by testing
if the variable is NULL.  When we convert to list_for_each_entry()
it won't be NULL.

Change the code so the acting happens inside the loop.
 list_for_each_entry() {
    if (this isn't it)
        continue;
    act on entry;
    goto done; // break out of 2 loops
}

Note that identing is deliberately left unchanged,
as the next patch will change the 2 loops to a single loop,
after which the current indents will be correct.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Idea32bf2ab4037650d6698d4f82f6b6764b4d1b2
Reviewed-on: https://review.whamcloud.com/36836
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/klnds/socklnd/socklnd.c