8607 zfs: variable set but not used
Review Request #666 - Created Oct. 3, 2017 and submitted
| Information | |
|---|---|
| Toomas Soome | |
| illumos-gate | |
| 8607 | |
| 25dd566... | |
| Reviewers | |
| general | |
../../common/fs/zfs/zfs_ioctl.c: In function 'zfs_ioc_send_space':
../../common/fs/zfs/zfs_ioctl.c:5578:12: error: variable 'embedok' set but not used [-Werror=unused-but-set-variable]
boolean_t embedok;
^~~~~~~
../../common/fs/zfs/zfs_ioctl.c:5576:12: error: variable 'largeblockok' set but not used [-Werror=unused-but-set-variable]
boolean_t largeblockok;
^~~~~~~~~~~~
../../../uts/common/fs/zfs/dsl_pool.c: In function 'dsl_pool_create':
../../../uts/common/fs/zfs/dsl_pool.c:390:12: error: variable 'os' set but not used [-Werror=unused-but-set-variable]
objset_t *os;
^~
cc1: all warnings being treated as errors
Ship It!
-
usr/src/uts/common/fs/zfs/dsl_pool.c (Diff revision 1) -
Given that it's only unused if !_KERNEL, should we make this conditional there rather than saying it's always unused as its only unused for the userland bits?
-
usr/src/uts/common/fs/zfs/zfs_ioctl.c (Diff revision 1) -
Given that these are set but not used, is there a reason we're doing these and the corresponding nvlist_exists calls? Is there a reason to even keep these here? Why not just delete them and the calls to nvlist_exists()?
Review request changed
Change Summary:
removed useless largeblockok/embedok, fixed the comment and #if for os __unused
Commit: |
|
||||
|---|---|---|---|---|---|
Diff: |
Revision 2 (+7 -7) |
-
usr/src/uts/common/fs/zfs/dsl_pool.c (Diff revision 1) -
a better solution would probably be to move this, and the declaration of os, into the ifdef KERNEL
-
usr/src/uts/common/fs/zfs/zfs_ioctl.c (Diff revision 1) -
let's just delete these, as Rob suggested.
Review request changed
Commit: |
|
||||
|---|---|---|---|---|---|
Diff: |
Revision 3 (+6 -8) |
Ship It!
-
usr/src/uts/common/fs/zfs/dsl_pool.c (Diff revision 3) -
[nit] you could move the declaration down into the ifdef kernel block on line 444.
Review request changed
Commit: |
|
||||
|---|---|---|---|---|---|
Diff: |
Revision 4 (+11 -13) |
If it doesn't break ztest, ship it.
Ship It!
