All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Outreachy kernel] [PATCH 1/3] staging: wilc1000: wilc_wlan.c: Modify return type of function tcp_process()
  2016-02-16 18:20 ` [PATCH 1/3] staging: wilc1000: wilc_wlan.c: Modify return type of function tcp_process() Janani Ravichandran
@ 2016-02-16 13:26   ` Daniel Baluta
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Baluta @ 2016-02-16 13:26 UTC (permalink / raw)
  To: Janani Ravichandran; +Cc: outreachy-kernel, linux-wireless

On Tue, Feb 16, 2016 at 8:20 PM, Janani Ravichandran
<janani.rvchndrn@gmail.com> wrote:
> Change function header for tcp_process() to return void as the return
> value of type int is not used anywhere.

Better squash all 3 patches here into one. It's easier to follow the change.


>
> Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
> ---
>  drivers/staging/wilc1000/wilc_wlan.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
> index a396ac9..c3ca662 100644
> --- a/drivers/staging/wilc1000/wilc_wlan.c
> +++ b/drivers/staging/wilc1000/wilc_wlan.c
> @@ -207,7 +207,7 @@ static inline int add_tcp_pending_ack(u32 ack, u32 session_index,
>         return 0;
>  }
>
> -static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
> +static inline void tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
>  {
>         int ret;
>         u8 *eth_hdr_ptr;
> @@ -274,7 +274,6 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
>                 ret = 0;
>         }
>         spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
> -       return ret;
>  }
>
>  static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
> --
> 2.5.0
>
> --
> 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/49ebb18eea61eff1ad7c0c4183312ea7d25da46d.1455645880.git.janani.rvchndrn%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.


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

* [PATCH 0/3] Modify function return type and remove local return variable
@ 2016-02-16 18:17 Janani Ravichandran
  2016-02-16 18:20 ` [PATCH 1/3] staging: wilc1000: wilc_wlan.c: Modify return type of function tcp_process() Janani Ravichandran
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Janani Ravichandran @ 2016-02-16 18:17 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: linux-wireless

This patchset modifies return type of tcp_process() from int to void as
the value returned is not used anywhere. Furthermore, the local variable
used in the return statement in the function is not being initialised in
all code paths. This variable has been removed as it is no longer
necessary.

Janani Ravichandran (3):
  staging: wilc1000: wilc_wlan.c: Modify return type of function
    add_tcp_pending_ack()
  staging: wilc1000: wilc_wlan.c: Remove local variable ret
  staging: wilc1000: wilc_wlan.c: Remove empty else blocks.

 drivers/staging/wilc1000/wilc_wlan.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

-- 
2.5.0



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

* [PATCH 1/3] staging: wilc1000: wilc_wlan.c: Modify return type of function tcp_process()
  2016-02-16 18:17 [PATCH 0/3] Modify function return type and remove local return variable Janani Ravichandran
@ 2016-02-16 18:20 ` Janani Ravichandran
  2016-02-16 13:26   ` [Outreachy kernel] " Daniel Baluta
  2016-02-16 18:22 ` [PATCH 2/3] staging: wilc1000: wilc_wlan.c: Remove local variable ret Janani Ravichandran
  2016-02-16 18:24 ` [PATCH 3/3] staging: wilc1000: wilc_wlan.c: Remove empty else blocks Janani Ravichandran
  2 siblings, 1 reply; 5+ messages in thread
From: Janani Ravichandran @ 2016-02-16 18:20 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: linux-wireless

Change function header for tcp_process() to return void as the return
value of type int is not used anywhere.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
---
 drivers/staging/wilc1000/wilc_wlan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index a396ac9..c3ca662 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -207,7 +207,7 @@ static inline int add_tcp_pending_ack(u32 ack, u32 session_index,
 	return 0;
 }
 
-static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
+static inline void tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
 {
 	int ret;
 	u8 *eth_hdr_ptr;
@@ -274,7 +274,6 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
 		ret = 0;
 	}
 	spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
-	return ret;
 }
 
 static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
-- 
2.5.0



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

* [PATCH 2/3] staging: wilc1000: wilc_wlan.c: Remove local variable ret
  2016-02-16 18:17 [PATCH 0/3] Modify function return type and remove local return variable Janani Ravichandran
  2016-02-16 18:20 ` [PATCH 1/3] staging: wilc1000: wilc_wlan.c: Modify return type of function tcp_process() Janani Ravichandran
@ 2016-02-16 18:22 ` Janani Ravichandran
  2016-02-16 18:24 ` [PATCH 3/3] staging: wilc1000: wilc_wlan.c: Remove empty else blocks Janani Ravichandran
  2 siblings, 0 replies; 5+ messages in thread
From: Janani Ravichandran @ 2016-02-16 18:22 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: linux-wireless

Remove local variable ret and all its initializations as it is no longer
useful.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
---
 drivers/staging/wilc1000/wilc_wlan.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index c3ca662..75b9bbb 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -209,7 +209,6 @@ static inline int add_tcp_pending_ack(u32 ack, u32 session_index,
 
 static inline void tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
 {
-	int ret;
 	u8 *eth_hdr_ptr;
 	u8 *buffer = tqe->buffer;
 	unsigned short h_proto;
@@ -268,10 +267,10 @@ static inline void tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
 			}
 
 		} else {
-			ret = 0;
+	
 		}
 	} else {
-		ret = 0;
+
 	}
 	spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
 }
-- 
2.5.0



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

* [PATCH 3/3] staging: wilc1000: wilc_wlan.c: Remove empty else blocks.
  2016-02-16 18:17 [PATCH 0/3] Modify function return type and remove local return variable Janani Ravichandran
  2016-02-16 18:20 ` [PATCH 1/3] staging: wilc1000: wilc_wlan.c: Modify return type of function tcp_process() Janani Ravichandran
  2016-02-16 18:22 ` [PATCH 2/3] staging: wilc1000: wilc_wlan.c: Remove local variable ret Janani Ravichandran
@ 2016-02-16 18:24 ` Janani Ravichandran
  2 siblings, 0 replies; 5+ messages in thread
From: Janani Ravichandran @ 2016-02-16 18:24 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: linux-wireless

Remove empty else blocks which are no longer necessary.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
---
 drivers/staging/wilc1000/wilc_wlan.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 75b9bbb..e5471a7 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -266,11 +266,7 @@ static inline void tcp_process(struct net_device *dev, struct txq_entry_t *tqe)
 				add_tcp_pending_ack(ack_no, i, tqe);
 			}
 
-		} else {
-	
 		}
-	} else {
-
 	}
 	spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
 }
-- 
2.5.0



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

end of thread, other threads:[~2016-02-16 13:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-16 18:17 [PATCH 0/3] Modify function return type and remove local return variable Janani Ravichandran
2016-02-16 18:20 ` [PATCH 1/3] staging: wilc1000: wilc_wlan.c: Modify return type of function tcp_process() Janani Ravichandran
2016-02-16 13:26   ` [Outreachy kernel] " Daniel Baluta
2016-02-16 18:22 ` [PATCH 2/3] staging: wilc1000: wilc_wlan.c: Remove local variable ret Janani Ravichandran
2016-02-16 18:24 ` [PATCH 3/3] staging: wilc1000: wilc_wlan.c: Remove empty else blocks Janani Ravichandran

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.