* [PATCH net-next v2] ionic: Change list definition method
@ 2026-06-30 6:54 Lei Zhu
2026-06-30 16:26 ` Creeley, Brett
0 siblings, 1 reply; 2+ messages in thread
From: Lei Zhu @ 2026-06-30 6:54 UTC (permalink / raw)
To: brett.creeley, andrew+netdev, davem, edumazet, kuba, pabeni
Cc: netdev, zhulei_szu
From: Lei Zhu <zhulei@kylinos.cn>
The LIST_HEAD macro can both define a linked list and initialize
it in one step. To simplify code, we replace the separate operations
of linked list definition and manual initialization with the LIST_HEAD
macro.
Signed-off-by: Lei Zhu <zhulei@kylinos.cn>
---
Changes in v2:
- Order the variable declaration lines longest to shortest
drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
index 528114877677..c999754afb5f 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
@@ -558,18 +558,15 @@ struct sync_item {
void ionic_rx_filter_sync(struct ionic_lif *lif)
{
struct device *dev = lif->ionic->dev;
- struct list_head sync_add_list;
- struct list_head sync_del_list;
struct sync_item *sync_item;
struct ionic_rx_filter *f;
+ LIST_HEAD(sync_add_list);
+ LIST_HEAD(sync_del_list);
struct hlist_head *head;
struct hlist_node *tmp;
struct sync_item *spos;
unsigned int i;
- INIT_LIST_HEAD(&sync_add_list);
- INIT_LIST_HEAD(&sync_del_list);
-
clear_bit(IONIC_LIF_F_FILTER_SYNC_NEEDED, lif->state);
/* Copy the filters to be added and deleted
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next v2] ionic: Change list definition method
2026-06-30 6:54 [PATCH net-next v2] ionic: Change list definition method Lei Zhu
@ 2026-06-30 16:26 ` Creeley, Brett
0 siblings, 0 replies; 2+ messages in thread
From: Creeley, Brett @ 2026-06-30 16:26 UTC (permalink / raw)
To: Lei Zhu, brett.creeley, andrew+netdev, davem, edumazet, kuba,
pabeni; +Cc: netdev
On 6/29/2026 11:54 PM, Lei Zhu wrote:
> [You don't often get email from zhulei_szu@163.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> From: Lei Zhu <zhulei@kylinos.cn>
>
> The LIST_HEAD macro can both define a linked list and initialize
> it in one step. To simplify code, we replace the separate operations
> of linked list definition and manual initialization with the LIST_HEAD
> macro.
>
> Signed-off-by: Lei Zhu <zhulei@kylinos.cn>
> ---
> Changes in v2:
> - Order the variable declaration lines longest to shortest
>
> drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
> index 528114877677..c999754afb5f 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
> @@ -558,18 +558,15 @@ struct sync_item {
> void ionic_rx_filter_sync(struct ionic_lif *lif)
> {
> struct device *dev = lif->ionic->dev;
> - struct list_head sync_add_list;
> - struct list_head sync_del_list;
> struct sync_item *sync_item;
> struct ionic_rx_filter *f;
> + LIST_HEAD(sync_add_list);
> + LIST_HEAD(sync_del_list);
> struct hlist_head *head;
> struct hlist_node *tmp;
> struct sync_item *spos;
> unsigned int i;
>
> - INIT_LIST_HEAD(&sync_add_list);
> - INIT_LIST_HEAD(&sync_del_list);
> -
LGTM. Thanks for the patch.
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
> clear_bit(IONIC_LIF_F_FILTER_SYNC_NEEDED, lif->state);
>
> /* Copy the filters to be added and deleted
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-30 16:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30 6:54 [PATCH net-next v2] ionic: Change list definition method Lei Zhu
2026-06-30 16:26 ` Creeley, Brett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox