Re: [PATCH 3/3] btrfs-progs: qgroup: cleanup __qgroup_search, no functional change

2017-11-10 Thread Lu Fengqi
On Thu, Nov 09, 2017 at 05:51:48PM +0100, David Sterba wrote: >On Tue, Oct 31, 2017 at 05:13:45PM +0800, Lu Fengqi wrote: >> 1. Use goto instead of while (1) to reduce the level of indentation > >I'd rather avoid this goto pattern in new code, using while is ok. If >the indentation depth becomes

Re: [PATCH 3/3] btrfs-progs: qgroup: cleanup __qgroup_search, no functional change

2017-11-09 Thread David Sterba
On Tue, Oct 31, 2017 at 05:13:45PM +0800, Lu Fengqi wrote: > 1. Use goto instead of while (1) to reduce the level of indentation I'd rather avoid this goto pattern in new code, using while is ok. If the indentation depth becomes problem, then the inner code should be moved to a helper. > 2.

[PATCH 3/3] btrfs-progs: qgroup: cleanup __qgroup_search, no functional change

2017-10-31 Thread Lu Fengqi
1. Use goto instead of while (1) to reduce the level of indentation 2. Replace the if statement with the switch statement 3. move the BTRFS_IOC_TREE_SEARCH ioctl error handler to __qgroup_search Signed-off-by: Lu Fengqi --- cmds-qgroup.c | 4 -- qgroup.c | 152