From 95d6d8d32f7283647260f366f756f051c1045a25 Mon Sep 17 00:00:00 2001 From: Mateusz Piotrowski Date: Thu, 22 Jun 2023 16:17:09 +0000 Subject: [PATCH] json: Drop problematic casts in nvlist_to_json() The NVP_NAME() macro requires its argument to be castable to char *. The compiler complains if const char * is provided instead. --- module/zfs/json_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/zfs/json_stats.c b/module/zfs/json_stats.c index b39b4e7c01..3f059e85ad 100644 --- a/module/zfs/json_stats.c +++ b/module/zfs/json_stats.c @@ -203,7 +203,7 @@ static void nvlist_to_json(nvlist_t *nvl, jprint_t *jp, nvj_filter_t f) { const nvpriv_t *priv; - const i_nvp_t *curr; + i_nvp_t *curr; uint64_t *u = NULL; nvlist_t **a = NULL; @@ -214,7 +214,7 @@ nvlist_to_json(nvlist_t *nvl, jprint_t *jp, nvj_filter_t f) return; for (curr = priv->nvp_list; curr != NULL; curr = curr->nvi_next) { - const nvpair_t *nvp = &curr->nvi_nvp; + nvpair_t *nvp = &curr->nvi_nvp; const char *name = (const char *)NVP_NAME(nvp); data_type_t type = NVP_TYPE(nvp); void *p = NVP_VALUE(nvp);