All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] staging: rtl8188eu: core: Remove unnecessary conditionals
@ 2014-06-22 11:01 Thomas Vegas
  2014-06-22 11:01 ` [PATCH 2/3] staging: rtl8188eu: core: Remove unnecessary parentheses Thomas Vegas
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Vegas @ 2014-06-22 11:01 UTC (permalink / raw)
  To: gregkh; +Cc: Thomas Vegas, Larry.Finger, navin.patidar, devel, linux-kernel

The variable 'pxmitbuf' is already set to NULL when entering the
function. We can remove the first conditional. When _rtw_queue_empty()
returns false, 'pxmitbuf' if not NULL. We can merge the second and
third conditional.

Signed-off-by: Thomas Vegas <thomas@grouk.net>
---
 drivers/staging/rtl8188eu/core/rtw_xmit.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index a113f0f..bb290a3 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -1226,9 +1226,7 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
 
 	spin_lock_irqsave(&pfree_queue->lock, irql);
 
-	if (_rtw_queue_empty(pfree_queue) == true) {
-		pxmitbuf = NULL;
-	} else {
+	if (_rtw_queue_empty(pfree_queue) == false) {
 		phead = get_list_head(pfree_queue);
 
 		plist = phead->next;
@@ -1236,9 +1234,6 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
 		pxmitbuf = container_of(plist, struct xmit_buf, list);
 
 		rtw_list_delete(&(pxmitbuf->list));
-	}
-
-	if (pxmitbuf !=  NULL) {
 		pxmitpriv->free_xmit_extbuf_cnt--;
 
 		pxmitbuf->priv_data = NULL;
-- 
1.8.5.5


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

* [PATCH 2/3] staging: rtl8188eu: core: Remove unnecessary parentheses
  2014-06-22 11:01 [PATCH 1/3] staging: rtl8188eu: core: Remove unnecessary conditionals Thomas Vegas
@ 2014-06-22 11:01 ` Thomas Vegas
  2014-06-22 11:01 ` [PATCH 3/3] staging: rtl8188eu: core: Remove extraneous blank lines Thomas Vegas
  2014-06-27  0:30 ` [PATCH 1/3] staging: rtl8188eu: core: Remove unnecessary conditionals Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Vegas @ 2014-06-22 11:01 UTC (permalink / raw)
  To: gregkh; +Cc: Thomas Vegas, Larry.Finger, navin.patidar, devel, linux-kernel

This patch removes unnecessary parentheses around structure member.

Signed-off-by: Thomas Vegas <thomas@grouk.net>
---
 drivers/staging/rtl8188eu/core/rtw_xmit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index bb290a3..4b93add 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -1233,7 +1233,7 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
 
 		pxmitbuf = container_of(plist, struct xmit_buf, list);
 
-		rtw_list_delete(&(pxmitbuf->list));
+		rtw_list_delete(&pxmitbuf->list);
 		pxmitpriv->free_xmit_extbuf_cnt--;
 
 		pxmitbuf->priv_data = NULL;
-- 
1.8.5.5


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

* [PATCH 3/3] staging: rtl8188eu: core: Remove extraneous blank lines
  2014-06-22 11:01 [PATCH 1/3] staging: rtl8188eu: core: Remove unnecessary conditionals Thomas Vegas
  2014-06-22 11:01 ` [PATCH 2/3] staging: rtl8188eu: core: Remove unnecessary parentheses Thomas Vegas
@ 2014-06-22 11:01 ` Thomas Vegas
  2014-06-27  0:30 ` [PATCH 1/3] staging: rtl8188eu: core: Remove unnecessary conditionals Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Vegas @ 2014-06-22 11:01 UTC (permalink / raw)
  To: gregkh; +Cc: Thomas Vegas, Larry.Finger, navin.patidar, devel, linux-kernel

Remove extraneous blank lines in rtw_alloc_xmitbuf_ext().

Signed-off-by: Thomas Vegas <thomas@grouk.net>
---
 drivers/staging/rtl8188eu/core/rtw_xmit.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 4b93add..101b19f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -1223,31 +1223,22 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
 	struct list_head *plist, *phead;
 	struct __queue *pfree_queue = &pxmitpriv->free_xmit_extbuf_queue;
 
-
 	spin_lock_irqsave(&pfree_queue->lock, irql);
-
 	if (_rtw_queue_empty(pfree_queue) == false) {
 		phead = get_list_head(pfree_queue);
-
 		plist = phead->next;
-
 		pxmitbuf = container_of(plist, struct xmit_buf, list);
 
 		rtw_list_delete(&pxmitbuf->list);
 		pxmitpriv->free_xmit_extbuf_cnt--;
-
 		pxmitbuf->priv_data = NULL;
 		/* pxmitbuf->ext_tag = true; */
-
 		if (pxmitbuf->sctx) {
 			DBG_88E("%s pxmitbuf->sctx is not NULL\n", __func__);
 			rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
 		}
 	}
-
 	spin_unlock_irqrestore(&pfree_queue->lock, irql);
-
-
 	return pxmitbuf;
 }
 
-- 
1.8.5.5


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

* Re: [PATCH 1/3] staging: rtl8188eu: core: Remove unnecessary conditionals
  2014-06-22 11:01 [PATCH 1/3] staging: rtl8188eu: core: Remove unnecessary conditionals Thomas Vegas
  2014-06-22 11:01 ` [PATCH 2/3] staging: rtl8188eu: core: Remove unnecessary parentheses Thomas Vegas
  2014-06-22 11:01 ` [PATCH 3/3] staging: rtl8188eu: core: Remove extraneous blank lines Thomas Vegas
@ 2014-06-27  0:30 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2014-06-27  0:30 UTC (permalink / raw)
  To: Thomas Vegas; +Cc: Larry.Finger, navin.patidar, devel, linux-kernel

On Sun, Jun 22, 2014 at 01:01:50PM +0200, Thomas Vegas wrote:
> The variable 'pxmitbuf' is already set to NULL when entering the
> function. We can remove the first conditional. When _rtw_queue_empty()
> returns false, 'pxmitbuf' if not NULL. We can merge the second and
> third conditional.
> 
> Signed-off-by: Thomas Vegas <thomas@grouk.net>
> ---
>  drivers/staging/rtl8188eu/core/rtw_xmit.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)

Due to changes by others in this file, your patches do not apply
anymore, sorry.

greg k-h

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

end of thread, other threads:[~2014-06-27  4:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-22 11:01 [PATCH 1/3] staging: rtl8188eu: core: Remove unnecessary conditionals Thomas Vegas
2014-06-22 11:01 ` [PATCH 2/3] staging: rtl8188eu: core: Remove unnecessary parentheses Thomas Vegas
2014-06-22 11:01 ` [PATCH 3/3] staging: rtl8188eu: core: Remove extraneous blank lines Thomas Vegas
2014-06-27  0:30 ` [PATCH 1/3] staging: rtl8188eu: core: Remove unnecessary conditionals Greg KH

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.