]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Avoid a gcc -Wint-to-pointer-cast warning
authorBrooks Davis <brooks@one-eyed-alien.net>
Sat, 25 May 2024 01:45:58 +0000 (18:45 -0700)
committerGitHub <noreply@github.com>
Sat, 25 May 2024 01:45:58 +0000 (18:45 -0700)
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 <behlendorf1@llnl.gov>
Reviewed-by: Don Brady <don.brady@klarasystems.com>
Signed-off-by: Brooks Davis <brooks.davis@sri.com>
Closes #16203

module/zfs/spa.c

index d762f21a376909501b6f66f70ee94ef7292bec2c..412f883e9c37c15708fb36455a2ab03aa8f1a0ab 100644 (file)
@@ -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);