[PATCH v2] staging: rtl8723bs: Cleanups for rtw_inc_and_chk_continual_io_error

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

 



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.

In addition, also rename 'value' variable to 'error_count' and drop
'ret' variable.

Signed-off-by: Chenguang Zhao <zhaochenguang@xxxxxxxxxx>
---
v2:
 - rename 'value' variable to 'error_count' and drop 'ret' variable
 as Dan suggested.
---
 drivers/staging/rtl8723bs/core/rtw_io.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_io.c b/drivers/staging/rtl8723bs/core/rtw_io.c
index fcda9db6ebb5..79d543d88278 100644
--- a/drivers/staging/rtl8723bs/core/rtw_io.c
+++ b/drivers/staging/rtl8723bs/core/rtw_io.c
@@ -141,12 +141,12 @@ int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapt
 */
 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;
+	int error_count = atomic_inc_return(&dvobj->continual_io_error);
 
-	return ret;
+	if (error_count > MAX_CONTINUAL_IO_ERR)
+		return true;
+
+	return false;
 }
 
 /*
-- 
2.25.1





[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