Re: [PATCH] staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG

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

 



Hi Hariprasad,

On 2019/5/19 上午1:33, Hariprasad Kelam wrote:
> fix below warning reported by  coccicheck
> 
> drivers/staging/erofs/unzip_pagevec.h:74:2-5: WARNING: Use BUG_ON
> instead of if condition followed by BUG.
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@xxxxxxxxx>
> ---
>  drivers/staging/erofs/unzip_pagevec.h | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/erofs/unzip_pagevec.h b/drivers/staging/erofs/unzip_pagevec.h
> index f37d8fd..0f61c54 100644
> --- a/drivers/staging/erofs/unzip_pagevec.h
> +++ b/drivers/staging/erofs/unzip_pagevec.h
> @@ -70,8 +70,7 @@ z_erofs_pagevec_ctor_next_page(struct z_erofs_pagevec_ctor *ctor,
>  			return tagptr_unfold_ptr(t);
>  	}
>  
> -	if (unlikely(nr >= ctor->nr))
> -		BUG();
> +	BUG_ON(nr >= ctor->nr);

Thanks for your report. I suggest to use DBG_BUGON for this case, let me
send another version for this case.

Thanks,
Gao Xiang

>  
>  	return NULL;
>  }
> 
_______________________________________________
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