git: 8d20f1560d05 - main - stand/zfs: Fix const-qual warnings
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 04 May 2022 14:10:48 UTC
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8d20f1560d05ef4c96680cd1a0a0b9ac9054700f commit 8d20f1560d05ef4c96680cd1a0a0b9ac9054700f Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2022-04-29 13:19:34 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-05-04 14:06:21 +0000 stand/zfs: Fix const-qual warnings The input buffer is read-only, update casts to match. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/cddl/boot/zfs/sha256.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/cddl/boot/zfs/sha256.c b/sys/cddl/boot/zfs/sha256.c index eee98e612a1e..2e1bfca0274f 100644 --- a/sys/cddl/boot/zfs/sha256.c +++ b/sys/cddl/boot/zfs/sha256.c @@ -203,11 +203,11 @@ SHA256(uint32_t *H, const void *buf, uint64_t size, zio_cksum_t *zcp) /* process all blocks up to the last one */ for (i = 0; i < size - padsize; i += 64) - SHA256Transform(H, (uint8_t *)buf + i); + SHA256Transform(H, (const uint8_t *)buf + i); /* process the last block and padding */ for (k = 0; k < padsize; k++) - pad[k] = ((uint8_t *)buf)[k+i]; + pad[k] = ((const uint8_t *)buf)[k + i]; for (pad[padsize++] = 0x80; (padsize & 63) != 56; padsize++) pad[padsize] = 0; @@ -259,11 +259,11 @@ SHA512(uint64_t *H, const void *buf, uint64_t size, zio_cksum_t *zcp) /* process all blocks up to the last one */ for (i = 0; i < size - padsize; i += 128) - SHA512Transform(H, (uint8_t *)buf + i); + SHA512Transform(H, (const uint8_t *)buf + i); /* process the last block and padding */ for (k = 0; k < padsize; k++) - pad[k] = ((uint8_t *)buf)[k+i]; + pad[k] = ((const uint8_t *)buf)[k + i]; if (padsize < 112) { for (pad[padsize++] = 0x80; padsize < 112; padsize++)