ocfs2: use get_random_u32() where appropriate
PATCH v3 1/1 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.
Signed-off-by David Carlier <[email protected]>
--- fs/ocfs2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/super.c +1 -1
@@ -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
Signature · 1 line
2.53.0
Quoted 6 lines · David Carlier
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]>
Quoted 17 lines
--- fs/ocfs2/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ocfs2/super.c +1
-1@@ -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