[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210610125417.3834300-1-wanghai38@huawei.com>
Date: Thu, 10 Jun 2021 20:54:17 +0800
From: Wang Hai <wanghai38@...wei.com>
To: <davem@...emloft.net>, <kuba@...nel.org>, <mpe@...erman.id.au>,
<benh@...nel.crashing.org>, <paulus@...ba.org>,
<drt@...ux.ibm.com>, <sukadev@...ux.ibm.com>,
<tlfalcon@...ux.ibm.com>
CC: <linuxppc-dev@...ts.ozlabs.org>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH net-next] ibmvnic: Use list_for_each_entry() to simplify code in ibmvnic.c
Convert list_for_each() to list_for_each_entry() where
applicable. This simplifies the code.
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Wang Hai <wanghai38@...wei.com>
---
drivers/net/ethernet/ibm/ibmvnic.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 5788bb956d73..77ab381a67a3 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2402,8 +2402,7 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
goto err;
}
- list_for_each(entry, &adapter->rwi_list) {
- tmp = list_entry(entry, struct ibmvnic_rwi, list);
+ list_for_each_entry(tmp, &adapter->rwi_list, list) {
if (tmp->reset_reason == reason) {
netdev_dbg(netdev, "Skipping matching reset, reason=%s\n",
reset_reason_to_string(reason));
--
2.17.1
Powered by blists - more mailing lists