Re: [PATCH] staging: lustre: libcfs: move assignment out of if condition

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

 



On Sun, Jul 12, 2015 at 03:27:50PM -0600, Perry Hooker wrote:
> Found by checkpatch.pl
> 
> Signed-off-by: Perry Hooker <perry.hooker@xxxxxxxxx>
> ---
>  drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
> index eea55d9..133ff34 100644
> --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
> +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
> @@ -79,8 +79,9 @@ static inline int cfs_fail_check_set(__u32 id, __u32 value,
>  {
>  	int ret = 0;
>  
> -	if (unlikely(CFS_FAIL_PRECHECK(id) &&
> -		     (ret = __cfs_fail_check_set(id, value, set)))) {
> +	ret = __cfs_fail_check_set(id, value, set);
> +
> +	if (unlikely(CFS_FAIL_PRECHECK(id) && ret)) {

just a doubt. in the original code __cfs_fail_check_set() will be called
if CFS_FAIL_PRECHECK() is true. And CFS_FAIL_PRECHECK() is checking
CFS_FAIL_MASK_LOC bit. So only after testing this bit __cfs_fail_check_set()
is called.
But in this new code __cfs_fail_check_set() will be called first and then the
CFS_FAIL_MASK_LOC bit is checked.

I am not sure, but after having a glance at the code it came to my mind.
maybe Oleg can confirm.

regards
sudip
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux