From eed31a5029ea44ee094894194ae97b767e289372 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 12 Aug 2010 21:17:01 -0700 Subject: [PATCH 1/2] Move unused function warning to gcc-unused topic branch See commit 123b6b2f4955cb069844d55f06a00bcb4a4f3ac7. --- cmd/ztest/ztest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 30442ac26d..f15a749428 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -1039,6 +1039,7 @@ ztest_pattern_set(void *buf, uint64_t size, uint64_t value) *ip++ = value; } +#ifndef NDEBUG static boolean_t ztest_pattern_match(void *buf, uint64_t size, uint64_t value) { @@ -1051,6 +1052,7 @@ ztest_pattern_match(void *buf, uint64_t size, uint64_t value) return (diff == 0); } +#endif static void ztest_bt_generate(ztest_block_tag_t *bt, objset_t *os, uint64_t object, From 2b89d86fff8423e5507263d6c923dafed9837057 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 12 Aug 2010 21:19:01 -0700 Subject: [PATCH 2/2] Initialize resid variable Properly initialize the variable resid for the error case where vn_rdwr() returns an error with setting *resid. In practice this is harmless because the contents of resid don't matter when vn_rdwr() returns an error. But the code does check the result which means we may or may not end up having the check zio->io_error. This makes gcc unhappy and having a completely deterministic code path here is a good thing. Closes #51 --- module/zfs/vdev_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/vdev_file.c b/module/zfs/vdev_file.c index 8c22aa5316..f31389a6df 100644 --- a/module/zfs/vdev_file.c +++ b/module/zfs/vdev_file.c @@ -143,7 +143,7 @@ vdev_file_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; vdev_file_t *vf = vd->vdev_tsd; - ssize_t resid; + ssize_t resid = 0; if (zio->io_type == ZIO_TYPE_IOCTL) { /* XXPOLICY */