2022-02-09 08:52:14

by Cai Huoqing

[permalink] [raw]
Subject: [PATCH] tee: amdtee: 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/tee/amdtee/call.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tee/amdtee/call.c b/drivers/tee/amdtee/call.c
index 07f36ac834c8..cec6e70f0ac9 100644
--- a/drivers/tee/amdtee/call.c
+++ b/drivers/tee/amdtee/call.c
@@ -122,7 +122,7 @@ static int amd_params_to_tee_params(struct tee_param *tee, u32 count,
}

static DEFINE_MUTEX(ta_refcount_mutex);
-static struct list_head ta_list = LIST_HEAD_INIT(ta_list);
+static LIST_HEAD(ta_list);

static u32 get_ta_refcount(u32 ta_handle)
{
--
2.25.1



2022-02-09 12:47:40

by Rijo Thomas

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



On 2/9/2022 8:57 AM, 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]>
> ---
> drivers/tee/amdtee/call.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tee/amdtee/call.c b/drivers/tee/amdtee/call.c
> index 07f36ac834c8..cec6e70f0ac9 100644
> --- a/drivers/tee/amdtee/call.c
> +++ b/drivers/tee/amdtee/call.c
> @@ -122,7 +122,7 @@ static int amd_params_to_tee_params(struct tee_param *tee, u32 count,
> }
>
> static DEFINE_MUTEX(ta_refcount_mutex);
> -static struct list_head ta_list = LIST_HEAD_INIT(ta_list);
> +static LIST_HEAD(ta_list);
>

Reviewed-by: Rijo Thomas <[email protected]>

Thanks,
Rijo

> static u32 get_ta_refcount(u32 ta_handle)
> {
>

2022-02-15 09:33:48

by Jens Wiklander

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

On Wed, Feb 9, 2022 at 8:16 AM Rijo Thomas <[email protected]> wrote:
>
>
>
> On 2/9/2022 8:57 AM, 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]>
> > ---
> > drivers/tee/amdtee/call.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/tee/amdtee/call.c b/drivers/tee/amdtee/call.c
> > index 07f36ac834c8..cec6e70f0ac9 100644
> > --- a/drivers/tee/amdtee/call.c
> > +++ b/drivers/tee/amdtee/call.c
> > @@ -122,7 +122,7 @@ static int amd_params_to_tee_params(struct tee_param *tee, u32 count,
> > }
> >
> > static DEFINE_MUTEX(ta_refcount_mutex);
> > -static struct list_head ta_list = LIST_HEAD_INIT(ta_list);
> > +static LIST_HEAD(ta_list);
> >
>
> Reviewed-by: Rijo Thomas <[email protected]>

I'm picking up this.

Thanks,
Jens

>
> Thanks,
> Rijo
>
> > static u32 get_ta_refcount(u32 ta_handle)
> > {
> >