Re: [PATCH 4/5] staging: rtl8188eu: change return type of rtw_hal_xmit()

2018-10-28 Thread Michael Straube

On 10/28/18 1:08 AM, Joe Perches wrote:

On Sat, 2018-10-27 at 15:57 -0700, Joe Perches wrote:

On Sat, 2018-10-27 at 22:28 +0200, Michael Straube wrote:

The function rtw_hal_xmit() returns true or false.
Change the return type from s32 to bool.

[]

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c 
b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c

[]

@@ -598,7 +598,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt,
   *truedump packet directly
   *false   enqueue packet
   */
-s32 rtw_hal_xmit(struct adapter *adapt, struct xmit_frame *pxmitframe)
+bool rtw_hal_xmit(struct adapter *adapt, struct xmit_frame *pxmitframe)
  {
s32 res;


Does "s32 res" need changing to bool too?


Perhaps all the functions regardless of types
with returns of only _SUCCESS and _FAIL could be
converted to bool.



"s32 res" is not used for return value, so it does not need changing to bool.
But it could be converted too.

I'll keep that, and converting functions only returning _SUCCESS and _FAIL to
bool, in mind for future patches. Thanks.

Perhaps _SUCCESS / _FAIL could be replaced with true / false throughout the
driver to get rid of the defines? Or is that a bad idea?

Regards,
Michael




Re: [PATCH 4/5] staging: rtl8188eu: change return type of rtw_hal_xmit()

2018-10-27 Thread Joe Perches
On Sat, 2018-10-27 at 15:57 -0700, Joe Perches wrote:
> On Sat, 2018-10-27 at 22:28 +0200, Michael Straube wrote:
> > The function rtw_hal_xmit() returns true or false.
> > Change the return type from s32 to bool.
> [] 
> > diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c 
> > b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
> []
> > @@ -598,7 +598,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt,
> >   * truedump packet directly
> >   * false   enqueue packet
> >   */
> > -s32 rtw_hal_xmit(struct adapter *adapt, struct xmit_frame *pxmitframe)
> > +bool rtw_hal_xmit(struct adapter *adapt, struct xmit_frame *pxmitframe)
> >  {
> > s32 res;
> 
> Does "s32 res" need changing to bool too?

Perhaps all the functions regardless of types
with returns of only _SUCCESS and _FAIL could be
converted to bool.





Re: [PATCH 4/5] staging: rtl8188eu: change return type of rtw_hal_xmit()

2018-10-27 Thread Joe Perches
On Sat, 2018-10-27 at 22:28 +0200, Michael Straube wrote:
> The function rtw_hal_xmit() returns true or false.
> Change the return type from s32 to bool.
[]
> diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c 
> b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
[]
> @@ -598,7 +598,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt,
>   *   truedump packet directly
>   *   false   enqueue packet
>   */
> -s32 rtw_hal_xmit(struct adapter *adapt, struct xmit_frame *pxmitframe)
> +bool rtw_hal_xmit(struct adapter *adapt, struct xmit_frame *pxmitframe)
>  {
>   s32 res;

Does "s32 res" need changing to bool too?




[PATCH 4/5] staging: rtl8188eu: change return type of rtw_hal_xmit()

2018-10-27 Thread Michael Straube
The function rtw_hal_xmit() returns true or false.
Change the return type from s32 to bool.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c | 2 +-
 drivers/staging/rtl8188eu/include/hal_intf.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c 
b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
index 69a0edd27710..35bc8fc32db1 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
@@ -598,7 +598,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt,
  * truedump packet directly
  * false   enqueue packet
  */
-s32 rtw_hal_xmit(struct adapter *adapt, struct xmit_frame *pxmitframe)
+bool rtw_hal_xmit(struct adapter *adapt, struct xmit_frame *pxmitframe)
 {
s32 res;
struct xmit_buf *pxmitbuf = NULL;
diff --git a/drivers/staging/rtl8188eu/include/hal_intf.h 
b/drivers/staging/rtl8188eu/include/hal_intf.h
index e5be27af7bf5..8b65fcba1967 100644
--- a/drivers/staging/rtl8188eu/include/hal_intf.h
+++ b/drivers/staging/rtl8188eu/include/hal_intf.h
@@ -185,7 +185,7 @@ u32 rtw_hal_inirp_init(struct adapter *padapter);
 void   rtw_hal_inirp_deinit(struct adapter *padapter);
 void usb_intf_stop(struct adapter *padapter);
 
-s32rtw_hal_xmit(struct adapter *padapter, struct xmit_frame *pxmitframe);
+bool rtw_hal_xmit(struct adapter *padapter, struct xmit_frame *pxmitframe);
 s32rtw_hal_mgnt_xmit(struct adapter *padapter,
  struct xmit_frame *pmgntframe);
 
-- 
2.19.1