mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 06:37:59 +00:00
crypto: sun4i-ss - use GENMASK to generate masks
Use the GENMASK helper instead of custom calculations to generate masks, It also helps the readability. Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com> Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
303391d69b
commit
d78867a94e
1 changed files with 7 additions and 4 deletions
|
@ -384,11 +384,14 @@ hash_final:
|
||||||
writesl(ss->base + SS_RXFIFO, op->buf, nwait);
|
writesl(ss->base + SS_RXFIFO, op->buf, nwait);
|
||||||
op->byte_count += 4 * nwait;
|
op->byte_count += 4 * nwait;
|
||||||
}
|
}
|
||||||
nbw = op->len - 4 * nwait;
|
|
||||||
wb = *(u32 *)(op->buf + nwait * 4);
|
|
||||||
wb &= (0xFFFFFFFF >> (4 - nbw) * 8);
|
|
||||||
|
|
||||||
op->byte_count += nbw;
|
nbw = op->len - 4 * nwait;
|
||||||
|
if (nbw) {
|
||||||
|
wb = *(u32 *)(op->buf + nwait * 4);
|
||||||
|
wb &= GENMASK((nbw * 8) - 1, 0);
|
||||||
|
|
||||||
|
op->byte_count += nbw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write the remaining bytes of the nbw buffer */
|
/* write the remaining bytes of the nbw buffer */
|
||||||
|
|
Loading…
Add table
Reference in a new issue