diff mbox

[OPW,kernel] staging:rtl8187se: Change argument type in function to bool

Message ID 20140307173526.GA28300@himangi-Inspiron-N5110gmail.com
State New, archived
Headers show

Commit Message

HIMANGI SARAOGI March 7, 2014, 5:35 p.m. UTC
Since the argument morefrag is being used as a booleon in the function
rtl8180_tx, the type for the argument is changed to booleon in the
function definition and declaration. This ensures that the variable
morefrag is always in the range 0-1 and overflow dooes not cause errors
if it is assigned a value. Also, this improves code readability.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
---
 drivers/staging/rtl8187se/r8180.h      |    2 +-
 drivers/staging/rtl8187se/r8180_core.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Paul E. McKenney March 7, 2014, 5:47 p.m. UTC | #1
On Fri, Mar 07, 2014 at 11:05:26PM +0530, Himangi Saraogi wrote:
> Since the argument morefrag is being used as a booleon in the function
> rtl8180_tx, the type for the argument is changed to booleon in the
> function definition and declaration. This ensures that the variable
> morefrag is always in the range 0-1 and overflow dooes not cause errors
> if it is assigned a value. Also, this improves code readability.
> 
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>

Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

> ---
>  drivers/staging/rtl8187se/r8180.h      |    2 +-
>  drivers/staging/rtl8187se/r8180_core.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8187se/r8180.h b/drivers/staging/rtl8187se/r8180.h
> index 8999ec6..6527b7b 100644
> --- a/drivers/staging/rtl8187se/r8180.h
> +++ b/drivers/staging/rtl8187se/r8180.h
> @@ -639,7 +639,7 @@ typedef struct r8180_priv
>  		BE_PRIORITY)
> 
>  short rtl8180_tx(struct net_device *dev, u8 *skbuf, int len, int priority,
> -		 short morefrag, short fragdesc, int rate);
> +		 bool morefrag, short fragdesc, int rate);
> 
>  u8 read_nic_byte(struct net_device *dev, int x);
>  u32 read_nic_dword(struct net_device *dev, int x);
> diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c
> index 5e420e3..153df69 100644
> --- a/drivers/staging/rtl8187se/r8180_core.c
> +++ b/drivers/staging/rtl8187se/r8180_core.c
> @@ -1686,7 +1686,7 @@ static void rtl8180_prepare_beacon(struct net_device *dev)
>   * and kicks the NIC to ensure it does the DMA transfer.
>   */
>  short rtl8180_tx(struct net_device *dev, u8 *txbuf, int len, int priority,
> -		 short morefrag, short descfrag, int rate)
> +		 bool morefrag, short descfrag, int rate)
>  {
>  	struct r8180_priv *priv = ieee80211_priv(dev);
>  	u32 *tail, *temp_tail;
> -- 
> 1.7.9.5
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
diff mbox

Patch

diff --git a/drivers/staging/rtl8187se/r8180.h b/drivers/staging/rtl8187se/r8180.h
index 8999ec6..6527b7b 100644
--- a/drivers/staging/rtl8187se/r8180.h
+++ b/drivers/staging/rtl8187se/r8180.h
@@ -639,7 +639,7 @@  typedef struct r8180_priv
 		BE_PRIORITY)
 
 short rtl8180_tx(struct net_device *dev, u8 *skbuf, int len, int priority,
-		 short morefrag, short fragdesc, int rate);
+		 bool morefrag, short fragdesc, int rate);
 
 u8 read_nic_byte(struct net_device *dev, int x);
 u32 read_nic_dword(struct net_device *dev, int x);
diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c
index 5e420e3..153df69 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -1686,7 +1686,7 @@  static void rtl8180_prepare_beacon(struct net_device *dev)
  * and kicks the NIC to ensure it does the DMA transfer.
  */
 short rtl8180_tx(struct net_device *dev, u8 *txbuf, int len, int priority,
-		 short morefrag, short descfrag, int rate)
+		 bool morefrag, short descfrag, int rate)
 {
 	struct r8180_priv *priv = ieee80211_priv(dev);
 	u32 *tail, *temp_tail;