Skip to content

Commit

Permalink
Fix const-correctness in raidz math
Browse files Browse the repository at this point in the history
Clang warns (errors) that "cast from 'const void *' to 'struct v *'
drops const qualifier."

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #9917
  • Loading branch information
Ryan Moeller authored Feb 3, 2020
1 parent ec21397 commit 07bc2bc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions module/zfs/vdev_raidz_math_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 07bc2bc

Please sign in to comment.