* [PATCH net-next] ixgbe: Convert list_for_each to entry variant
@ 2021-06-08 12:34 Zou Wei
0 siblings, 0 replies; only message in thread
From: Zou Wei @ 2021-06-08 12:34 UTC (permalink / raw)
To: jesse.brandeburg, anthony.l.nguyen, davem, kuba, intel-wired-lan
Cc: netdev, linux-kernel, Zou Wei
convert list_for_each() to list_for_each_entry() where
applicable.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 214a38d..9fa7bef 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -635,12 +635,10 @@ static int ixgbe_set_vf_macvlan(struct ixgbe_adapter *adapter,
int vf, int index, unsigned char *mac_addr)
{
struct vf_macvlans *entry;
- struct list_head *pos;
int retval = 0;
if (index <= 1) {
- list_for_each(pos, &adapter->vf_mvs.l) {
- entry = list_entry(pos, struct vf_macvlans, l);
+ list_for_each_entry(entry, &adapter->vf_mvs.l, l) {
if (entry->vf == vf) {
entry->vf = -1;
entry->free = true;
@@ -660,8 +658,7 @@ static int ixgbe_set_vf_macvlan(struct ixgbe_adapter *adapter,
entry = NULL;
- list_for_each(pos, &adapter->vf_mvs.l) {
- entry = list_entry(pos, struct vf_macvlans, l);
+ list_for_each_entry(entry, &adapter->vf_mvs.l, l) {
if (entry->free)
break;
}
--
2.6.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-08 12:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08 12:34 [PATCH net-next] ixgbe: Convert list_for_each to entry variant Zou Wei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).