public inbox for ecryptfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] ecryptfs: simplify list initialization in ecryptfs_parse_packet_set()
@ 2025-11-11 12:13 Baolin Liu
  2025-12-23 21:03 ` Tyler Hicks
  0 siblings, 1 reply; 2+ messages in thread
From: Baolin Liu @ 2025-11-11 12:13 UTC (permalink / raw)
  To: code; +Cc: ecryptfs, linux-kernel, Baolin Liu

From: Baolin Liu <liubaolin@kylinos.cn>

In ecryptfs_parse_packet_set(),use LIST_HEAD() to declare and
initialize the 'auth_tok_list' list in one step instead of
using INIT_LIST_HEAD() separately.

No functional change.

Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
---
 fs/ecryptfs/keystore.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index 7f9f68c00ef6..ea00ba20a459 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -1759,7 +1759,7 @@ int ecryptfs_parse_packet_set(struct ecryptfs_crypt_stat *crypt_stat,
 	size_t i = 0;
 	size_t found_auth_tok;
 	size_t next_packet_is_auth_tok_packet;
-	struct list_head auth_tok_list;
+	LIST_HEAD(auth_tok_list);
 	struct ecryptfs_auth_tok *matching_auth_tok;
 	struct ecryptfs_auth_tok *candidate_auth_tok;
 	char *candidate_auth_tok_sig;
@@ -1772,7 +1772,6 @@ int ecryptfs_parse_packet_set(struct ecryptfs_crypt_stat *crypt_stat,
 	struct key *auth_tok_key = NULL;
 	int rc = 0;
 
-	INIT_LIST_HEAD(&auth_tok_list);
 	/* Parse the header to find as many packets as we can; these will be
 	 * added the our &auth_tok_list */
 	next_packet_is_auth_tok_packet = 1;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] ecryptfs: simplify list initialization in ecryptfs_parse_packet_set()
  2025-11-11 12:13 [PATCH v1] ecryptfs: simplify list initialization in ecryptfs_parse_packet_set() Baolin Liu
@ 2025-12-23 21:03 ` Tyler Hicks
  0 siblings, 0 replies; 2+ messages in thread
From: Tyler Hicks @ 2025-12-23 21:03 UTC (permalink / raw)
  To: Baolin Liu; +Cc: ecryptfs, linux-kernel, Baolin Liu

On 2025-11-11 20:13:25, Baolin Liu wrote:
> From: Baolin Liu <liubaolin@kylinos.cn>
> 
> In ecryptfs_parse_packet_set(),use LIST_HEAD() to declare and
> initialize the 'auth_tok_list' list in one step instead of
> using INIT_LIST_HEAD() separately.
> 
> No functional change.
> 
> Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>

Thank you!

Acked-by: Tyler Hicks <code@tyhicks.com>

Tyler

> ---
>  fs/ecryptfs/keystore.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
> index 7f9f68c00ef6..ea00ba20a459 100644
> --- a/fs/ecryptfs/keystore.c
> +++ b/fs/ecryptfs/keystore.c
> @@ -1759,7 +1759,7 @@ int ecryptfs_parse_packet_set(struct ecryptfs_crypt_stat *crypt_stat,
>  	size_t i = 0;
>  	size_t found_auth_tok;
>  	size_t next_packet_is_auth_tok_packet;
> -	struct list_head auth_tok_list;
> +	LIST_HEAD(auth_tok_list);
>  	struct ecryptfs_auth_tok *matching_auth_tok;
>  	struct ecryptfs_auth_tok *candidate_auth_tok;
>  	char *candidate_auth_tok_sig;
> @@ -1772,7 +1772,6 @@ int ecryptfs_parse_packet_set(struct ecryptfs_crypt_stat *crypt_stat,
>  	struct key *auth_tok_key = NULL;
>  	int rc = 0;
>  
> -	INIT_LIST_HEAD(&auth_tok_list);
>  	/* Parse the header to find as many packets as we can; these will be
>  	 * added the our &auth_tok_list */
>  	next_packet_is_auth_tok_packet = 1;
> -- 
> 2.39.2
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-23 21:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-11 12:13 [PATCH v1] ecryptfs: simplify list initialization in ecryptfs_parse_packet_set() Baolin Liu
2025-12-23 21:03 ` Tyler Hicks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox