diff options
-rw-r--r-- | drivers/scsi/fcoe/fcoe_ctlr.c | 4 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c index a76247201be5..cd743c545ce9 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c | |||
@@ -2161,7 +2161,7 @@ static void fcoe_ctlr_vn_restart(struct fcoe_ctlr *fip) | |||
2161 | 2161 | ||
2162 | if (fip->probe_tries < FIP_VN_RLIM_COUNT) { | 2162 | if (fip->probe_tries < FIP_VN_RLIM_COUNT) { |
2163 | fip->probe_tries++; | 2163 | fip->probe_tries++; |
2164 | wait = random32() % FIP_VN_PROBE_WAIT; | 2164 | wait = prandom_u32() % FIP_VN_PROBE_WAIT; |
2165 | } else | 2165 | } else |
2166 | wait = FIP_VN_RLIM_INT; | 2166 | wait = FIP_VN_RLIM_INT; |
2167 | mod_timer(&fip->timer, jiffies + msecs_to_jiffies(wait)); | 2167 | mod_timer(&fip->timer, jiffies + msecs_to_jiffies(wait)); |
@@ -2794,7 +2794,7 @@ static void fcoe_ctlr_vn_timeout(struct fcoe_ctlr *fip) | |||
2794 | fcoe_all_vn2vn, 0); | 2794 | fcoe_all_vn2vn, 0); |
2795 | fip->port_ka_time = jiffies + | 2795 | fip->port_ka_time = jiffies + |
2796 | msecs_to_jiffies(FIP_VN_BEACON_INT + | 2796 | msecs_to_jiffies(FIP_VN_BEACON_INT + |
2797 | (random32() % FIP_VN_BEACON_FUZZ)); | 2797 | (prandom_u32() % FIP_VN_BEACON_FUZZ)); |
2798 | } | 2798 | } |
2799 | if (time_before(fip->port_ka_time, next_time)) | 2799 | if (time_before(fip->port_ka_time, next_time)) |
2800 | next_time = fip->port_ka_time; | 2800 | next_time = fip->port_ka_time; |
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index d7096ad94d3f..bfda18467ee6 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -1732,7 +1732,7 @@ lpfc_check_pending_fcoe_event(struct lpfc_hba *phba, uint8_t unreg_fcf) | |||
1732 | * use through a sequence of @fcf_cnt eligible FCF records with equal | 1732 | * use through a sequence of @fcf_cnt eligible FCF records with equal |
1733 | * probability. To perform integer manunipulation of random numbers with | 1733 | * probability. To perform integer manunipulation of random numbers with |
1734 | * size unit32_t, the lower 16 bits of the 32-bit random number returned | 1734 | * size unit32_t, the lower 16 bits of the 32-bit random number returned |
1735 | * from random32() are taken as the random random number generated. | 1735 | * from prandom_u32() are taken as the random random number generated. |
1736 | * | 1736 | * |
1737 | * Returns true when outcome is for the newly read FCF record should be | 1737 | * Returns true when outcome is for the newly read FCF record should be |
1738 | * chosen; otherwise, return false when outcome is for keeping the previously | 1738 | * chosen; otherwise, return false when outcome is for keeping the previously |
@@ -1744,7 +1744,7 @@ lpfc_sli4_new_fcf_random_select(struct lpfc_hba *phba, uint32_t fcf_cnt) | |||
1744 | uint32_t rand_num; | 1744 | uint32_t rand_num; |
1745 | 1745 | ||
1746 | /* Get 16-bit uniform random number */ | 1746 | /* Get 16-bit uniform random number */ |
1747 | rand_num = (0xFFFF & random32()); | 1747 | rand_num = 0xFFFF & prandom_u32(); |
1748 | 1748 | ||
1749 | /* Decision with probability 1/fcf_cnt */ | 1749 | /* Decision with probability 1/fcf_cnt */ |
1750 | if ((fcf_cnt * rand_num) < 0xFFFF) | 1750 | if ((fcf_cnt * rand_num) < 0xFFFF) |
@@ -2380,7 +2380,7 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
2380 | phba->fcf.eligible_fcf_cnt = 1; | 2380 | phba->fcf.eligible_fcf_cnt = 1; |
2381 | /* Seeding the random number generator for random selection */ | 2381 | /* Seeding the random number generator for random selection */ |
2382 | seed = (uint32_t)(0xFFFFFFFF & jiffies); | 2382 | seed = (uint32_t)(0xFFFFFFFF & jiffies); |
2383 | srandom32(seed); | 2383 | prandom_seed(seed); |
2384 | } | 2384 | } |
2385 | spin_unlock_irq(&phba->hbalock); | 2385 | spin_unlock_irq(&phba->hbalock); |
2386 | goto read_next_fcf; | 2386 | goto read_next_fcf; |