Re: [PATCH 00/29] trivial adjustments for return variable coding style

Anand Jain
2024-03-25T09:37:45Z

On 3/22/24 08:02, David Sterba wrote:
> On Tue, Mar 19, 2024 at 08:25:08PM +0530, Anand Jain wrote:
>> Rename variable 'err'; instead, use 'ret', and the 'ret' helper variable
>> is renamed to 'ret2'.
>>
>> https://btrfs.readthedocs.io/en/latest/dev/Development-notes.html#code
>>
>> In functions where 'ret' is already used as a return helper (but not the
>> actual return), to avoid oversight, first rename the original 'ret'
>> variable to 'ret2', compile it, and then rename 'err' to 'ret'.
>>
>> Anand Jain (29):
>> btrfs: btrfs_cleanup_fs_roots rename ret to ret2 and err to ret
>> btrfs: btrfs_initxattrs rename err to ret
>> btrfs: send_extent_data rename err to ret
>> btrfs: btrfs_rmdir rename err to ret
>> btrfs: btrfs_cont_expand rename err to ret
>> btrfs: btrfs_setsize rename err to ret2
>> btrfs: btrfs_find_orphan_roots rename ret to ret2 and err to ret
>> btrfs: btrfs_ioctl_snap_destroy rename err to ret
>> btrfs: __set_extent_bit rename err to ret
>> btrfs: convert_extent_bit rename err to ret
>> btrfs: __btrfs_end_transaction rename err to ret
>> btrfs: btrfs_write_marked_extents rename werr to ret err to ret2
>> btrfs: __btrfs_wait_marked_extents rename werr to ret err to ret2
>> btrfs: build_backref_tree rename err to ret and ret to ret2
>> btrfs: relocate_tree_blocks rename ret to ret2 and err to ret
>> btrfs: relocate_block_group rename ret to ret2 and err to ret
>> btrfs: create_reloc_inode rename err to ret
>> btrfs: btrfs_relocate_block_group rename ret to ret2 and err ro ret
>> btrfs: mark_garbage_root rename err to ret2
>> btrfs: btrfs_recover_relocation rename ret to ret2 and err to ret
>> btrfs: quick_update_accounting rename err to ret2
>> btrfs: btrfs_qgroup_rescan_worker rename ret to ret2 and err to ret
>> btrfs: lookup_extent_data_ref rename ret to ret2 and err to ret
>> btrfs: btrfs_drop_snapshot rename ret to ret2 and err to ret
>> btrfs: btrfs_drop_subtree rename retw to ret2
>> btrfs: btrfs_dirty_pages rename variable err to ret
>> btrfs: prepare_pages rename err to ret
>> btrfs: btrfs_direct_write rename err to ret
>> btrfs: fixup_tree_root_location rename ret to ret2 and err to ret
>
> Several patches got coments that would need an update but I think for
> the simple err -> ret renames that did not involve anything else you can
> add it to for-next.

Yeah, to better manage the patches, I have just pushed the patch
which are direct err->ret renames and does not involve ret2 and
have comments/suggestions for better ideas.

I'll be sending v2 for the remaining patches.

Thanks, Anand

> If you're not sure about some case then send it in
> v2.