Re: [PATCH v3] ocfs2: use get_random_u32() where appropriate

Joseph Qi <[email protected]>
Newsgroups dev.linux.lists.ocfs2-devel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>

On 4/5/26 11:47 PM, David Carlier wrote:
> Use the typed random integer helpers instead of
> get_random_bytes() when filling a single integer variable.
> The helpers return the value directly, require no pointer
> or size argument, and better express intent.
> 
> Signed-off-by: David Carlier <[email protected]>

Acked-by: Joseph Qi <[email protected]>
> ---
>  fs/ocfs2/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
> index d7c58fd7d438..b875f01c9756 100644
> --- a/fs/ocfs2/super.c
> +++ b/fs/ocfs2/super.c
> @@ -2124,7 +2124,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
>  		osb->osb_cluster_stack[0] = '\0';
>  	}
>  
> -	get_random_bytes(&osb->s_next_generation, sizeof(u32));
> +	osb->s_next_generation = get_random_u32();
>  
>  	/*
>  	 * FIXME
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.