Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 May 2022 12:56:22 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2baed7fc24fc - stable/13 - stand/zfs: Fix const-qual warnings
Message-ID:  <202205121256.24CCuMVT002664@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=2baed7fc24fc35203f207e45b2bd889df23be38d

commit 2baed7fc24fc35203f207e45b2bd889df23be38d
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-04-29 13:19:34 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-05-12 12:55:56 +0000

    stand/zfs: Fix const-qual warnings
    
    The input buffer is read-only, update casts to match.
    
    No functional change intended.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 8d20f1560d05ef4c96680cd1a0a0b9ac9054700f)
---
 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++)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202205121256.24CCuMVT002664>