Re: [PATCH blktests v2] tests: Remove unnecessary '&&' in requires() functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 16, 2025 / 12:05, Li Zhijian wrote:
> The '&&' operator should only be used when the second operand
> is dependent on the first. In the context of requires() functions,
> we prefer to evaluate all conditions independently to display
> all SKIP_REASONS at once. This change separates the conditions
> into individual lines to ensure each condition is evaluated
> regardless of the others.
> 
> After this patch, there are a few '&&' remain
> $ git grep -wl 'requires()' | xargs -I {} sed -n '/^requires() *{/,/}/p' {} | grep '&&'
>         _have_null_blk && _have_module_param null_blk blocking
>         _have_null_blk && _have_module_param null_blk shared_tags
>         _have_null_blk && _have_module_param null_blk timeout
>         _have_null_blk && _have_module_param null_blk requeue
>         _have_null_blk && _have_module_param null_blk shared_tags
>         _have_null_blk && _have_module_param null_blk init_hctx
>         _have_module nvme_tcp && _have_module_param nvme_tcp ddp_offload
>         _have_program mkfs.btrfs && have_good_mkfs_btrfs
> 
> Signed-off-by: Li Zhijian <lizhijian@xxxxxxxxxxx>
> ---
> V2:
>   rebase and
>   Even though '_have_null_blk &&  _have_module_param null_blk' can be simplify to
>   '_have_module_param null_blk', I keep it as it's so that we are safe to
>   have updates in _have_null_blk() in the future.

I have applied it. Thanks!




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux