From 7572e8ca04adda7af207dd27d643d241351680e7 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Fri, 24 May 2024 18:45:58 -0700 Subject: [PATCH] Avoid a gcc -Wint-to-pointer-cast warning On 32-bit platforms long long is generally 64-bits. Sufficiently modern versions of gcc (13 in my testing) complains when casting a pointer to an integer of a different width so cast to uintptr_t first to avoid the warning. Fixes: c183d164aa Parallel pool import Reviewed-by: Brian Behlendorf Reviewed-by: Don Brady Signed-off-by: Brooks Davis Closes #16203 --- module/zfs/spa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/spa.c b/module/zfs/spa.c index d762f21a37..412f883e9c 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -6827,7 +6827,7 @@ spa_tryimport(nvlist_t *tryconfig) */ char *name = kmem_alloc(MAXPATHLEN, KM_SLEEP); (void) snprintf(name, MAXPATHLEN, "%s-%llx-%s", - TRYIMPORT_NAME, (u_longlong_t)curthread, poolname); + TRYIMPORT_NAME, (u_longlong_t)(uintptr_t)curthread, poolname); mutex_enter(&spa_namespace_lock); spa = spa_add(name, tryconfig, NULL);