Re: [PATCH] staging: rtl8723bs: Add a blank line after declarations

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

 



On Wed, Dec 04, 2024 at 04:13:14PM +0800, Chenguang Zhao wrote:
> There's a warning when using checkpatch.pl check rtw_io.c:
> 
>     WARNING: Missing a blank line after declarations
>     146: FILE: drivers/staging/rtl8723bs/core/rtw_io.c:146:
>     int value = atomic_inc_return(&dvobj->continual_io_error);
>     if (value > MAX_CONTINUAL_IO_ERR)
> 
> The patch fixes it.
> 
> Signed-off-by: Chenguang Zhao <zhaochenguang@xxxxxxxxxx>
> ---
>  drivers/staging/rtl8723bs/core/rtw_io.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_io.c b/drivers/staging/rtl8723bs/core/rtw_io.c
> index fcda9db6ebb5..fb72d64f4403 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_io.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_io.c
> @@ -143,6 +143,7 @@ int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
>  {
>  	int ret = false;
>  	int value = atomic_inc_return(&dvobj->continual_io_error);
> +
>  	if (value > MAX_CONTINUAL_IO_ERR)
>  		ret = true;

Instead of mechanically adding a blank line it would be better to step
back and say "What does this function do?  How can we make it better?"

"value" is a useless variable name.  It's too vague.  A better name
would be "error_count".  And instead of setting "ret = true; return ret;"
we could do it in one step.  "return true;"  Get rid of the "ret"
variable.

regards,
dan carpenter





[Index of Archives]     [Linux Driver Development]     [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