aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorDamian Szuberski <[email protected]>2021-11-02 21:02:57 +0100
committerTony Hutter <[email protected]>2021-12-08 13:27:56 -0800
commit64e88992b6f21856a8edb5e7808170a3e719f319 (patch)
tree9dc1a8f7a71f46a8a68b0ed2fddf2afa0d3cc7a3 /module
parentad15fb430a57d10779ae532adf3d79b1645592cb (diff)
Update `checkstyle` workflow env to ubuntu-20.04
- `checkstyle` workflow uses ubuntu-20.04 environment - improved `mancheck.sh` readability Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: John Kennedy <[email protected]> Signed-off-by: szubersk <[email protected]> Closes #12713
Diffstat (limited to 'module')
-rw-r--r--module/Makefile.in4
-rw-r--r--module/nvpair/nvpair.c6
-rw-r--r--module/os/freebsd/zfs/vdev_geom.c1
-rw-r--r--module/os/linux/spl/spl-generic.c1
-rw-r--r--module/unicode/u8_textprep.c4
5 files changed, 13 insertions, 3 deletions
diff --git a/module/Makefile.in b/module/Makefile.in
index 089b3ff88..05c673231 100644
--- a/module/Makefile.in
+++ b/module/Makefile.in
@@ -114,7 +114,9 @@ modules_uninstall: modules_uninstall-@ac_system@
cppcheck-Linux:
@CPPCHECK@ -j@CPU_COUNT@ --std=c99 --quiet --force --error-exitcode=2 \
- --inline-suppr --suppress=noValidConfiguration \
+ --inline-suppr \
+ --suppress=unmatchedSuppression \
+ --suppress=noValidConfiguration \
--enable=warning,information -D_KERNEL \
--include=@LINUX_OBJ@/include/generated/autoconf.h \
--include=@top_srcdir@/zfs_config.h \
diff --git a/module/nvpair/nvpair.c b/module/nvpair/nvpair.c
index 5f427c8cf..9834dedd8 100644
--- a/module/nvpair/nvpair.c
+++ b/module/nvpair/nvpair.c
@@ -533,12 +533,14 @@ nvt_add_nvpair(nvlist_t *nvl, nvpair_t *nvp)
uint64_t index = hash & (priv->nvp_nbuckets - 1);
ASSERT3U(index, <, priv->nvp_nbuckets);
+ // cppcheck-suppress nullPointerRedundantCheck
i_nvp_t *bucket = tab[index];
/* insert link at the beginning of the bucket */
i_nvp_t *new_entry = NVPAIR2I_NVP(nvp);
ASSERT3P(new_entry->nvi_hashtable_next, ==, NULL);
new_entry->nvi_hashtable_next = bucket;
+ // cppcheck-suppress nullPointerRedundantCheck
tab[index] = new_entry;
priv->nvp_nentries++;
@@ -3270,6 +3272,8 @@ NVS_BUILD_XDRPROC_T(u_longlong_t);
static int
nvs_xdr_nvp_op(nvstream_t *nvs, nvpair_t *nvp)
{
+ ASSERT(nvs != NULL && nvp != NULL);
+
data_type_t type;
char *buf;
char *buf_end = (char *)nvp + nvp->nvp_size;
@@ -3278,7 +3282,7 @@ nvs_xdr_nvp_op(nvstream_t *nvs, nvpair_t *nvp)
bool_t ret = FALSE;
XDR *xdr = nvs->nvs_private;
- ASSERT(xdr != NULL && nvp != NULL);
+ ASSERT(xdr != NULL);
/* name string */
if ((buf = NVP_NAME(nvp)) >= buf_end)
diff --git a/module/os/freebsd/zfs/vdev_geom.c b/module/os/freebsd/zfs/vdev_geom.c
index 4ffa21495..2ef4811a8 100644
--- a/module/os/freebsd/zfs/vdev_geom.c
+++ b/module/os/freebsd/zfs/vdev_geom.c
@@ -199,7 +199,6 @@ vdev_geom_orphan(struct g_consumer *cp)
* async removal support to invoke a close on this
* vdev once it is safe to do so.
*/
- // cppcheck-suppress All
SLIST_FOREACH(elem, priv, elems) {
// cppcheck-suppress uninitvar
vdev_t *vd = elem->vd;
diff --git a/module/os/linux/spl/spl-generic.c b/module/os/linux/spl/spl-generic.c
index 91eeaccfd..5ea4fc635 100644
--- a/module/os/linux/spl/spl-generic.c
+++ b/module/os/linux/spl/spl-generic.c
@@ -657,6 +657,7 @@ hostid_read(uint32_t *hostid)
return (error);
}
size = stat.size;
+ // cppcheck-suppress sizeofwithnumericparameter
if (size < sizeof (HW_HOSTID_MASK)) {
filp_close(filp, 0);
return (EINVAL);
diff --git a/module/unicode/u8_textprep.c b/module/unicode/u8_textprep.c
index c1d9a325f..bce5f1962 100644
--- a/module/unicode/u8_textprep.c
+++ b/module/unicode/u8_textprep.c
@@ -865,7 +865,9 @@ do_decomp(size_t uv, uchar_t *u8s, uchar_t *s, int sz,
start_id = u8_decomp_b4_16bit_tbl[uv][b3_tbl][b4];
end_id = u8_decomp_b4_16bit_tbl[uv][b3_tbl][b4 + 1];
} else {
+ // cppcheck-suppress arrayIndexOutOfBoundsCond
start_id = u8_decomp_b4_tbl[uv][b3_tbl][b4];
+ // cppcheck-suppress arrayIndexOutOfBoundsCond
end_id = u8_decomp_b4_tbl[uv][b3_tbl][b4 + 1];
}
@@ -1012,7 +1014,9 @@ find_composition_start(size_t uv, uchar_t *s, size_t sz)
start_id = u8_composition_b4_16bit_tbl[uv][b3_tbl][b4];
end_id = u8_composition_b4_16bit_tbl[uv][b3_tbl][b4 + 1];
} else {
+ // cppcheck-suppress arrayIndexOutOfBoundsCond
start_id = u8_composition_b4_tbl[uv][b3_tbl][b4];
+ // cppcheck-suppress arrayIndexOutOfBoundsCond
end_id = u8_composition_b4_tbl[uv][b3_tbl][b4 + 1];
}