All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8188eu: remove implicit bool->int conversions
@ 2017-09-22  9:39 Aishwarya Pant
  2017-09-22  9:52 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Aishwarya Pant @ 2017-09-22  9:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel; +Cc: outreachy-kernel

Implicit type conversions are bad; they hinder readability of code and have
potential to cause bugs. Here the variable wait_ack is always supplied a bool
value while in function declarations it is defined as an int type. Fix it by
defining wait_ack a bool type in all usages.

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 2db2ca6..99f3d5c 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -1196,7 +1196,7 @@ static void issue_assocreq(struct adapter *padapter)
 }
 
 /* when wait_ack is true, this function should be called at process context */
-static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int wait_ack)
+static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, bool wait_ack)
 {
 	int ret = _FAIL;
 	struct xmit_frame			*pmgntframe;
@@ -1316,7 +1316,7 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow
 }
 
 /* when wait_ack is true, this function should be called at process context */
-static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int wait_ack)
+static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, bool wait_ack)
 {
 	int ret = _FAIL;
 	struct xmit_frame			*pmgntframe;
@@ -1442,7 +1442,7 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int
 	return ret;
 }
 
-static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned short reason, u8 wait_ack)
+static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned short reason, bool wait_ack)
 {
 	struct xmit_frame			*pmgntframe;
 	struct pkt_attrib			*pattrib;
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: rtl8188eu: remove implicit bool->int conversions
  2017-09-22  9:39 [PATCH] staging: rtl8188eu: remove implicit bool->int conversions Aishwarya Pant
@ 2017-09-22  9:52 ` Julia Lawall
  2017-09-22 10:19   ` Aishwarya Pant
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2017-09-22  9:52 UTC (permalink / raw)
  To: Aishwarya Pant; +Cc: Greg Kroah-Hartman, devel, outreachy-kernel



On Fri, 22 Sep 2017, Aishwarya Pant wrote:

> Implicit type conversions are bad; they hinder readability of code and have
> potential to cause bugs. Here the variable wait_ack is always supplied a bool
> value while in function declarations it is defined as an int type. Fix it by
> defining wait_ack a bool type in all usages.

These are two patches on the same file.  They need to be in a series, so
Greg doesn't have to figure out whether they depend on each other.

Also, since you are changing the function headers, it would be very nice
if you could also change them to respect the 80 character limit.

julia

>
> Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
> ---
>  drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> index 2db2ca6..99f3d5c 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> @@ -1196,7 +1196,7 @@ static void issue_assocreq(struct adapter *padapter)
>  }
>
>  /* when wait_ack is true, this function should be called at process context */
> -static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int wait_ack)
> +static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, bool wait_ack)
>  {
>  	int ret = _FAIL;
>  	struct xmit_frame			*pmgntframe;
> @@ -1316,7 +1316,7 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow
>  }
>
>  /* when wait_ack is true, this function should be called at process context */
> -static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int wait_ack)
> +static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, bool wait_ack)
>  {
>  	int ret = _FAIL;
>  	struct xmit_frame			*pmgntframe;
> @@ -1442,7 +1442,7 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int
>  	return ret;
>  }
>
> -static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned short reason, u8 wait_ack)
> +static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned short reason, bool wait_ack)
>  {
>  	struct xmit_frame			*pmgntframe;
>  	struct pkt_attrib			*pattrib;
> --
> 2.7.4
>
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170922093939.GA29152%40aishwarya.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: rtl8188eu: remove implicit bool->int conversions
  2017-09-22  9:52 ` [Outreachy kernel] " Julia Lawall
@ 2017-09-22 10:19   ` Aishwarya Pant
  0 siblings, 0 replies; 3+ messages in thread
From: Aishwarya Pant @ 2017-09-22 10:19 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Greg Kroah-Hartman, devel, outreachy-kernel

On Fri, Sep 22, 2017 at 11:52:36AM +0200, Julia Lawall wrote:
> 
> 
> On Fri, 22 Sep 2017, Aishwarya Pant wrote:
> 
> > Implicit type conversions are bad; they hinder readability of code and have
> > potential to cause bugs. Here the variable wait_ack is always supplied a bool
> > value while in function declarations it is defined as an int type. Fix it by
> > defining wait_ack a bool type in all usages.
> 
> These are two patches on the same file.  They need to be in a series, so
> Greg doesn't have to figure out whether they depend on each other.
> 
> Also, since you are changing the function headers, it would be very nice
> if you could also change them to respect the 80 character limit.

Okay I'll create a patch series on rtl8188eu cleanups. Please drop this patch.

> 
> julia
> 
> >
> > Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
> > ---
> >  drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> > index 2db2ca6..99f3d5c 100644
> > --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> > +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> > @@ -1196,7 +1196,7 @@ static void issue_assocreq(struct adapter *padapter)
> >  }
> >
> >  /* when wait_ack is true, this function should be called at process context */
> > -static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int wait_ack)
> > +static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, bool wait_ack)
> >  {
> >  	int ret = _FAIL;
> >  	struct xmit_frame			*pmgntframe;
> > @@ -1316,7 +1316,7 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow
> >  }
> >
> >  /* when wait_ack is true, this function should be called at process context */
> > -static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int wait_ack)
> > +static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, bool wait_ack)
> >  {
> >  	int ret = _FAIL;
> >  	struct xmit_frame			*pmgntframe;
> > @@ -1442,7 +1442,7 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int
> >  	return ret;
> >  }
> >
> > -static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned short reason, u8 wait_ack)
> > +static int _issue_deauth(struct adapter *padapter, unsigned char *da, unsigned short reason, bool wait_ack)
> >  {
> >  	struct xmit_frame			*pmgntframe;
> >  	struct pkt_attrib			*pattrib;
> > --
> > 2.7.4
> >
> > --
> > 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 outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170922093939.GA29152%40aishwarya.
> > For more options, visit https://groups.google.com/d/optout.
> >


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-22 10:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22  9:39 [PATCH] staging: rtl8188eu: remove implicit bool->int conversions Aishwarya Pant
2017-09-22  9:52 ` [Outreachy kernel] " Julia Lawall
2017-09-22 10:19   ` Aishwarya Pant

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.