Skip to contentSkip to conversation

staging: rtl8723bs: Remove unnecessary braces

PATCH In review Javier F. Arias 2 participants 4 messages Oct 6, 2019 – Oct 7, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: Remove unnecessary braces

Remove unnecessary braces for single statement block. Issue found by checkpatch.

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +1 -2
index b5dcb78fb4f4..29acbb1ee869 100644
@@ -3022,9 +3022,8 @@ int rtw_sctx_wait(struct submit_ctx *sctx, const char *msg)
 		status = sctx->status;
 	}
 
-	if (status == RTW_SCTX_DONE_SUCCESS) {
+	if (status == RTW_SCTX_DONE_SUCCESS)
 		ret = _SUCCESS;
-	}
 
 	return ret;
 }
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Javier F. Arias

Remove unnecessary braces for single statement block. Issue found by checkpatch.

The patch looks fine. To go further with this code, you could see whether the function can return more standdard kernel return values: typically 0 for succes and -ENOMEM etc for various kinds of failure.

julia

Quoted 27 lines
---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +1 -3
index b5dcb78fb4f4..29acbb1ee869 100644
@@ -3022,9 +3022,8 @@ int rtw_sctx_wait(struct submit_ctx *sctx, const char *msg)
 		status = sctx->status;
 	}
 
-	if (status == RTW_SCTX_DONE_SUCCESS) {
+	if (status == RTW_SCTX_DONE_SUCCESS)
 		ret = _SUCCESS;
-	}
 
 	return ret;
 }
--

2.20.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191006133016.GA22297%40gmail.com.

#2 lore raw

Sorry seems like I answered with a direct email instead of the mail list, so here it goes again:

Hello Julia,

Thanks for your feedback. I'm checking the return values and it seems like the Realtek driver files would use them internally throughout the code, and not returned to the system. They are defined in the following header file:

drivers/staging/rtl8723bs/include/osdep_service.h

Quoted 7 lines

11 #define _FAIL 0
12 #define _SUCCESS 1
13 #define RTW_RX_HANDLED 2

Should I do something with them?

Quoted 52 lines · Julia Lawall
Quoted 4 lines · Javier F. Arias

Remove unnecessary braces for single statement block. Issue found by checkpatch.

Signed-off-by Javier F. Arias <[email protected] <javascript:>>
Acked-by Julia Lawall <[email protected] <javascript:>>

The patch looks fine. To go further with this code, you could see whether the function can return more standdard kernel return values: typically 0 for succes and -ENOMEM etc for various kinds of failure.

julia

Review

Quoted 5 lines

---

 drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +-- 
 1 file changed, 1 insertion(+), 2 deletions(-) 
(quoted diff) +0 -0

b/drivers/staging/rtl8723bs/core/rtw_xmit.c

drivers/staging/rtl8723bs/core/rtw_xmit.c int rtw_sctx_wait(struct submit_ctx *sctx, const

Quoted 4 lines

index b5dcb78fb4f4..29acbb1ee869 100644

drivers/staging/rtl8723bs/core/rtw_xmit.c +0 -0
@@ -3022,9 +3022,8 @@ int rtw_sctx_wait(struct submit_ctx *sctx, const 

char *msg)

Quoted 15 lines
drivers/staging/rtl8723bs/core/rtw_xmit.c +1 -2
                 status = sctx->status; 
         } 
 
-        if (status == RTW_SCTX_DONE_SUCCESS) { 
+        if (status == RTW_SCTX_DONE_SUCCESS) 
                 ret = _SUCCESS; 
-        } 
 
         return ret; 
 } 
Signature · 4 lines
2.20.1 

-- 
You received this message because you are subscribed to the Google 

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected] <javascript:>.

Quoted 1 line

To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/20191006133016.GA22297%40gmail.com.

Quoted 1 line
#3 lore raw
Quoted 11 lines · Javier Arias

Sorry seems like I answered with a direct email instead of the mail list, so here it goes again:

Hello Julia,

Thanks for your feedback. I'm checking the return values and it seems like the Realtek driver files would use them internally throughout the code, and not returned to the system. They are defined in the following header file:

drivers/staging/rtl8723bs/include/osdep_service.h

Quoted 7 lines


 11 #define _FAIL           0
 12 #define _SUCCESS        1
 13 #define RTW_RX_HANDLED 2

Should I do something with them?

I think it would be a good improvement. But it should be done slowly and carefully. Don't try to do everything at once.

julia

Quoted 63 lines · Julia Lawall

      On Sun, 6 Oct 2019, Javier F. Arias wrote:

      > Remove unnecessary braces for single statement block.
      > Issue found by checkpatch.
      >
      > Signed-off-by: Javier F. Arias <[email protected]>

      Acked-by: Julia Lawall <[email protected]>

      The patch looks fine.  To go further with this code, you could
      see whether
      the function can return more standdard kernel return values:
      typically 0
      for succes and -ENOMEM etc for various kinds of failure.

      julia

      > ---
      >  drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
      >  1 file changed, 1 insertion(+), 2 deletions(-)
      >
      > diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c
      b/drivers/staging/rtl8723bs/core/rtw_xmit.c
      > index b5dcb78fb4f4..29acbb1ee869 100644
      > --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
      > +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
      > @@ -3022,9 +3022,8 @@ int rtw_sctx_wait(struct submit_ctx
      *sctx, const char *msg)
      >                  status = sctx->status;
      >          }
      >
      > -        if (status == RTW_SCTX_DONE_SUCCESS) {
      > +        if (status == RTW_SCTX_DONE_SUCCESS)
      >                  ret = _SUCCESS;
      > -        }
      >
      >          return ret;
      >  }
      > --
      > 2.20.1
      >
      > --
      > You received this message because you are subscribed to the
      Google Groups "outreachy-kernel" group.
      > To unsubscribe from this group and stop receiving emails from
      it, send an email to [email protected].
      > To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/20191006133016.GA22297%4
      0gmail.com.
      >

--
You received this message because you are subscribed to the Google Groups
"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/42d53c83-8aea-43c3-8095- e46577a1fcb4%40googlegroups.com.