lnet_find_net_locked(__u32 net)
 {
        struct lnet_remotenet *rnet;
-       struct list_head *tmp;
        struct list_head *rn_list;
 
        LASSERT(!the_lnet.ln_shutdown);
 
        rn_list = lnet_net2rnethash(net);
-       list_for_each(tmp, rn_list) {
-               rnet = list_entry(tmp, struct lnet_remotenet, lrn_list);
-
+       list_for_each_entry(rnet, rn_list, lrn_list) {
                if (rnet->lrn_net == net)
                        return rnet;
        }
        __u32 lnd_type, seed[2];
        struct timespec64 ts;
        struct lnet_ni *ni;
-       struct list_head *tmp;
 
        if (seeded)
                return;
         * Nodes with small feet have little entropy
         * the NID for this node gives the most entropy in the low bits
         */
-       list_for_each(tmp, &the_lnet.ln_nis) {
-               ni = list_entry(tmp, struct lnet_ni, ni_list);
+       list_for_each_entry(ni, &the_lnet.ln_nis, ni_list) {
                lnd_type = LNET_NETTYP(LNET_NIDNET(ni->ni_nid));
 
                if (lnd_type != LOLND)