Commit d78867a9 authored by Antoine Ténart's avatar Antoine Ténart Committed by Herbert Xu
Browse files

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: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
Tested-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 303391d6
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -384,12 +384,15 @@ hash_final:
			writesl(ss->base + SS_RXFIFO, op->buf, nwait);
			op->byte_count += 4 * nwait;
		}

		nbw = op->len - 4 * nwait;
		if (nbw) {
			wb = *(u32 *)(op->buf + nwait * 4);
		wb &= (0xFFFFFFFF >> (4 - nbw) * 8);
			wb &= GENMASK((nbw * 8) - 1, 0);

			op->byte_count += nbw;
		}
	}

	/* write the remaining bytes of the nbw buffer */
	wb |= ((1 << 7) << (nbw * 8));