From: David Carlier Date: Sun, 5 Apr 2026 15:47:20 +0000 (+0100) Subject: ocfs2: use get_random_u32() where appropriate X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=6c9340a2ff2b32cc4477cc6c2a969855195bf9a3;p=thirdparty%2Fkernel%2Flinux.git ocfs2: use get_random_u32() where appropriate 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. Link: https://lkml.kernel.org/r/20260405154720.4732-1-devnexen@gmail.com Signed-off-by: David Carlier Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Jun Piao Cc: Heming Zhao Signed-off-by: Andrew Morton --- diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index d7c58fd7d438c..b875f01c97564 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