projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
919a295
)
scsi: zfcp: Use prandom_u32_max() for backoff
author
George Spelvin
<lkml@sdf.org>
Fri, 3 Jul 2020 13:19:57 +0000
(15:19 +0200)
committer
Martin K. Petersen
<martin.petersen@oracle.com>
Wed, 8 Jul 2020 04:50:52 +0000
(
00:50
-0400)
We don't need crypto-grade random numbers for randomized backoffs. Instead
use prandom_u32_max(ep_ro) which generates a pseudo-random number uniformly
distributed in the interval [0, ep_ro).
Link:
https://lore.kernel.org/r/8fc7c4c4069ff1783f4a9ccd84a923f581a09ec5.1593780621.git.bblock@linux.ibm.com
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: George Spelvin <lkml@sdf.org>
Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/s390/scsi/zfcp_fc.c
patch
|
blob
|
history
diff --git
a/drivers/s390/scsi/zfcp_fc.c
b/drivers/s390/scsi/zfcp_fc.c
index b018b61bd168edc580d24326f6c5d214dea4fa37..d24cafe02708fa941346510c6fd8aac21f1110e3 100644
(file)
--- a/
drivers/s390/scsi/zfcp_fc.c
+++ b/
drivers/s390/scsi/zfcp_fc.c
@@
-48,7
+48,7
@@
unsigned int zfcp_fc_port_scan_backoff(void)
{
if (!port_scan_backoff)
return 0;
- return
get_random_int() % port_scan_backoff
;
+ return
prandom_u32_max(port_scan_backoff)
;
}
static void zfcp_fc_port_scan_time(struct zfcp_adapter *adapter)