summaryrefslogtreecommitdiffstats
path: root/module/zfs/zio_compress.c
diff options
context:
space:
mode:
authorDon Brady <[email protected]>2017-11-04 14:25:13 -0600
committerBrian Behlendorf <[email protected]>2017-11-04 13:25:13 -0700
commit1c27024e22af4386b592b30d40e6a0820ceb48c1 (patch)
tree689d4b821fd6910a137a0f93351351def5011cec /module/zfs/zio_compress.c
parentdf1f129bc4150fd6ea3f23a01154a71ffa48bf12 (diff)
Undo c89 workarounds to match with upstream
With PR 5756 the zfs module now supports c99 and the remaining past c89 workarounds can be undone. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Don Brady <[email protected]> Closes #6816
Diffstat (limited to 'module/zfs/zio_compress.c')
-rw-r--r--module/zfs/zio_compress.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/module/zfs/zio_compress.c b/module/zfs/zio_compress.c
index 7e44d16e4..974af03d1 100644
--- a/module/zfs/zio_compress.c
+++ b/module/zfs/zio_compress.c
@@ -89,9 +89,7 @@ static int
zio_compress_zeroed_cb(void *data, size_t len, void *private)
{
uint64_t *end = (uint64_t *)((char *)data + len);
- uint64_t *word;
-
- for (word = data; word < end; word++)
+ for (uint64_t *word = (uint64_t *)data; word < end; word++)
if (*word != 0)
return (1);
@@ -103,7 +101,6 @@ zio_compress_data(enum zio_compress c, abd_t *src, void *dst, size_t s_len)
{
size_t c_len, d_len;
zio_compress_info_t *ci = &zio_compress_table[c];
- void *tmp;
ASSERT((uint_t)c < ZIO_COMPRESS_FUNCTIONS);
ASSERT((uint_t)c == ZIO_COMPRESS_EMPTY || ci->ci_compress != NULL);
@@ -122,7 +119,7 @@ zio_compress_data(enum zio_compress c, abd_t *src, void *dst, size_t s_len)
d_len = s_len - (s_len >> 3);
/* No compression algorithms can read from ABDs directly */
- tmp = abd_borrow_buf_copy(src, s_len);
+ void *tmp = abd_borrow_buf_copy(src, s_len);
c_len = ci->ci_compress(tmp, dst, s_len, d_len, ci->ci_level);
abd_return_buf(src, tmp, s_len);