Commit 50bea5c0d583e255e3d8a193f8b20e177bac8ec8
Committed by
Linus Torvalds
1 parent
e00adf3913
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
drivers/infiniband/hw: rename random32() to prandom_u32()
Use preferable function name which implies using a pseudo-random number generator. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 4 changed files with 6 additions and 6 deletions Side-by-side Diff
drivers/infiniband/hw/cxgb3/cxio_resource.c
... | ... | @@ -62,13 +62,13 @@ |
62 | 62 | kfifo_in(fifo, (unsigned char *) &entry, sizeof(u32)); |
63 | 63 | if (random) { |
64 | 64 | j = 0; |
65 | - random_bytes = random32(); | |
65 | + random_bytes = prandom_u32(); | |
66 | 66 | for (i = 0; i < RANDOM_SIZE; i++) |
67 | 67 | rarray[i] = i + skip_low; |
68 | 68 | for (i = skip_low + RANDOM_SIZE; i < nr - skip_high; i++) { |
69 | 69 | if (j >= RANDOM_SIZE) { |
70 | 70 | j = 0; |
71 | - random_bytes = random32(); | |
71 | + random_bytes = prandom_u32(); | |
72 | 72 | } |
73 | 73 | idx = (random_bytes >> (j * 2)) & 0xF; |
74 | 74 | kfifo_in(fifo, |
drivers/infiniband/hw/cxgb4/id_table.c
... | ... | @@ -54,7 +54,7 @@ |
54 | 54 | |
55 | 55 | if (obj < alloc->max) { |
56 | 56 | if (alloc->flags & C4IW_ID_TABLE_F_RANDOM) |
57 | - alloc->last += random32() % RANDOM_SKIP; | |
57 | + alloc->last += prandom_u32() % RANDOM_SKIP; | |
58 | 58 | else |
59 | 59 | alloc->last = obj + 1; |
60 | 60 | if (alloc->last >= alloc->max) |
... | ... | @@ -88,7 +88,7 @@ |
88 | 88 | alloc->start = start; |
89 | 89 | alloc->flags = flags; |
90 | 90 | if (flags & C4IW_ID_TABLE_F_RANDOM) |
91 | - alloc->last = random32() % RANDOM_SKIP; | |
91 | + alloc->last = prandom_u32() % RANDOM_SKIP; | |
92 | 92 | else |
93 | 93 | alloc->last = 0; |
94 | 94 | alloc->max = num; |
drivers/infiniband/hw/mlx4/mad.c
... | ... | @@ -93,7 +93,7 @@ |
93 | 93 | __be64 mlx4_ib_gen_node_guid(void) |
94 | 94 | { |
95 | 95 | #define NODE_GUID_HI ((u64) (((u64)IB_OPENIB_OUI) << 40)) |
96 | - return cpu_to_be64(NODE_GUID_HI | random32()); | |
96 | + return cpu_to_be64(NODE_GUID_HI | prandom_u32()); | |
97 | 97 | } |
98 | 98 | |
99 | 99 | __be64 mlx4_ib_get_new_demux_tid(struct mlx4_ib_demux_ctx *ctx) |
drivers/infiniband/ulp/ipoib/ipoib_cm.c