Re: [PATCH v2 04/17] bcache: disassemble the big if() checks in bch_cache_set_alloc()

Hannes Reinecke
2020-07-15T06:08:50Z

On 7/15/20 7:45 AM, Coly Li wrote:
> In bch_cache_set_alloc() there is a big if() checks combined by 11 items
> together. When this big if() statement fails, it is difficult to tell
> exactly which item fails indeed.
>
> This patch disassembles this big if() checks into 11 single if() checks,
> which makes code debug more easier.
>
> Signed-off-by: Coly Li <colyli@suse.de>
> ---
> drivers/md/bcache/super.c | 52 ++++++++++++++++++++++++++++-----------
> 1 file changed, 37 insertions(+), 15 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer