Fix const-correctness in raidz math

Clang warns (errors) that "cast from 'const void *' to 'struct v *'
drops const qualifier."

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #9917
This commit is contained in:
Ryan Moeller 2020-02-03 13:52:41 -05:00 committed by GitHub
parent ec21397127
commit 07bc2bc231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -391,7 +391,7 @@ raidz_gen_pq_add(void **c, const void *dc, const size_t csize,
{
v_t *p = (v_t *)c[0];
v_t *q = (v_t *)c[1];
const v_t *d = (v_t *)dc;
const v_t *d = (const v_t *)dc;
const v_t * const dend = d + (dsize / sizeof (v_t));
const v_t * const qend = q + (csize / sizeof (v_t));
@ -462,7 +462,7 @@ raidz_gen_pqr_add(void **c, const void *dc, const size_t csize,
v_t *p = (v_t *)c[0];
v_t *q = (v_t *)c[1];
v_t *r = (v_t *)c[CODE_R];
const v_t *d = (v_t *)dc;
const v_t *d = (const v_t *)dc;
const v_t * const dend = d + (dsize / sizeof (v_t));
const v_t * const qend = q + (csize / sizeof (v_t));
@ -629,7 +629,7 @@ raidz_syn_q_abd(void **xc, const void *dc, const size_t xsize,
const size_t dsize)
{
v_t *x = (v_t *)xc[TARGET_X];
const v_t *d = (v_t *)dc;
const v_t *d = (const v_t *)dc;
const v_t * const dend = d + (dsize / sizeof (v_t));
const v_t * const xend = x + (xsize / sizeof (v_t));
@ -720,7 +720,7 @@ raidz_syn_r_abd(void **xc, const void *dc, const size_t tsize,
const size_t dsize)
{
v_t *x = (v_t *)xc[TARGET_X];
const v_t *d = (v_t *)dc;
const v_t *d = (const v_t *)dc;
const v_t * const dend = d + (dsize / sizeof (v_t));
const v_t * const xend = x + (tsize / sizeof (v_t));
@ -813,7 +813,7 @@ raidz_syn_pq_abd(void **tc, const void *dc, const size_t tsize,
{
v_t *x = (v_t *)tc[TARGET_X];
v_t *y = (v_t *)tc[TARGET_Y];
const v_t *d = (v_t *)dc;
const v_t *d = (const v_t *)dc;
const v_t * const dend = d + (dsize / sizeof (v_t));
const v_t * const yend = y + (tsize / sizeof (v_t));
@ -971,7 +971,7 @@ raidz_syn_pr_abd(void **c, const void *dc, const size_t tsize,
{
v_t *x = (v_t *)c[TARGET_X];
v_t *y = (v_t *)c[TARGET_Y];
const v_t *d = (v_t *)dc;
const v_t *d = (const v_t *)dc;
const v_t * const dend = d + (dsize / sizeof (v_t));
const v_t * const yend = y + (tsize / sizeof (v_t));
@ -1130,7 +1130,7 @@ raidz_syn_qr_abd(void **c, const void *dc, const size_t tsize,
v_t *x = (v_t *)c[TARGET_X];
v_t *y = (v_t *)c[TARGET_Y];
const v_t * const xend = x + (tsize / sizeof (v_t));
const v_t *d = (v_t *)dc;
const v_t *d = (const v_t *)dc;
const v_t * const dend = d + (dsize / sizeof (v_t));
SYN_QR_DEFINE();
@ -1295,7 +1295,7 @@ raidz_syn_pqr_abd(void **c, const void *dc, const size_t tsize,
v_t *y = (v_t *)c[TARGET_Y];
v_t *z = (v_t *)c[TARGET_Z];
const v_t * const yend = y + (tsize / sizeof (v_t));
const v_t *d = (v_t *)dc;
const v_t *d = (const v_t *)dc;
const v_t * const dend = d + (dsize / sizeof (v_t));
SYN_PQR_DEFINE();