]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ocfs2: use get_random_u32() where appropriate
authorDavid Carlier <devnexen@gmail.com>
Sun, 5 Apr 2026 15:47:20 +0000 (16:47 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 15 Apr 2026 09:15:03 +0000 (02:15 -0700)
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 <devnexen@gmail.com
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Heming Zhao <heming.zhao@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/super.c

index d7c58fd7d438c35425c800ee123ca00269e2e5fe..b875f01c97564def7a198e5ed6bd25a096bee70c 100644 (file)
@@ -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