2024-05-07 20:07:50

by Lars Kellogg-Stedman

[permalink] [raw]
Subject: Re: [PATCH net v5 1/4] ax25: Use kernel universal linked list to implement ax25_dev_list

On Tue, May 07, 2024 at 03:03:39PM GMT, Duoming Zhou wrote:
> typedef struct ax25_dev {
> - struct ax25_dev *next;
> + struct list_head list;

Would it make sense to replace this with:

LIST_HEAD(ax25_dev_list);

And then get rid of:

> + /* Initialized the list for the first entry */
> + if (!ax25_dev_list.next)
> + INIT_LIST_HEAD(&ax25_dev_list);

--
Lars Kellogg-Stedman <[email protected]> | larsks @ {irc,twitter,github}
http://blog.oddbit.com/ | N1LKS


2024-05-08 00:16:26

by Lars Kellogg-Stedman

[permalink] [raw]
Subject: Re: [PATCH net v5 1/4] ax25: Use kernel universal linked list to implement ax25_dev_list

On Tue, May 07, 2024 at 03:43:11PM GMT, Lars Kellogg-Stedman wrote:
> On Tue, May 07, 2024 at 03:03:39PM GMT, Duoming Zhou wrote:
> > typedef struct ax25_dev {
> > - struct ax25_dev *next;
> > + struct list_head list;
>
> Would it make sense to replace this with:
>
> LIST_HEAD(ax25_dev_list);

Sorry, *this*:

> +static struct list_head ax25_dev_list;


--
Lars Kellogg-Stedman <[email protected]> | larsks @ {irc,twitter,github}
http://blog.oddbit.com/ | N1LKS