From f5b24e1c9fa8495de095878c7c61ece123cfe566 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 3 Dec 2017 04:55:33 +0000 Subject: [PATCH] Mark two things as unused (since they are only sometimes used) and toss in a DECONST to remove a const in some tricky code that would require too extensive a change to unwind otherwise. Sponsored by: Netflix --- stand/zfs/zfsimpl.c | 2 +- sys/cddl/boot/zfs/zfssubr.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stand/zfs/zfsimpl.c b/stand/zfs/zfsimpl.c index 30849db56923..d5250859a65e 100644 --- a/stand/zfs/zfsimpl.c +++ b/stand/zfs/zfsimpl.c @@ -43,7 +43,7 @@ struct zfsmount { objset_phys_t objset; uint64_t rootobj; }; -static struct zfsmount zfsmount; +static struct zfsmount zfsmount __unused; /* * List of all vdevs, chained through v_alllink. diff --git a/sys/cddl/boot/zfs/zfssubr.c b/sys/cddl/boot/zfs/zfssubr.c index 261aa3b872d7..6bb4c35db216 100644 --- a/sys/cddl/boot/zfs/zfssubr.c +++ b/sys/cddl/boot/zfs/zfssubr.c @@ -250,7 +250,7 @@ zio_checksum_template_init(enum zio_checksum checksum, spa_t *spa) * all of the checksum context templates and deallocates any that were * initialized using the algorithm-specific template init function. */ -static void +static void __unused zio_checksum_templates_free(spa_t *spa) { for (enum zio_checksum checksum = 0; @@ -284,7 +284,7 @@ zio_checksum_verify(const spa_t *spa, const blkptr_t *bp, void *data) return (EINVAL); if (spa != NULL) { - zio_checksum_template_init(checksum, (spa_t *) spa); + zio_checksum_template_init(checksum, __DECONST(spa_t *,spa)); ctx = spa->spa_cksum_tmpls[checksum]; }