From: Jacob Keller <jacob.e.keller@intel.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>,
<intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>,
Jesse Brandeburg <jesse.brandeburg@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next] ethernet/intel: Use list_for_each_entry() helper
Date: Wed, 23 Aug 2023 12:55:36 -0700 [thread overview]
Message-ID: <bbe87002-aa64-cd42-7920-0bfae61cda5a@intel.com> (raw)
In-Reply-To: <20230821134229.3132692-1-ruanjinjie@huawei.com>
On 8/21/2023 6:42 AM, Jinjie Ruan wrote:
> Convert list_for_each() to list_for_each_entry() where applicable.
>
> No functional changed.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Thanks for cleaning these up!
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
> drivers/net/ethernet/intel/igb/igb_main.c | 7 ++-----
> drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 7 ++-----
> 2 files changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index 9f63a10c6f80..bf9c2f6a1164 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -7850,7 +7850,6 @@ static int igb_set_vf_mac_filter(struct igb_adapter *adapter, const int vf,
> {
> struct pci_dev *pdev = adapter->pdev;
> struct vf_data_storage *vf_data = &adapter->vf_data[vf];
> - struct list_head *pos;
> struct vf_mac_filter *entry = NULL;
> int ret = 0;
>
> @@ -7871,8 +7870,7 @@ static int igb_set_vf_mac_filter(struct igb_adapter *adapter, const int vf,
> switch (info) {
> case E1000_VF_MAC_FILTER_CLR:
> /* remove all unicast MAC filters related to the current VF */
> - list_for_each(pos, &adapter->vf_macs.l) {
> - entry = list_entry(pos, struct vf_mac_filter, l);
> + list_for_each_entry(entry, &adapter->vf_macs.l, l) {
> if (entry->vf == vf) {
> entry->vf = -1;
> entry->free = true;
> @@ -7882,8 +7880,7 @@ static int igb_set_vf_mac_filter(struct igb_adapter *adapter, const int vf,
> break;
> case E1000_VF_MAC_FILTER_ADD:
> /* try to find empty slot in the list */
> - list_for_each(pos, &adapter->vf_macs.l) {
> - entry = list_entry(pos, struct vf_mac_filter, l);
> + list_for_each_entry(entry, &adapter->vf_macs.l, l) {
> if (entry->free)
> break;
> }
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
> index 29cc60988071..4c6e2a485d8e 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
> @@ -639,12 +639,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;
> @@ -664,8 +662,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;
> }
next prev parent reply other threads:[~2023-08-23 19:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-21 13:42 [PATCH net-next] ethernet/intel: Use list_for_each_entry() helper Jinjie Ruan
2023-08-23 19:55 ` Jacob Keller [this message]
2023-08-31 8:30 ` [Intel-wired-lan] " Romanowski, Rafal
-- strict thread matches above, loose matches on Subject: below --
2023-09-19 17:04 Tony Nguyen
2023-09-21 14:58 ` Simon Horman
2023-09-28 10:20 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bbe87002-aa64-cd42-7920-0bfae61cda5a@intel.com \
--to=jacob.e.keller@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ruanjinjie@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).