* [PATCH] Staging: rtl8188eu: Lines over 80 characters fixed.
@ 2014-08-04 22:45 Adrian Remonda
2014-08-04 22:52 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Adrian Remonda @ 2014-08-04 22:45 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* Re: [PATCH] Staging: rtl8188eu: Lines over 80 characters fixed.
2014-08-04 22:45 [PATCH] Staging: rtl8188eu: Lines over 80 characters fixed Adrian Remonda
@ 2014-08-04 22:52 ` Joe Perches
2014-08-07 21:45 ` AdrianRemonda
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2014-08-04 22:52 UTC (permalink / raw)
To: Adrian Remonda; +Cc: gregkh, Larry.Finger, devel, linux-kernel
On Tue, 2014-08-05 at 00:45 +0200, Adrian Remonda wrote:
> 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.
[]
> 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);
Several bits of this are not nice.
the +4 seems senseless.
zalloc followed by a memset(,0,) is senseless.
N_BYTE_ALIGNMENT seems senseless as alloc is
suitable for any alignmet.
btw: The merge window is open, please be patient
with any staging patch during the merge window.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Staging: rtl8188eu: Lines over 80 characters fixed.
2014-08-04 22:52 ` Joe Perches
@ 2014-08-07 21:45 ` AdrianRemonda
2014-08-08 9:10 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: AdrianRemonda @ 2014-08-07 21:45 UTC (permalink / raw)
To: Joe Perches; +Cc: gregkh, Larry.Finger, devel, linux-kernel
On Mon, Aug 04, 2014 at 03:52:17PM -0700, Joe Perches wrote:
> On Tue, 2014-08-05 at 00:45 +0200, Adrian Remonda wrote:
> > 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.
> []
> > 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);
>
> Several bits of this are not nice.
>
> the +4 seems senseless.
> zalloc followed by a memset(,0,) is senseless.
> N_BYTE_ALIGNMENT seems senseless as alloc is
> suitable for any alignmet.
>
> btw: The merge window is open, please be patient
> with any staging patch during the merge window.
I have resent the changes now. Is this ok? Or should I wait until the merge
window is close?
Also N_BYTE_ALIGNMENT is being used by several files in the 8188, should
I remove this macro?
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Staging: rtl8188eu: Lines over 80 characters fixed.
2014-08-07 21:45 ` AdrianRemonda
@ 2014-08-08 9:10 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-08-08 9:10 UTC (permalink / raw)
To: AdrianRemonda; +Cc: Joe Perches, devel, gregkh, linux-kernel, Larry.Finger
On Thu, Aug 07, 2014 at 11:45:32PM +0200, AdrianRemonda wrote:
> I have resent the changes now. Is this ok? Or should I wait until the merge
> window is close?
Just send your patches. They will sit in Greg's inbox for a couple
weeks, but that's ok.
> Also N_BYTE_ALIGNMENT is being used by several files in the 8188, should
> I remove this macro?
kmalloc() returns properly aligned pointers.
Look at how N_BYTE_ALIGNMENT() is used and judge each time if it is
needed.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-08-08 9:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-04 22:45 [PATCH] Staging: rtl8188eu: Lines over 80 characters fixed Adrian Remonda
2014-08-04 22:52 ` Joe Perches
2014-08-07 21:45 ` AdrianRemonda
2014-08-08 9:10 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox