All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 1/2] Staging: rtl8188eu: Lines over 80 characters fixed.
@ 2014-08-07 21:37 Adrian Remonda
  2014-08-07 21:37 ` [PATCHv2 2/2] Staging: rtl8188eu: Removed unnecessarry code Adrian Remonda
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Remonda @ 2014-08-07 21:37 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, devel, linux-kernel, Adrian Remonda

This is a patch to the hal/rtl8188eu_recv.c file that fixes up a "line
over 80 characters" warning found by the checkpatch.pl tool.

Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
---
 drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c | 28 +++++++++++++++++---------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
index f25c87c..8be4819 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
@@ -41,15 +41,19 @@ int	rtl8188eu_init_recv_priv(struct adapter *padapter)
 	/* init recv_buf */
 	_rtw_init_queue(&precvpriv->free_recv_buf_queue);
 
-	precvpriv->pallocated_recv_buf = kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_KERNEL);
+	precvpriv->pallocated_recv_buf =
+		kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_KERNEL);
 	if (precvpriv->pallocated_recv_buf == NULL) {
 		res = _FAIL;
-		RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("alloc recv_buf fail!\n"));
+		RT_TRACE(_module_rtl871x_recv_c_, _drv_err_,
+				("alloc recv_buf fail!\n"));
 		goto exit;
 	}
-	memset(precvpriv->pallocated_recv_buf, 0, NR_RECVBUFF * sizeof(struct recv_buf) + 4);
+	memset(precvpriv->pallocated_recv_buf, 0,
+			NR_RECVBUFF * sizeof(struct recv_buf) + 4);
 
-	precvpriv->precv_buf = (u8 *)N_BYTE_ALIGMENT((size_t)(precvpriv->pallocated_recv_buf), 4);
+	precvpriv->precv_buf = (u8 *)N_BYTE_ALIGMENT((size_t)
+			(precvpriv->pallocated_recv_buf), 4);
 
 
 	precvbuf = (struct recv_buf *)precvpriv->precv_buf;
@@ -66,20 +70,23 @@ int	rtl8188eu_init_recv_priv(struct adapter *padapter)
 	{
 		int i;
 		size_t tmpaddr = 0;
-		size_t alignment = 0;
+		size_t alignm = 0;
 		struct sk_buff *pskb = NULL;
 
 		skb_queue_head_init(&precvpriv->free_recv_skb_queue);
 
 		for (i = 0; i < NR_PREALLOC_RECV_SKB; i++) {
-			pskb = __netdev_alloc_skb(padapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, GFP_KERNEL);
+			pskb = __netdev_alloc_skb(padapter->pnetdev,
+					MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ,
+					GFP_KERNEL);
 			if (pskb) {
 				pskb->dev = padapter->pnetdev;
 				tmpaddr = (size_t)pskb->data;
-				alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
-				skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignment));
+				alignm = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
+				skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignm));
 
-				skb_queue_tail(&precvpriv->free_recv_skb_queue, pskb);
+				skb_queue_tail(&precvpriv->free_recv_skb_queue,
+						pskb);
 			}
 			pskb = NULL;
 		}
@@ -109,7 +116,8 @@ void rtl8188eu_free_recv_priv(struct adapter *padapter)
 
 
 	if (skb_queue_len(&precvpriv->free_recv_skb_queue))
-		DBG_88E(KERN_WARNING "free_recv_skb_queue not empty, %d\n", skb_queue_len(&precvpriv->free_recv_skb_queue));
+		DBG_88E(KERN_WARNING "free_recv_skb_queue not empty, %d\n",
+				skb_queue_len(&precvpriv->free_recv_skb_queue));
 
 	skb_queue_purge(&precvpriv->free_recv_skb_queue);
 }
-- 
2.0.4


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

* [PATCHv2 2/2] Staging: rtl8188eu: Removed unnecessarry code.
  2014-08-07 21:37 [PATCHv2 1/2] Staging: rtl8188eu: Lines over 80 characters fixed Adrian Remonda
@ 2014-08-07 21:37 ` Adrian Remonda
  2014-08-08  9:05   ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Remonda @ 2014-08-07 21:37 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, devel, linux-kernel, Adrian Remonda

This patch clear some code that was not doing any help.
Pointed out by Larry.Finger

Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
---
 drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
index 8be4819..bc275b2 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
@@ -42,18 +42,15 @@ int	rtl8188eu_init_recv_priv(struct adapter *padapter)
 	_rtw_init_queue(&precvpriv->free_recv_buf_queue);
 
 	precvpriv->pallocated_recv_buf =
-		kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_KERNEL);
+		kzalloc(NR_RECVBUFF * sizeof(struct recv_buf), GFP_KERNEL);
 	if (precvpriv->pallocated_recv_buf == NULL) {
 		res = _FAIL;
 		RT_TRACE(_module_rtl871x_recv_c_, _drv_err_,
 				("alloc recv_buf fail!\n"));
 		goto exit;
 	}
-	memset(precvpriv->pallocated_recv_buf, 0,
-			NR_RECVBUFF * sizeof(struct recv_buf) + 4);
 
-	precvpriv->precv_buf = (u8 *)N_BYTE_ALIGMENT((size_t)
-			(precvpriv->pallocated_recv_buf), 4);
+	precvpriv->precv_buf = precvpriv->pallocated_recv_buf;
 
 
 	precvbuf = (struct recv_buf *)precvpriv->precv_buf;
-- 
2.0.4


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

* Re: [PATCHv2 2/2] Staging: rtl8188eu: Removed unnecessarry code.
  2014-08-07 21:37 ` [PATCHv2 2/2] Staging: rtl8188eu: Removed unnecessarry code Adrian Remonda
@ 2014-08-08  9:05   ` Dan Carpenter
  2014-08-10  4:27     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2014-08-08  9:05 UTC (permalink / raw)
  To: Adrian Remonda; +Cc: gregkh, devel, linux-kernel, Larry.Finger

On Thu, Aug 07, 2014 at 11:37:51PM +0200, Adrian Remonda wrote:
> This patch clear some code that was not doing any help.
> Pointed out by Larry.Finger
> 

The patch is fine but the changelog doesn't inpsire confidence.  It
should say:

This patch removes some unneeded code.
1) kzalloc() allocates 4 extra bytes so that we can align the return
   value.  But actually the return value is already aligned so we can
   remove the + 4 and the call to N_BYTE_ALIGMENT().
2) The memset() isn't needed because kzalloc() zeroes the allocation.

Suggested-by: Larry Finger <Larry.Finger@lwfinger.net>

regards,
dan carpenter


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

* Re: [PATCHv2 2/2] Staging: rtl8188eu: Removed unnecessarry code.
  2014-08-08  9:05   ` Dan Carpenter
@ 2014-08-10  4:27     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2014-08-10  4:27 UTC (permalink / raw)
  To: Dan Carpenter, Adrian Remonda; +Cc: devel, linux-kernel, Larry.Finger

On Fri, Aug 08, 2014 at 12:05:38PM +0300, Dan Carpenter wrote:
> On Thu, Aug 07, 2014 at 11:37:51PM +0200, Adrian Remonda wrote:
> > This patch clear some code that was not doing any help.
> > Pointed out by Larry.Finger
> > 
> 
> The patch is fine but the changelog doesn't inpsire confidence.  It
> should say:
> 
> This patch removes some unneeded code.
> 1) kzalloc() allocates 4 extra bytes so that we can align the return
>    value.  But actually the return value is already aligned so we can
>    remove the + 4 and the call to N_BYTE_ALIGMENT().
> 2) The memset() isn't needed because kzalloc() zeroes the allocation.
> 
> Suggested-by: Larry Finger <Larry.Finger@lwfinger.net>

Adrian, can you please fix this up and resend the series based on Dan's
comments?

thanks,

greg k-h

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

end of thread, other threads:[~2014-08-10 12:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-07 21:37 [PATCHv2 1/2] Staging: rtl8188eu: Lines over 80 characters fixed Adrian Remonda
2014-08-07 21:37 ` [PATCHv2 2/2] Staging: rtl8188eu: Removed unnecessarry code Adrian Remonda
2014-08-08  9:05   ` Dan Carpenter
2014-08-10  4:27     ` 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.