projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'samples-colnames' of https://github.com/parallel-fs-utils/fio
[fio.git]
/
lib
/
lfsr.c
diff --git
a/lib/lfsr.c
b/lib/lfsr.c
index 0c0072ccb39b15e970eeb6bd92342b67a85cd8bb..49e34a8cfa9e3227d75342438fefbaae8804ae85 100644
(file)
--- a/
lib/lfsr.c
+++ b/
lib/lfsr.c
@@
-1,5
+1,4
@@
#include <stdio.h>
#include <stdio.h>
-#include <math.h>
#include "lfsr.h"
#include "../compiler/compiler.h"
#include "lfsr.h"
#include "../compiler/compiler.h"
@@
-79,7
+78,7
@@
static uint8_t lfsr_taps[64][FIO_MAX_TAPS] =
#define __LFSR_NEXT(__fl, __v) \
__v = ((__v >> 1) | __fl->cached_bit) ^ \
#define __LFSR_NEXT(__fl, __v) \
__v = ((__v >> 1) | __fl->cached_bit) ^ \
- (((__v & 1UL
) - 1U
L) & __fl->xormask);
+ (((__v & 1UL
L) - 1UL
L) & __fl->xormask);
static inline void __lfsr_next(struct fio_lfsr *fl, unsigned int spin)
{
static inline void __lfsr_next(struct fio_lfsr *fl, unsigned int spin)
{
@@
-147,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++)
uint64_t xormask = 0;
for(i = 0; i < FIO_MAX_TAPS && taps[i] != 0; i++)
- xormask |= 1UL << (taps[i] - 1);
+ xormask |= 1UL
L
<< (taps[i] - 1);
return xormask;
}
return xormask;
}
@@
-162,7
+161,7
@@
static uint8_t *find_lfsr(uint64_t size)
* take that into account.
*/
for (i = 3; i < 64; i++)
* take that into account.
*/
for (i = 3; i < 64; i++)
- if ((1UL << i) > size)
+ if ((1UL
L
<< i) > size)
return lfsr_taps[i];
return NULL;
return lfsr_taps[i];
return NULL;
@@
-242,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->max_val = nums - 1;
fl->xormask = lfsr_create_xormask(taps);
- fl->cached_bit = 1UL << (taps[0] - 1);
+ fl->cached_bit = 1UL
L
<< (taps[0] - 1);
if (prepare_spin(fl, spin))
return 1;
if (prepare_spin(fl, spin))
return 1;