diff options
Diffstat (limited to 'drivers/staging/lustre/lnet/lnet/router.c')
-rw-r--r-- | drivers/staging/lustre/lnet/lnet/router.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 3df101bafd9f..88283ca3f860 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * @@ -222,15 +223,12 @@ struct lnet_remotenet * 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; } @@ -243,7 +241,6 @@ static void lnet_shuffle_seed(void) __u32 lnd_type, seed[2]; struct timespec64 ts; struct lnet_ni *ni; - struct list_head *tmp; if (seeded) return; @@ -254,8 +251,7 @@ static void lnet_shuffle_seed(void) * 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) |