Skip to content

Commit

Permalink
Correct cppcheck errors
Browse files Browse the repository at this point in the history
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 behlendorf committed Sep 19, 2017
1 parent 8e2ddda commit 34d00e7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 311 deletions.
4 changes: 4 additions & 0 deletions .github/suppressions.txt
Original file line number Diff line number Diff line change
@@ -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

6 changes: 4 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,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:
Expand Down
6 changes: 0 additions & 6 deletions include/libuutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
3 changes: 1 addition & 2 deletions lib/libuutil/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 =

Expand Down
300 changes: 0 additions & 300 deletions lib/libuutil/uu_strtoint.c

This file was deleted.

1 change: 0 additions & 1 deletion module/zfs/zfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 34d00e7

Please sign in to comment.