Skip to content

Commit

Permalink
Warnings cleanup - low hanging
Browse files Browse the repository at this point in the history
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
  • Loading branch information
lundman committed Mar 13, 2024
1 parent cf7a51b commit 06e8946
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 32 deletions.
18 changes: 9 additions & 9 deletions include/os/windows/spl/sys/sunddi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
6 changes: 3 additions & 3 deletions lib/os/windows/zlib-1.2.13/zconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,19 +449,19 @@ typedef uLong FAR uLongf;

#ifdef STDC
# ifndef Z_SOLO
/* TODO MERGE: # include <sys/types.h> /* for off_t */
// TODO MERGE: # include <sys/types.h> /* for off_t */
# endif
#endif

#if defined(STDC) || defined(Z_HAVE_STDARG_H)
# ifndef Z_SOLO
/* TODO MERGE: # include <stdarg.h> /* for va_list */
// TODO MERGE: # include <stdarg.h> /* for va_list */
# endif
#endif

#ifdef _WIN32
# ifndef Z_SOLO
/* TODO MERGE: # include <stddef.h> /* for wchar_t */
// TODO MERGE: # include <stddef.h> /* for wchar_t */
# endif
#endif

Expand Down
2 changes: 0 additions & 2 deletions module/icp/algs/blake3/blake3_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions module/icp/algs/modes/gcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 1 addition & 2 deletions module/icp/algs/sha2/sha256_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 1 addition & 2 deletions module/icp/algs/sha2/sha512_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
15 changes: 9 additions & 6 deletions module/os/windows/spl/spl-ddi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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++)
;
Expand All @@ -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++;
Expand All @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions module/zcommon/zfs_fletcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 2 additions & 4 deletions module/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit 06e8946

Please sign in to comment.