mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-07 00:50:50 +00:00
zfs: 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. Fix i386 gcc builds while we wait for this to be merged to OpenZFS. Sponsored by: DARPA, AFRL Pull Request: https://github.com/openzfs/zfs/pull/16203
This commit is contained in:
parent
4c0dfd5959
commit
d316de24fa
|
@ -6832,7 +6832,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);
|
||||
|
|
Loading…
Reference in a new issue