Permalink
Browse files

Correct cppcheck errors (#6662)

ZFS buildbot STYLE builder was moved to Ubuntu 17.04
which has a newer version of cppcheck. Handle the
new cppcheck errors.

uu_* functions removed in this commit were unused
and effectively dead code. They are now retired.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #6653
  • Loading branch information...
dinatale2 authored and tonyhutter committed Sep 20, 2017
1 parent 266b181 commit bef6a8bc3a1b58db1239ea327cc1efdcc611cab2
Showing with 9 additions and 311 deletions.
  1. +4 −0 .github/suppressions.txt
  2. +4 −2 Makefile.am
  3. +0 −6 include/libuutil.h
  4. +1 −2 lib/libuutil/Makefile.am
  5. +0 −300 lib/libuutil/uu_strtoint.c
  6. +0 −1 module/zfs/zfs_vnops.c
@@ -0,0 +1,4 @@
nullPointer:./module/zfs/zfs_vnops.c:839
preprocessorErrorDirective:./module/zfs/vdev_raidz_math_avx512f.c:243
preprocessorErrorDirective:./module/zfs/vdev_raidz_math_sse2.c:266

@@ -65,8 +65,10 @@ lint: cppcheck paxcheck

cppcheck:
@if type cppcheck > /dev/null 2>&1; then \
cppcheck --inline-suppr --quiet --force --error-exitcode=2 \
${top_srcdir}; \
cppcheck --quiet --force --error-exitcode=2 \
--suppressions-list=.github/suppressions.txt \
-UHAVE_SSE2 -UHAVE_AVX512F \
${top_srcdir}; \
fi

paxcheck:
@@ -98,12 +98,6 @@ extern int *uu_exit_ok(void);
extern int *uu_exit_fatal(void);
extern int *uu_exit_usage(void);

/*
* string->number conversions
*/
extern int uu_strtoint(const char *, void *, size_t, int, int64_t, int64_t);
extern int uu_strtouint(const char *, void *, size_t, int, uint64_t, uint64_t);

/*
* Debug print facility functions.
*/
@@ -17,8 +17,7 @@ USER_C = \
uu_misc.c \
uu_open.c \
uu_pname.c \
uu_string.c \
uu_strtoint.c
uu_string.c

KERNEL_C =

This file was deleted.

Oops, something went wrong.
@@ -836,7 +836,6 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
aiov->iov_base != abuf->b_data)) {
ASSERT(xuio);
dmu_write(zfsvfs->z_os, zp->z_id, woff,
// cppcheck-suppress nullPointer
aiov->iov_len, aiov->iov_base, tx);
dmu_return_arcbuf(abuf);
xuio_stat_wbuf_copied();

0 comments on commit bef6a8b

Please sign in to comment.