All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8192u: fix brace style coding issue in r819xU_firmware.c
       [not found] <yes>
@ 2014-09-04 13:50 ` linux.delve
  2014-09-04 14:09 ` Chaitra Ramaiah
  1 sibling, 0 replies; 7+ messages in thread
From: linux.delve @ 2014-09-04 13:50 UTC (permalink / raw)
  To: gregkh, burzalodowa, anarey, rmfrfs, gdonald, joe
  Cc: devel, linux-kernel, Chaitra Ramaiah

From: Chaitra Ramaiah <linux.delve@gmail.com>

*** BLURB HERE ***

root (1):
  Staging: rtl8192u: fix brace style coding issue in r819xU_firmware.c 
       This is a patch to the file r819xU_firmware.c that fixes a brace
    warning found by checkpatch.pl tool

 drivers/staging/rtl8192u/r819xU_firmware.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
1.7.9.5


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

* [PATCH] Staging: rtl8192u: fix brace style coding issue in r819xU_firmware.c
       [not found] <yes>
  2014-09-04 13:50 ` linux.delve
@ 2014-09-04 14:09 ` Chaitra Ramaiah
  2014-09-04 14:27   ` Greg KH
  1 sibling, 1 reply; 7+ messages in thread
From: Chaitra Ramaiah @ 2014-09-04 14:09 UTC (permalink / raw)
  To: gregkh, burzalodowa, anarey, rmfrfs, gdonald, joe
  Cc: devel, linux-kernel, Chaitra Ramaiah

*** BLURB HERE ***

root (1):
  Staging: rtl8192u: fix brace style coding issue in r819xU_firmware.c 
       This is a patch to the file r819xU_firmware.c that fixes a brace
    warning found by checkpatch.pl tool

 drivers/staging/rtl8192u/r819xU_firmware.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
1.7.9.5


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

* Re: [PATCH] Staging: rtl8192u: fix brace style coding issue in r819xU_firmware.c
  2014-09-04 14:09 ` Chaitra Ramaiah
@ 2014-09-04 14:27   ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2014-09-04 14:27 UTC (permalink / raw)
  To: Chaitra Ramaiah
  Cc: burzalodowa, anarey, rmfrfs, gdonald, joe, devel, linux-kernel

On Thu, Sep 04, 2014 at 07:39:11PM +0530, Chaitra Ramaiah wrote:
> *** BLURB HERE ***

No blurb???

:)

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

* [PATCH] Staging: rtl8192u: fix brace style coding issue in r819xU_firmware.c
@ 2014-09-04 15:11 Chaitra Ramaiah
  2014-09-04 15:11 ` Chaitra Ramaiah
  0 siblings, 1 reply; 7+ messages in thread
From: Chaitra Ramaiah @ 2014-09-04 15:11 UTC (permalink / raw)
  To: gregkh, burzalodowa, anarey, rmfrfs, gdonald, joe
  Cc: devel, linux-kernel, Chaitra Ramaiah

    This is a patch to the file r819xU_firmware.c that fixes a brace
    warning found by checkpatch.pl tool

 drivers/staging/rtl8192u/r819xU_firmware.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
1.7.9.5


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

* [PATCH] Staging: rtl8192u: fix brace style coding issue in r819xU_firmware.c
  2014-09-04 15:11 [PATCH] Staging: rtl8192u: fix brace style coding issue in r819xU_firmware.c Chaitra Ramaiah
@ 2014-09-04 15:11 ` Chaitra Ramaiah
  2014-09-04 15:28   ` Joe Perches
  2014-09-04 15:32   ` Joe Perches
  0 siblings, 2 replies; 7+ messages in thread
From: Chaitra Ramaiah @ 2014-09-04 15:11 UTC (permalink / raw)
  To: gregkh, burzalodowa, anarey, rmfrfs, gdonald, joe
  Cc: devel, linux-kernel, Chaitra Ramaiah

Signed-off-by: Chaitra Ramaiah <linux.delve@gmail.com>
---
 drivers/staging/rtl8192u/r819xU_firmware.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c
index 671cbe6..40e1ef5 100644
--- a/drivers/staging/rtl8192u/r819xU_firmware.c
+++ b/drivers/staging/rtl8192u/r819xU_firmware.c
@@ -153,11 +153,10 @@ static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
 			break;
 	}while(check_bootOk_time--);
 
-	if (!(CPU_status&CPU_GEN_BOOT_RDY)) {
+	if (!(CPU_status&CPU_GEN_BOOT_RDY))
 		goto CPUCheckMainCodeOKAndTurnOnCPU_Fail;
-	} else {
+	else
 		RT_TRACE(COMP_FIRMWARE, "Download Firmware: Boot ready!\n");
-	}
 
 	return rt_status;
 
-- 
1.7.9.5


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

* Re: [PATCH] Staging: rtl8192u: fix brace style coding issue in r819xU_firmware.c
  2014-09-04 15:11 ` Chaitra Ramaiah
@ 2014-09-04 15:28   ` Joe Perches
  2014-09-04 15:32   ` Joe Perches
  1 sibling, 0 replies; 7+ messages in thread
From: Joe Perches @ 2014-09-04 15:28 UTC (permalink / raw)
  To: Chaitra Ramaiah
  Cc: gregkh, burzalodowa, anarey, rmfrfs, gdonald, devel, linux-kernel

On Thu, 2014-09-04 at 20:41 +0530, Chaitra Ramaiah wrote:
> Signed-off-by: Chaitra Ramaiah <linux.delve@gmail.com>

Please put the commit log description from your
cover letter into this patch submission and only
send 1 email instead of than 2.

Rather than add these one-line-at-a-time type changes,
I'd just as soon see these all corrected at the same
time using something like this below.

It also allows git diff -w to be shown as empty in a
commit log and this should be verified before and after
as compilable with no changes using scripts/objdiff.

$ ./scripts/checkpatch.pl --fix-inplace --types=spacing --strict -f drivers/staging/rtl8192u/r819xU_firmware.c
$ git diff --stat -p drivers/staging/rtl8192u/r819xU_firmware.c
 drivers/staging/rtl8192u/r819xU_firmware.c | 52 +++++++++++++++---------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c
index 671cbe6..8e116f8 100644
--- a/drivers/staging/rtl8192u/r819xU_firmware.c
+++ b/drivers/staging/rtl8192u/r819xU_firmware.c
@@ -51,7 +51,7 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
 	frag_threshold = pfirmware->cmdpacket_frag_thresold;
 	do {
 		if ((buffer_len - frag_offset) > frag_threshold) {
-			frag_length = frag_threshold ;
+			frag_length = frag_threshold;
 			bLastIniPkt = 0;
 
 		} else {
@@ -66,7 +66,7 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
 		skb  = dev_alloc_skb(USB_HWDESC_HEADER_LEN + frag_length + 4);
 		if (!skb)
 			return false;
-		memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
+		memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
 		tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
 		tcb_desc->queue_index = TXCMD_QUEUE;
 		tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT;
@@ -78,19 +78,19 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
 		 * Transform from little endian to big endian
 		 * and pending  zero
 		 */
-		for(i=0 ; i < frag_length; i+=4) {
-			*seg_ptr++ = ((i+0)<frag_length)?code_virtual_address[i+3]:0;
-			*seg_ptr++ = ((i+1)<frag_length)?code_virtual_address[i+2]:0;
-			*seg_ptr++ = ((i+2)<frag_length)?code_virtual_address[i+1]:0;
-			*seg_ptr++ = ((i+3)<frag_length)?code_virtual_address[i+0]:0;
+		for (i = 0 ; i < frag_length; i += 4) {
+			*seg_ptr++ = ((i+0) < frag_length) ? code_virtual_address[i+3] : 0;
+			*seg_ptr++ = ((i+1) < frag_length) ? code_virtual_address[i+2] : 0;
+			*seg_ptr++ = ((i+2) < frag_length) ? code_virtual_address[i+1] : 0;
+			*seg_ptr++ = ((i+3) < frag_length) ? code_virtual_address[i+0] : 0;
 		}
-		tcb_desc->txbuf_size= (u16)i;
+		tcb_desc->txbuf_size = (u16)i;
 		skb_put(skb, i);
 
-		if (!priv->ieee80211->check_nic_enough_desc(dev,tcb_desc->queue_index)||
-			(!skb_queue_empty(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index]))||\
-			(priv->ieee80211->queue_stop) ) {
-			RT_TRACE(COMP_FIRMWARE,"=====================================================> tx full!\n");
+		if (!priv->ieee80211->check_nic_enough_desc(dev, tcb_desc->queue_index) || 
+			(!skb_queue_empty(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index])) || \
+			(priv->ieee80211->queue_stop)) {
+			RT_TRACE(COMP_FIRMWARE, "=====================================================> tx full!\n");
 			skb_queue_tail(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index], skb);
 		} else {
 			priv->ieee80211->softmac_hard_start_xmit(skb, dev);
@@ -99,7 +99,7 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
 		code_virtual_address += frag_length;
 		frag_offset += frag_length;
 
-	}while(frag_offset < buffer_len);
+	} while (frag_offset < buffer_len);
 
 	return rt_status;
 
@@ -131,7 +131,7 @@ static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
 		if (CPU_status&CPU_GEN_PUT_CODE_OK)
 			break;
 
-	}while(check_putcodeOK_time--);
+	} while (check_putcodeOK_time--);
 
 	if (!(CPU_status&CPU_GEN_PUT_CODE_OK)) {
 		RT_TRACE(COMP_ERR, "Download Firmware: Put code fail!\n");
@@ -151,7 +151,7 @@ static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
 
 		if (CPU_status&CPU_GEN_BOOT_RDY)
 			break;
-	}while(check_bootOk_time--);
+	} while (check_bootOk_time--);
 
 	if (!(CPU_status&CPU_GEN_BOOT_RDY)) {
 		goto CPUCheckMainCodeOKAndTurnOnCPU_Fail;
@@ -181,7 +181,7 @@ static bool CPUcheck_firmware_ready(struct net_device *dev)
 		if (CPU_status&CPU_GEN_FIRM_RDY)
 			break;
 
-	}while(check_time--);
+	} while (check_time--);
 
 	if (!(CPU_status&CPU_GEN_FIRM_RDY))
 		goto CPUCheckFirmwareReady_Fail;
@@ -217,17 +217,17 @@ bool init_firmware(struct net_device *dev)
 
 	RT_TRACE(COMP_FIRMWARE, " PlatformInitFirmware()==>\n");
 
-	if (pfirmware->firmware_status == FW_STATUS_0_INIT ) {
+	if (pfirmware->firmware_status == FW_STATUS_0_INIT) {
 		/* it is called by reset */
 		rst_opt = OPT_SYSTEM_RESET;
 		starting_state = FW_INIT_STEP0_BOOT;
 		// TODO: system reset
 
-	}else if (pfirmware->firmware_status == FW_STATUS_5_READY) {
+	} else if (pfirmware->firmware_status == FW_STATUS_5_READY) {
 		/* it is called by Initialize */
 		rst_opt = OPT_FIRMWARE_RESET;
 		starting_state = FW_INIT_STEP2_DATA;
-	}else {
+	} else {
 		 RT_TRACE(COMP_FIRMWARE, "PlatformInitFirmware: undefined firmware state\n");
 	}
 
@@ -235,14 +235,14 @@ bool init_firmware(struct net_device *dev)
 	 * Download boot, main, and data image for System reset.
 	 * Download data image for firmware reset
 	 */
-	for(init_step = starting_state; init_step <= FW_INIT_STEP2_DATA; init_step++) {
+	for (init_step = starting_state; init_step <= FW_INIT_STEP2_DATA; init_step++) {
 		/*
 		 * Open image file, and map file to continuous memory if open file success.
 		 * or read image file from array. Default load from IMG file
 		 */
 		if (rst_opt == OPT_SYSTEM_RESET) {
-			rc = request_firmware(&fw_entry, fw_name[init_step],&priv->udev->dev);
-			if (rc < 0 ) {
+			rc = request_firmware(&fw_entry, fw_name[init_step], &priv->udev->dev);
+			if (rc < 0) {
 				RT_TRACE(COMP_ERR, "request firmware fail!\n");
 				goto download_firmware_fail;
 			}
@@ -253,17 +253,17 @@ bool init_firmware(struct net_device *dev)
 			}
 
 			if (init_step != FW_INIT_STEP1_MAIN) {
-				memcpy(pfirmware->firmware_buf,fw_entry->data,fw_entry->size);
+				memcpy(pfirmware->firmware_buf, fw_entry->data, fw_entry->size);
 				mapped_file = pfirmware->firmware_buf;
 				file_length = fw_entry->size;
 			} else {
 				memset(pfirmware->firmware_buf, 0, 128);
-				memcpy(&pfirmware->firmware_buf[128],fw_entry->data,fw_entry->size);
+				memcpy(&pfirmware->firmware_buf[128], fw_entry->data, fw_entry->size);
 				mapped_file = pfirmware->firmware_buf;
 				file_length = fw_entry->size + 128;
 			}
 			pfirmware->firmware_buf_size = file_length;
-		}else if (rst_opt == OPT_FIRMWARE_RESET ) {
+		} else if (rst_opt == OPT_FIRMWARE_RESET) {
 			/* we only need to download data.img here */
 			mapped_file = pfirmware->firmware_buf;
 			file_length = pfirmware->firmware_buf_size;
@@ -318,7 +318,7 @@ bool init_firmware(struct net_device *dev)
 
 			rt_status = CPUcheck_firmware_ready(dev);
 			if (rt_status != TRUE) {
-				RT_TRACE(COMP_ERR, "CPUcheck_firmware_ready fail(%d)!\n",rt_status);
+				RT_TRACE(COMP_ERR, "CPUcheck_firmware_ready fail(%d)!\n", rt_status);
 				goto download_firmware_fail;
 			}
 



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

* Re: [PATCH] Staging: rtl8192u: fix brace style coding issue in r819xU_firmware.c
  2014-09-04 15:11 ` Chaitra Ramaiah
  2014-09-04 15:28   ` Joe Perches
@ 2014-09-04 15:32   ` Joe Perches
  1 sibling, 0 replies; 7+ messages in thread
From: Joe Perches @ 2014-09-04 15:32 UTC (permalink / raw)
  To: Chaitra Ramaiah
  Cc: gregkh, burzalodowa, anarey, rmfrfs, gdonald, devel, linux-kernel

On Thu, 2014-09-04 at 20:41 +0530, Chaitra Ramaiah wrote:
[]
> diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c
[]
> @@ -153,11 +153,10 @@ static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
>  			break;
>  	}while(check_bootOk_time--);
>  
> -	if (!(CPU_status&CPU_GEN_BOOT_RDY)) {
> +	if (!(CPU_status&CPU_GEN_BOOT_RDY))
>  		goto CPUCheckMainCodeOKAndTurnOnCPU_Fail;
> -	} else {
> +	else
>  		RT_TRACE(COMP_FIRMWARE, "Download Firmware: Boot ready!\n");
> -	}

This would be better as:

	if (!(CPU_status & CPU_GEN_BOOT_RDY))
		goto CPUCheckMainCodeOKandTurnOnCPU_Fail;

	RT_TRACE(etc...)

It'd be nice to eliminate the StudlyCaps and
rather long labels too.


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

end of thread, other threads:[~2014-09-04 15:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-04 15:11 [PATCH] Staging: rtl8192u: fix brace style coding issue in r819xU_firmware.c Chaitra Ramaiah
2014-09-04 15:11 ` Chaitra Ramaiah
2014-09-04 15:28   ` Joe Perches
2014-09-04 15:32   ` Joe Perches
     [not found] <yes>
2014-09-04 13:50 ` linux.delve
2014-09-04 14:09 ` Chaitra Ramaiah
2014-09-04 14: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.