summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-09-16 21:52:22 -0600
committerJens Axboe <axboe@kernel.dk>2018-09-16 21:52:22 -0600
commitfe6e1197f2ccba76bb3791093c480665bf1796ba (patch)
tree12d84a0653d3cdc8708826f88462a6415762008e /lib
parent39c56bc010a609f6c89955cbcfa289834ffef336 (diff)
downloadfio-fe6e1197f2ccba76bb3791093c480665bf1796ba.tar.gz
fio-fe6e1197f2ccba76bb3791093c480665bf1796ba.tar.bz2
lfsr: use unsigned long long for 64-bit values
1UL is bit 64-bit on Windows builds. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'lib')
-rw-r--r--lib/lfsr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/lfsr.c b/lib/lfsr.c
index a4f1fb13..49e34a8c 100644
--- a/lib/lfsr.c
+++ b/lib/lfsr.c
@@ -78,7 +78,7 @@ static uint8_t lfsr_taps[64][FIO_MAX_TAPS] =
#define __LFSR_NEXT(__fl, __v) \
__v = ((__v >> 1) | __fl->cached_bit) ^ \
- (((__v & 1UL) - 1UL) & __fl->xormask);
+ (((__v & 1ULL) - 1ULL) & __fl->xormask);
static inline void __lfsr_next(struct fio_lfsr *fl, unsigned int spin)
{
@@ -146,7 +146,7 @@ static uint64_t lfsr_create_xormask(uint8_t *taps)
uint64_t xormask = 0;
for(i = 0; i < FIO_MAX_TAPS && taps[i] != 0; i++)
- xormask |= 1UL << (taps[i] - 1);
+ xormask |= 1ULL << (taps[i] - 1);
return xormask;
}
@@ -161,7 +161,7 @@ static uint8_t *find_lfsr(uint64_t size)
* take that into account.
*/
for (i = 3; i < 64; i++)
- if ((1UL << i) > size)
+ if ((1ULL << i) > size)
return lfsr_taps[i];
return NULL;
@@ -241,7 +241,7 @@ int lfsr_init(struct fio_lfsr *fl, uint64_t nums, unsigned long seed,
fl->max_val = nums - 1;
fl->xormask = lfsr_create_xormask(taps);
- fl->cached_bit = 1UL << (taps[0] - 1);
+ fl->cached_bit = 1ULL << (taps[0] - 1);
if (prepare_spin(fl, spin))
return 1;