target/iscsi: use get_random_u32() where appropriate
Subsystems (2)
PATCH v3 1/1 target/iscsi: 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]>
--- drivers/target/iscsi/iscsi_target_seq_pdu_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/target/iscsi/iscsi_target_seq_pdu_list.c +1 -1
@@ -102,7 +102,7 @@ static void iscsit_create_random_array(u32 *array, u32 count)for (i =0 ; i < count; i++) { redo: -get_random_bytes (&j,sizeof (u32)); + j =get_random_u32 (); j = (1 + (int ) (9999 +1 ) - j) % count;for (k =0 ; k < i +1 ; k++) { j |=0x80000000 ;
Signature · 1 line
2.53.0