diff --git a/include/os/windows/spl/sys/sunddi.h b/include/os/windows/spl/sys/sunddi.h index 1646a07a85f8..4e51a9592d28 100644 --- a/include/os/windows/spl/sys/sunddi.h +++ b/include/os/windows/spl/sys/sunddi.h @@ -141,15 +141,15 @@ typedef void *ldi_ident_t; #define bioerror(bp, er) (buf_seterror((bp), (er))) #define biodone(bp) buf_biodone(bp) -static inline long ddi_fls(long mask) { \ - /* Algorithm courtesy of Steve Chessin. */ \ - while (mask) { \ - long nx; \ - if ((nx = (mask & (mask - 1))) == 0) \ - break; \ - mask = nx; \ - } \ - return (__lzcnt(mask)); \ +static inline long ddi_fls(long mask) { + /* Algorithm courtesy of Steve Chessin. */ + while (mask) { + long nx; + if ((nx = (mask & (mask - 1))) == 0) + break; + mask = nx; + } + return (__lzcnt(mask)); } // find_first_bits_de_bruijn(unsigned nums[ARRAY_SIZE]) diff --git a/lib/os/windows/zlib-1.2.13/zconf.h b/lib/os/windows/zlib-1.2.13/zconf.h index 590585d1686e..273fc0dbb5f2 100644 --- a/lib/os/windows/zlib-1.2.13/zconf.h +++ b/lib/os/windows/zlib-1.2.13/zconf.h @@ -449,19 +449,19 @@ typedef uLong FAR uLongf; #ifdef STDC # ifndef Z_SOLO -/* TODO MERGE: # include /* for off_t */ +// TODO MERGE: # include /* for off_t */ # endif #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) # ifndef Z_SOLO -/* TODO MERGE: # include /* for va_list */ +// TODO MERGE: # include /* for va_list */ # endif #endif #ifdef _WIN32 # ifndef Z_SOLO -/* TODO MERGE: # include /* for wchar_t */ +// TODO MERGE: # include /* for wchar_t */ # endif #endif diff --git a/module/icp/algs/blake3/blake3_impl.c b/module/icp/algs/blake3/blake3_impl.c index b7375d937fbd..df3d6922752e 100644 --- a/module/icp/algs/blake3/blake3_impl.c +++ b/module/icp/algs/blake3/blake3_impl.c @@ -355,8 +355,6 @@ blake3_param_set(const char *val, zfs_kernel_param_t *unused) int win32_blake3_param_set(ZFS_MODULE_PARAM_ARGS) { - static char str[1024] = ""; - *type = ZT_TYPE_STRING; if (set == B_FALSE) { diff --git a/module/icp/algs/modes/gcm.c b/module/icp/algs/modes/gcm.c index 28baceda7baa..1fdfcc2a1844 100644 --- a/module/icp/algs/modes/gcm.c +++ b/module/icp/algs/modes/gcm.c @@ -1031,8 +1031,7 @@ icp_gcm_impl_get(char *buffer, zfs_kernel_param_t *kp) int win32_icp_gcm_impl_set(ZFS_MODULE_PARAM_ARGS) { - uint32_t val; - static unsigned char str[1024] = ""; + static char str[1024] = ""; *type = ZT_TYPE_STRING; diff --git a/module/icp/algs/sha2/sha256_impl.c b/module/icp/algs/sha2/sha256_impl.c index 95cae07f2912..237eb0069f2c 100644 --- a/module/icp/algs/sha2/sha256_impl.c +++ b/module/icp/algs/sha2/sha256_impl.c @@ -258,8 +258,7 @@ sha256_param_set(const char *val, zfs_kernel_param_t *unused) int win32_sha256_param_set(ZFS_MODULE_PARAM_ARGS) { - uint32_t val; - static unsigned char str[1024] = ""; + static char str[1024] = ""; *type = ZT_TYPE_STRING; diff --git a/module/icp/algs/sha2/sha512_impl.c b/module/icp/algs/sha2/sha512_impl.c index 05ab220a1a8d..c7207bc49a0b 100644 --- a/module/icp/algs/sha2/sha512_impl.c +++ b/module/icp/algs/sha2/sha512_impl.c @@ -226,8 +226,7 @@ sha512_param_set(const char *val, zfs_kernel_param_t *unused) int win32_sha512_param_set(ZFS_MODULE_PARAM_ARGS) { - uint32_t val; - static unsigned char str[1024] = ""; + static char str[1024] = ""; *type = ZT_TYPE_STRING; diff --git a/module/os/windows/spl/spl-ddi.c b/module/os/windows/spl/spl-ddi.c index 567232203749..a34844c86319 100644 --- a/module/os/windows/spl/spl-ddi.c +++ b/module/os/windows/spl/spl-ddi.c @@ -241,7 +241,7 @@ ddi_soft_state_free(void *state, int item) cmn_err(CE_WARN, "%s bad handle", msg); } else if (item < 0 || item >= ss->n_items) { - cmn_err(CE_WARN, "%s item %d not in range [0..%lu]", + cmn_err(CE_WARN, "%s item %d not in range [0..%u]", msg, item, ss->n_items - 1); } else if (array[item] != NULL) { element = array[item]; @@ -379,13 +379,15 @@ ddi_strtol(const char *str, char **nptr, int base, long *result) c = *++ustr; } } - if (base == 0) + if (base == 0) { if (c != '0') base = 10; else if (ustr[1] == 'x' || ustr[1] == 'X') base = 16; else base = 8; + } + /* * for any base > 10, the digits incrementally following * 9 are assumed to be "abc...z" or "ABC...Z" @@ -493,13 +495,14 @@ ddi_strtoll(const char *str, char **nptr, int base, long long *result) c = *++ustr; } } - if (base == 0) + if (base == 0) { if (c != '0') base = 10; else if (ustr[1] == 'x' || ustr[1] == 'X') base = 16; else base = 8; + } /* * for any base > 10, the digits incrementally following * 9 are assumed to be "abc...z" or "ABC...Z" @@ -586,7 +589,7 @@ strlcpy(char *s, const char *t, size_t n) *s = 0; break; } - } while (*s++ = *t++); + } while ((*s++ = *t++) != 0); if (!n) while (*t++) ; @@ -599,7 +602,7 @@ strlcat(char *s, const char *t, size_t n) register size_t m; const char *o = t; - if (m = n) { + if ((m = n) != 0) { while (n && *s) { n--; s++; @@ -611,7 +614,7 @@ strlcat(char *s, const char *t, size_t n) *s = 0; break; } - } while (*s++ = *t++); + } while ((*s++ = *t++) != 0); else *s = 0; } diff --git a/module/zcommon/zfs_fletcher.c b/module/zcommon/zfs_fletcher.c index 3c23ddd99d88..53420844f284 100644 --- a/module/zcommon/zfs_fletcher.c +++ b/module/zcommon/zfs_fletcher.c @@ -959,8 +959,7 @@ fletcher_4_param_set(const char *val, zfs_kernel_param_t *unused) int win32_fletcher_4_param_set(ZFS_MODULE_PARAM_ARGS) { - uint32_t val; - static unsigned char str[1024] = ""; + static char str[1024] = ""; *type = ZT_TYPE_STRING; diff --git a/module/zfs/spa.c b/module/zfs/spa.c index a967ae9c2fa8..465439b40080 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -1485,8 +1485,7 @@ spa_taskq_write_param(ZFS_MODULE_PARAM_ARGS) static int win32_spa_taskq_read_param_set(ZFS_MODULE_PARAM_ARGS) { - uint32_t val; - unsigned char str[1024] = ""; + char str[1024] = ""; *type = ZT_TYPE_STRING; @@ -1507,8 +1506,7 @@ win32_spa_taskq_read_param_set(ZFS_MODULE_PARAM_ARGS) static int win32_spa_taskq_write_param_set(ZFS_MODULE_PARAM_ARGS) { - uint32_t val; - unsigned char str[1024] = ""; + char str[1024] = ""; *type = ZT_TYPE_STRING;