提交 d78867a9 编写于 作者: A Antoine Ténart 提交者: Herbert Xu

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: NAntoine Tenart <antoine.tenart@free-electrons.com>
Tested-by: NCorentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: NCorentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 303391d6
......@@ -384,11 +384,14 @@ static int sun4i_hash(struct ahash_request *areq)
writesl(ss->base + SS_RXFIFO, op->buf, nwait);
op->byte_count += 4 * nwait;
}
nbw = op->len - 4 * nwait;
wb = *(u32 *)(op->buf + nwait * 4);
wb &= (0xFFFFFFFF >> (4 - nbw) * 8);
if (nbw) {
wb = *(u32 *)(op->buf + nwait * 4);
wb &= GENMASK((nbw * 8) - 1, 0);
op->byte_count += nbw;
op->byte_count += nbw;
}
}
/* write the remaining bytes of the nbw buffer */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册