Skip to contentSkip to conversation

target/iscsi: use get_random_u32() where appropriate

PATCH New David Carlier 1 participant 1 message Apr 5

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

---
 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
index 75c37c8866c8..81e28e567a01 100644
@@ -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