mbox series

[00/25] Unused parameter cleanups

Message ID cover.1728484021.git.dsterba@suse.com (mailing list archive)
Headers show
Series Unused parameter cleanups | expand

Message

David Sterba Oct. 9, 2024, 2:30 p.m. UTC
Assorted unused parameter removal, I tried to go to history where it was
last used and seemed important. Most of them look like leftovers after
other changes.

David Sterba (25):
  btrfs: zstd: assert the timer pointer in callback
  btrfs: drop unused parameter path from btrfs_tree_mod_log_rewind()
  btrfs: drop unused parameter ctx from batch_delete_dir_index_items()
  btrfs: drop unused parameter fs_info from wait_reserve_ticket()
  btrfs: drop unused parameter fs_info from do_reclaim_sweep()
  btrfs: send: drop unused parameter num from iterate_inode_ref_t
    callbacks
  btrfs: send: drop unused parameter index from iterate_inode_ref_t
    callbacks
  btrfs: scrub: drop unused parameter sctx from
    scrub_submit_extent_sector_read()
  btrfs: drop unused parameter map from scrub_simple_mirror()
  btrfs: qgroup: drop unused parameter fs_info from __del_qgroup_rb()
  btrfs: drop unused transaction parameter from
    btrfs_qgroup_add_swapped_blocks()
  btrfs: lzo: drop unused paramter level from lzo_alloc_workspace()
  btrfs: drop unused parameter argp from btrfs_ioctl_quota_rescan_wait()
  btrfs: drop unused parameter inode from read_inline_extent()
  btrfs: drop unused parameter offset from __cow_file_range_inline()
  btrfs: drop unused parameter file_offset from
    btrfs_encoded_read_regular_fill_pages()
  btrfs: drop unused parameter iov_iter from btrfs_write_check()
  btrfs: drop unused parameter refs from visit_node_for_delete()
  btrfs: drop unused parameter mask from try_release_extent_state()
  btrfs: drop unused parameter fs_info from folio_range_has_eb()
  btrfs: drop unused parameter options from open_ctree()
  btrfs: drop unused parameter data from btrfs_fill_super()
  btrfs: drop unused parameter transaction from alloc_log_tree()
  btrfs: drop unused parameter fs_info from btrfs_match_dir_item_name()
  btrfs: drop unused parameter level from alloc_heuristic_ws()

 fs/btrfs/btrfs_inode.h  |  3 +--
 fs/btrfs/compression.c  |  6 +++---
 fs/btrfs/compression.h  |  2 +-
 fs/btrfs/ctree.c        |  2 +-
 fs/btrfs/dir-item.c     | 11 ++++-------
 fs/btrfs/dir-item.h     |  3 +--
 fs/btrfs/direct-io.c    |  2 +-
 fs/btrfs/disk-io.c      | 10 ++++------
 fs/btrfs/disk-io.h      |  3 +--
 fs/btrfs/extent-tree.c  |  7 +++----
 fs/btrfs/extent_io.c    |  8 ++++----
 fs/btrfs/file.c         |  6 +++---
 fs/btrfs/file.h         |  2 +-
 fs/btrfs/inode.c        | 17 ++++++++---------
 fs/btrfs/ioctl.c        |  5 ++---
 fs/btrfs/lzo.c          |  2 +-
 fs/btrfs/qgroup.c       | 10 ++++------
 fs/btrfs/qgroup.h       |  3 +--
 fs/btrfs/relocation.c   |  2 +-
 fs/btrfs/scrub.c        | 12 +++++-------
 fs/btrfs/send.c         | 25 +++++++------------------
 fs/btrfs/space-info.c   | 10 ++++------
 fs/btrfs/super.c        |  7 +++----
 fs/btrfs/tree-log.c     |  3 +--
 fs/btrfs/tree-mod-log.c |  1 -
 fs/btrfs/tree-mod-log.h |  1 -
 fs/btrfs/xattr.c        |  5 ++---
 fs/btrfs/zstd.c         |  2 ++
 28 files changed, 69 insertions(+), 101 deletions(-)

Comments

Anand Jain Oct. 11, 2024, 11:45 a.m. UTC | #1
On 9/10/24 8:00 pm, David Sterba wrote:
> Assorted unused parameter removal, I tried to go to history where it was
> last used and seemed important. Most of them look like leftovers after
> other changes.
> 

I'm curious, how did you come across them?
Using `CFLAGS="-Wunused-parameter"` or `-C=1` doesn't seem to report them.

LGTM for the entire series.

Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thx.
David Sterba Oct. 11, 2024, 3:54 p.m. UTC | #2
On Fri, Oct 11, 2024 at 07:45:52PM +0800, Anand Jain wrote:
> On 9/10/24 8:00 pm, David Sterba wrote:
> > Assorted unused parameter removal, I tried to go to history where it was
> > last used and seemed important. Most of them look like leftovers after
> > other changes.
> > 
> 
> I'm curious, how did you come across them?
> Using `CFLAGS="-Wunused-parameter"` or `-C=1` doesn't seem to report them.

Passing custom flags works

  $ make ccflags-y=-Wunused-parameter fs/btrfs/

There are many out of btrfs code warnings so the rest was manual search
for 'fs.btrfs.*warning.*unused' and code inspection.