[Ocfs2-tools-devel] [PATCH] Cleanup unused variables

Sunil Mushran sunil.mushran at oracle.com
Thu Mar 1 14:27:05 PST 2012


On 03/01/2012 12:46 PM, Goldwyn Rodrigues wrote:
> Hi Sunil,
>
> I went through the changes again and I did not find any non-trivial
> changes. All variables eliminated are examples of variables being
> assigned to, but not used later in the function. There is only one
> case where the variable is used, in ocfs2_split_extent(), where eb is
> used to find out rightmost_el. However, rightmost_el is also not used
> making the use of eb useless.
>
> If you want them to be split into smaller patches, say file-wise, let
> me know and I will do so.
>
>>
>>
>> On 02/24/2012 09:50 AM, Goldwyn Rodrigues wrote:
>>>
>>> Compiler warnings of unused variables. This will need a thorough review.
>>>
>>> extent_tree.c: In function ‘ocfs2_new_path’:
>>> extent_tree.c:432:12: warning: variable ‘ret’ set but not used
>>> extent_tree.c: In function ‘ocfs2_rotate_subtree_right’:
>>> extent_tree.c:1429:29: warning: variable ‘eb’ set but not used
>>> extent_tree.c:1425:8: warning: variable ‘right_leaf_eb’ set but not used
>>> extent_tree.c: In function ‘ocfs2_unlink_subtree’:
>>> extent_tree.c:1802:28: warning: variable ‘el’ set but not used
>>> extent_tree.c: In function ‘ocfs2_rotate_subtree_left’:
>>> extent_tree.c:1837:8: warning: variable ‘root_buf’ set but not used
>>> extent_tree.c: In function ‘ocfs2_split_extent’:
>>> extent_tree.c:3766:28: warning: variable ‘rightmost_el’ set but not used
>>> extent_tree.c: In function ‘ocfs2_truncate_rec’:
>>> extent_tree.c:4033:6: warning: variable ‘wants_rotate’ set but not used
>>> extent_tree.c: In function ‘ocfs2_split_extent’:
>>> extent_tree.c:3781:30: warning: variable ‘eb’ set but not used
>>> dir_indexed.c: In function ‘ocfs2_dx_dir_transfer_leaf’:
>>> dir_indexed.c:759:42: warning: variable ‘new_list’ set but not used
>>> commands.c:1179:17: warning: variable ‘traverse’ set but not used
>>> jconfig.c: In function ‘j_config_parse_base’:
>>> jconfig.c:318:12: warning: variable ‘toknam’ set but not used
>>> jconfig.c: In function ‘j_config_add_stanza’:
>>> jconfig.c:1063:12: warning: variable ‘tmp’ set but not used
>>> pacemaker.c:46:13: warning: ‘stonithd_ci’ defined but not used
>>> test_client.c:24:18: warning: ‘fill_uuid’ defined but not used
>>> libo2info.c: In function ‘do_fiemap’:
>>> libo2info.c:408:25: warning: variable ‘blk_shift’ set but not used

Maybe split into per dir basis. So one for libocfs2, one for o2cb_ctl, 
etc. Leave out the command.c one. The traverse needs to be passed to
logdump to limit the journal output.



More information about the Ocfs2-tools-devel mailing list