linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: rtl8712: remove blank line after brace {
@ 2022-04-02 12:28 Alaa Mohamed
  2022-04-02 12:28 ` [PATCH 2/2] staging: rtl8712: Fix Lines shouldn't end with '(' Alaa Mohamed
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alaa Mohamed @ 2022-04-02 12:28 UTC (permalink / raw)
  To: outreachy
  Cc: Larry.Finger, florian.c.schilhabel, gregkh, linux-staging,
	linux-kernel, eng.alaamohamedsoliman.am

Fix " CHECK: Blank lines aren't necessary after an open brace '{' "
Reported by checkpatch

Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
---
 drivers/staging/rtl8712/rtl8712_xmit.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c
index 84a22eba7ebf..05ba0ca7d627 100644
--- a/drivers/staging/rtl8712/rtl8712_xmit.c
+++ b/drivers/staging/rtl8712/rtl8712_xmit.c
@@ -147,7 +147,7 @@ static u32 get_ff_hwaddr(struct xmit_frame *pxmitframe)
 }
 
 static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv,
-					 struct hw_xmit *phwxmit,
+						struct hw_xmit *phwxmit,
 					 struct tx_servq *ptxservq,
 					 struct  __queue *pframe_queue)
 {
@@ -167,7 +167,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv,
 }
 
 static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
-				     struct hw_xmit *phwxmit_i, sint entry)
+					    struct hw_xmit *phwxmit_i, sint entry)
 {
 	unsigned long irqL0;
 	struct list_head *sta_plist, *sta_phead;
@@ -201,7 +201,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
 						tx_pending);
 			pframe_queue = &ptxservq->sta_pending;
 			pxmitframe = dequeue_one_xmitframe(pxmitpriv, phwxmit,
-				     ptxservq, pframe_queue);
+							   ptxservq, pframe_queue);
 			if (pxmitframe) {
 				phwxmit->accnt--;
 				goto exit_dequeue_xframe_ex;
@@ -292,14 +292,14 @@ void r8712_append_mpdu_unit(struct xmit_buf *pxmitbuf,
 	r8712_xmit_complete(padapter, pxmitframe);
 	if (pxmitframe->attrib.ether_type != 0x0806) {
 		if ((pxmitframe->attrib.ether_type != 0x888e) &&
-			(pxmitframe->attrib.dhcp_pkt != 1)) {
+		    (pxmitframe->attrib.dhcp_pkt != 1)) {
 			r8712_issue_addbareq_cmd(padapter,
-					pxmitframe->attrib.priority);
+						 pxmitframe->attrib.priority);
 		}
 	}
 	pxmitframe->last[0] = 1;
 	update_txdesc(pxmitframe, (uint *)(pxmitframe->buf_addr),
-		pxmitframe->attrib.last_txcmdsz);
+		      pxmitframe->attrib.last_txcmdsz);
 	/*padding zero */
 	last_txcmdsz = pxmitframe->attrib.last_txcmdsz;
 	padding_sz = (8 - (last_txcmdsz % 8));
@@ -334,7 +334,7 @@ void r8712_xmitframe_aggr_1st(struct xmit_buf *pxmitbuf,
 }
 
 u16 r8712_xmitframe_aggr_next(struct xmit_buf *pxmitbuf,
-			struct xmit_frame *pxmitframe)
+			      struct xmit_frame *pxmitframe)
 {
 	pxmitframe->pxmitbuf = pxmitbuf;
 	pxmitbuf->priv_data = pxmitframe;
@@ -388,7 +388,7 @@ void r8712_dump_aggr_xframe(struct xmit_buf *pxmitbuf,
 		/*default = 32 bytes for TX Desc*/
 	}
 	r8712_write_port(pxmitframe->padapter, RTL8712_DMA_H2CCMD,
-			total_length + TXDESC_SIZE, (u8 *)pxmitframe);
+			 total_length + TXDESC_SIZE, (u8 *)pxmitframe);
 }
 
 #endif
@@ -618,14 +618,13 @@ int r8712_xmitframe_complete(struct _adapter *padapter,
 	pxmitframe = dequeue_xframe_ex(pxmitpriv, phwxmits, hwentry);
 	/* need to remember the 1st frame */
 	if (pxmitframe) {
-
 #ifdef CONFIG_R8712_TX_AGGR
 		/* 1. dequeue 2nd frame
 		 * 2. aggr if 2nd xframe is dequeued, else dump directly
 		 */
 		if (AGGR_NR_HIGH_BOUND > 1)
 			p2ndxmitframe = dequeue_xframe_ex(pxmitpriv, phwxmits,
-							hwentry);
+							  hwentry);
 		if (pxmitframe->frame_tag != DATA_FRAMETAG) {
 			r8712_free_xmitbuf(pxmitpriv, pxmitbuf);
 			return false;
@@ -663,7 +662,7 @@ int r8712_xmitframe_complete(struct _adapter *padapter,
 		if (pxmitframe->frame_tag == DATA_FRAMETAG) {
 			if (pxmitframe->attrib.priority <= 15)
 				res = r8712_xmitframe_coalesce(padapter,
-					pxmitframe->pkt, pxmitframe);
+							       pxmitframe->pkt, pxmitframe);
 			/* always return ndis_packet after
 			 * r8712_xmitframe_coalesce
 			 */
@@ -715,10 +714,10 @@ static void dump_xframe(struct _adapter *padapter,
 		ff_hwaddr = get_ff_hwaddr(pxmitframe);
 #ifdef CONFIG_R8712_TX_AGGR
 		r8712_write_port(padapter, RTL8712_DMA_H2CCMD, w_sz,
-				(unsigned char *)pxmitframe);
+				 (unsigned char *)pxmitframe);
 #else
 		r8712_write_port(padapter, ff_hwaddr, w_sz,
-			   (unsigned char *)pxmitframe);
+				 (unsigned char *)pxmitframe);
 #endif
 		mem_addr += w_sz;
 		mem_addr = (u8 *)RND4(((addr_t)(mem_addr)));
-- 
2.35.1


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

* [PATCH 2/2] staging: rtl8712: Fix Lines shouldn't end with '('
  2022-04-02 12:28 [PATCH 1/2] staging: rtl8712: remove blank line after brace { Alaa Mohamed
@ 2022-04-02 12:28 ` Alaa Mohamed
  2022-04-03  8:57   ` Greg KH
  2022-04-02 16:49 ` [PATCH 1/2] staging: rtl8712: remove blank line after brace { Larry Finger
  2022-04-04 12:51 ` Dan Carpenter
  2 siblings, 1 reply; 5+ messages in thread
From: Alaa Mohamed @ 2022-04-02 12:28 UTC (permalink / raw)
  To: outreachy
  Cc: Larry.Finger, florian.c.schilhabel, gregkh, linux-staging,
	linux-kernel, eng.alaamohamedsoliman.am

Fix " CHECK: Lines should not end with a '(' "
Reported by checkpatch

Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
---
 drivers/staging/rtl8712/rtl8712_xmit.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c
index 05ba0ca7d627..d43c097f30c3 100644
--- a/drivers/staging/rtl8712/rtl8712_xmit.c
+++ b/drivers/staging/rtl8712/rtl8712_xmit.c
@@ -638,16 +638,12 @@ int r8712_xmitframe_complete(struct _adapter *padapter,
 		if (p2ndxmitframe) {
 			u16 total_length;
 
-			total_length = r8712_xmitframe_aggr_next(
-				pxmitbuf, p2ndxmitframe);
+			total_length = r8712_xmitframe_aggr_next(pxmitbuf, p2ndxmitframe);
 			do {
-				p2ndxmitframe = dequeue_xframe_ex(
-					pxmitpriv, phwxmits, hwentry);
+				p2ndxmitframe = dequeue_xframe_ex(pxmitpriv, phwxmits, hwentry);
 				if (p2ndxmitframe)
 					total_length =
-						r8712_xmitframe_aggr_next(
-							pxmitbuf,
-							p2ndxmitframe);
+						r8712_xmitframe_aggr_next(pxmitbuf, p2ndxmitframe);
 				else
 					break;
 			} while (total_length <= 0x1800 &&
-- 
2.35.1


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

* Re: [PATCH 1/2] staging: rtl8712: remove blank line after brace {
  2022-04-02 12:28 [PATCH 1/2] staging: rtl8712: remove blank line after brace { Alaa Mohamed
  2022-04-02 12:28 ` [PATCH 2/2] staging: rtl8712: Fix Lines shouldn't end with '(' Alaa Mohamed
@ 2022-04-02 16:49 ` Larry Finger
  2022-04-04 12:51 ` Dan Carpenter
  2 siblings, 0 replies; 5+ messages in thread
From: Larry Finger @ 2022-04-02 16:49 UTC (permalink / raw)
  To: Alaa Mohamed, outreachy
  Cc: florian.c.schilhabel, gregkh, linux-staging, linux-kernel

On 4/2/22 07:28, Alaa Mohamed wrote:
> Fix " CHECK: Blank lines aren't necessary after an open brace '{' "
> Reported by checkpatch
> 
> Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
> ---
>   drivers/staging/rtl8712/rtl8712_xmit.c | 25 ++++++++++++-------------
>   1 file changed, 12 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c
> index 84a22eba7ebf..05ba0ca7d627 100644
> --- a/drivers/staging/rtl8712/rtl8712_xmit.c
> +++ b/drivers/staging/rtl8712/rtl8712_xmit.c
> @@ -147,7 +147,7 @@ static u32 get_ff_hwaddr(struct xmit_frame *pxmitframe)
>   }
>   
>   static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv,
> -					 struct hw_xmit *phwxmit,
> +						struct hw_xmit *phwxmit,
>   					 struct tx_servq *ptxservq,
>   					 struct  __queue *pframe_queue)
>   {
> @@ -167,7 +167,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv,
>   }
>   
>   static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
> -				     struct hw_xmit *phwxmit_i, sint entry)
> +					    struct hw_xmit *phwxmit_i, sint entry)
>   {
>   	unsigned long irqL0;
>   	struct list_head *sta_plist, *sta_phead;
> @@ -201,7 +201,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
>   						tx_pending);
>   			pframe_queue = &ptxservq->sta_pending;
>   			pxmitframe = dequeue_one_xmitframe(pxmitpriv, phwxmit,
> -				     ptxservq, pframe_queue);
> +							   ptxservq, pframe_queue);
>   			if (pxmitframe) {
>   				phwxmit->accnt--;
>   				goto exit_dequeue_xframe_ex;
> @@ -292,14 +292,14 @@ void r8712_append_mpdu_unit(struct xmit_buf *pxmitbuf,
>   	r8712_xmit_complete(padapter, pxmitframe);
>   	if (pxmitframe->attrib.ether_type != 0x0806) {
>   		if ((pxmitframe->attrib.ether_type != 0x888e) &&
> -			(pxmitframe->attrib.dhcp_pkt != 1)) {
> +		    (pxmitframe->attrib.dhcp_pkt != 1)) {
>   			r8712_issue_addbareq_cmd(padapter,
> -					pxmitframe->attrib.priority);
> +						 pxmitframe->attrib.priority);
>   		}
>   	}
>   	pxmitframe->last[0] = 1;
>   	update_txdesc(pxmitframe, (uint *)(pxmitframe->buf_addr),
> -		pxmitframe->attrib.last_txcmdsz);
> +		      pxmitframe->attrib.last_txcmdsz);
>   	/*padding zero */
>   	last_txcmdsz = pxmitframe->attrib.last_txcmdsz;
>   	padding_sz = (8 - (last_txcmdsz % 8));
> @@ -334,7 +334,7 @@ void r8712_xmitframe_aggr_1st(struct xmit_buf *pxmitbuf,
>   }
>   
>   u16 r8712_xmitframe_aggr_next(struct xmit_buf *pxmitbuf,
> -			struct xmit_frame *pxmitframe)
> +			      struct xmit_frame *pxmitframe)
>   {
>   	pxmitframe->pxmitbuf = pxmitbuf;
>   	pxmitbuf->priv_data = pxmitframe;
> @@ -388,7 +388,7 @@ void r8712_dump_aggr_xframe(struct xmit_buf *pxmitbuf,
>   		/*default = 32 bytes for TX Desc*/
>   	}
>   	r8712_write_port(pxmitframe->padapter, RTL8712_DMA_H2CCMD,
> -			total_length + TXDESC_SIZE, (u8 *)pxmitframe);
> +			 total_length + TXDESC_SIZE, (u8 *)pxmitframe);
>   }
>   
>   #endif
> @@ -618,14 +618,13 @@ int r8712_xmitframe_complete(struct _adapter *padapter,
>   	pxmitframe = dequeue_xframe_ex(pxmitpriv, phwxmits, hwentry);
>   	/* need to remember the 1st frame */
>   	if (pxmitframe) {
> -
>   #ifdef CONFIG_R8712_TX_AGGR
>   		/* 1. dequeue 2nd frame
>   		 * 2. aggr if 2nd xframe is dequeued, else dump directly
>   		 */
>   		if (AGGR_NR_HIGH_BOUND > 1)
>   			p2ndxmitframe = dequeue_xframe_ex(pxmitpriv, phwxmits,
> -							hwentry);
> +							  hwentry);
>   		if (pxmitframe->frame_tag != DATA_FRAMETAG) {
>   			r8712_free_xmitbuf(pxmitpriv, pxmitbuf);
>   			return false;
> @@ -663,7 +662,7 @@ int r8712_xmitframe_complete(struct _adapter *padapter,
>   		if (pxmitframe->frame_tag == DATA_FRAMETAG) {
>   			if (pxmitframe->attrib.priority <= 15)
>   				res = r8712_xmitframe_coalesce(padapter,
> -					pxmitframe->pkt, pxmitframe);
> +							       pxmitframe->pkt, pxmitframe);
>   			/* always return ndis_packet after
>   			 * r8712_xmitframe_coalesce
>   			 */
> @@ -715,10 +714,10 @@ static void dump_xframe(struct _adapter *padapter,
>   		ff_hwaddr = get_ff_hwaddr(pxmitframe);
>   #ifdef CONFIG_R8712_TX_AGGR
>   		r8712_write_port(padapter, RTL8712_DMA_H2CCMD, w_sz,
> -				(unsigned char *)pxmitframe);
> +				 (unsigned char *)pxmitframe);
>   #else
>   		r8712_write_port(padapter, ff_hwaddr, w_sz,
> -			   (unsigned char *)pxmitframe);
> +				 (unsigned char *)pxmitframe);
>   #endif
>   		mem_addr += w_sz;
>   		mem_addr = (u8 *)RND4(((addr_t)(mem_addr)));

Almost all of these changes are changing code alignment, NOT removing blank 
lines after a brace. Please do only one type of change for each patch, and 
please make the change indicated in the commit message.

NACK

Larry


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

* Re: [PATCH 2/2] staging: rtl8712: Fix Lines shouldn't end with '('
  2022-04-02 12:28 ` [PATCH 2/2] staging: rtl8712: Fix Lines shouldn't end with '(' Alaa Mohamed
@ 2022-04-03  8:57   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2022-04-03  8:57 UTC (permalink / raw)
  To: Alaa Mohamed
  Cc: outreachy, Larry.Finger, florian.c.schilhabel, linux-staging,
	linux-kernel

On Sat, Apr 02, 2022 at 02:28:17PM +0200, Alaa Mohamed wrote:
> Fix " CHECK: Lines should not end with a '(' "
> Reported by checkpatch
> 
> Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
> ---
>  drivers/staging/rtl8712/rtl8712_xmit.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c
> index 05ba0ca7d627..d43c097f30c3 100644
> --- a/drivers/staging/rtl8712/rtl8712_xmit.c
> +++ b/drivers/staging/rtl8712/rtl8712_xmit.c
> @@ -638,16 +638,12 @@ int r8712_xmitframe_complete(struct _adapter *padapter,
>  		if (p2ndxmitframe) {
>  			u16 total_length;
>  
> -			total_length = r8712_xmitframe_aggr_next(
> -				pxmitbuf, p2ndxmitframe);
> +			total_length = r8712_xmitframe_aggr_next(pxmitbuf, p2ndxmitframe);
>  			do {
> -				p2ndxmitframe = dequeue_xframe_ex(
> -					pxmitpriv, phwxmits, hwentry);
> +				p2ndxmitframe = dequeue_xframe_ex(pxmitpriv, phwxmits, hwentry);
>  				if (p2ndxmitframe)
>  					total_length =
> -						r8712_xmitframe_aggr_next(
> -							pxmitbuf,
> -							p2ndxmitframe);
> +						r8712_xmitframe_aggr_next(pxmitbuf, p2ndxmitframe);

And now you went over 80 columns :(

You can do this better so that you still wrap lines, but do not trail
with a '(' character.

thanks,

greg k-h

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

* Re: [PATCH 1/2] staging: rtl8712: remove blank line after brace {
  2022-04-02 12:28 [PATCH 1/2] staging: rtl8712: remove blank line after brace { Alaa Mohamed
  2022-04-02 12:28 ` [PATCH 2/2] staging: rtl8712: Fix Lines shouldn't end with '(' Alaa Mohamed
  2022-04-02 16:49 ` [PATCH 1/2] staging: rtl8712: remove blank line after brace { Larry Finger
@ 2022-04-04 12:51 ` Dan Carpenter
  2 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2022-04-04 12:51 UTC (permalink / raw)
  To: Alaa Mohamed
  Cc: outreachy, Larry.Finger, florian.c.schilhabel, gregkh,
	linux-staging, linux-kernel

On Sat, Apr 02, 2022 at 02:28:16PM +0200, Alaa Mohamed wrote:
> Fix " CHECK: Blank lines aren't necessary after an open brace '{' "
> Reported by checkpatch
> 
> Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
> ---
>  drivers/staging/rtl8712/rtl8712_xmit.c | 25 ++++++++++++-------------
>  1 file changed, 12 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/staging/rtl8712/rtl8712_xmit.c b/drivers/staging/rtl8712/rtl8712_xmit.c
> index 84a22eba7ebf..05ba0ca7d627 100644
> --- a/drivers/staging/rtl8712/rtl8712_xmit.c
> +++ b/drivers/staging/rtl8712/rtl8712_xmit.c
> @@ -147,7 +147,7 @@ static u32 get_ff_hwaddr(struct xmit_frame *pxmitframe)
>  }
>  
>  static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv,
> -					 struct hw_xmit *phwxmit,
> +						struct hw_xmit *phwxmit,
>  					 struct tx_servq *ptxservq,
>  					 struct  __queue *pframe_queue)
>  {

Try be more aware of the surrounding code.

regards,
dan carpenter


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

end of thread, other threads:[~2022-04-04 12:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-02 12:28 [PATCH 1/2] staging: rtl8712: remove blank line after brace { Alaa Mohamed
2022-04-02 12:28 ` [PATCH 2/2] staging: rtl8712: Fix Lines shouldn't end with '(' Alaa Mohamed
2022-04-03  8:57   ` Greg KH
2022-04-02 16:49 ` [PATCH 1/2] staging: rtl8712: remove blank line after brace { Larry Finger
2022-04-04 12:51 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).