Skip to content

Commit

Permalink
Avoid a gcc -Wint-to-pointer-cast warning
Browse files Browse the repository at this point in the history
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: c183d16 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 openzfs#16203
  • Loading branch information
brooksdavis authored May 25, 2024
1 parent 08648cf commit 7572e8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7572e8c

Please sign in to comment.