2022-02-09 10:48:58

by Cai Huoqing

[permalink] [raw]
Subject: [PATCH] ocxl: Make use of the helper macro LIST_HEAD()

Replace "struct list_head head = LIST_HEAD_INIT(head)" with
"LIST_HEAD(head)" to simplify the code.

Signed-off-by: Cai Huoqing <[email protected]>
---
drivers/misc/ocxl/link.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/ocxl/link.c b/drivers/misc/ocxl/link.c
index ab039c115381..9670d02c927f 100644
--- a/drivers/misc/ocxl/link.c
+++ b/drivers/misc/ocxl/link.c
@@ -94,7 +94,7 @@ struct ocxl_link {
struct spa *spa;
void *platform_data;
};
-static struct list_head links_list = LIST_HEAD_INIT(links_list);
+static LIST_HEAD(links_list);
static DEFINE_MUTEX(links_list_lock);

enum xsl_response {
--
2.25.1



2022-02-09 12:09:39

by Frederic Barrat

[permalink] [raw]
Subject: Re: [PATCH] ocxl: Make use of the helper macro LIST_HEAD()



On 09/02/2022 04:24, Cai Huoqing wrote:
> Replace "struct list_head head = LIST_HEAD_INIT(head)" with
> "LIST_HEAD(head)" to simplify the code.
>
> Signed-off-by: Cai Huoqing <[email protected]>
> ---

Thanks!
Acked-by: Frederic Barrat <[email protected]>


> drivers/misc/ocxl/link.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/ocxl/link.c b/drivers/misc/ocxl/link.c
> index ab039c115381..9670d02c927f 100644
> --- a/drivers/misc/ocxl/link.c
> +++ b/drivers/misc/ocxl/link.c
> @@ -94,7 +94,7 @@ struct ocxl_link {
> struct spa *spa;
> void *platform_data;
> };
> -static struct list_head links_list = LIST_HEAD_INIT(links_list);
> +static LIST_HEAD(links_list);
> static DEFINE_MUTEX(links_list_lock);
>
> enum xsl_response {

2022-02-09 12:52:30

by Andrew Donnellan

[permalink] [raw]
Subject: Re: [PATCH] ocxl: Make use of the helper macro LIST_HEAD()

On 9/2/22 14:24, Cai Huoqing wrote:
> Replace "struct list_head head = LIST_HEAD_INIT(head)" with
> "LIST_HEAD(head)" to simplify the code.
>
> Signed-off-by: Cai Huoqing <[email protected]>

LGTM

Acked-by: Andrew Donnellan <[email protected]>

--
Andrew Donnellan OzLabs, ADL Canberra
[email protected] IBM Australia Limited