Skip to contentSkip to conversation

Staging: rtl8192u: r819xU_firmware: removed commented out variable

PATCH In review Tolga Ceylan 3 participants 9 messages Feb 20, 2015 – Mar 7, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 Staging: rtl8192u: r819xU_firmware: removed commented out variable

Removed commented out variable

---
 drivers/staging/rtl8192u/r819xU_firmware.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/rtl8192u/r819xU_firmware.c +0 -1
index c230be2..9d0067e 100644
@@ -37,7 +37,6 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
 	bool		    rt_status = true;
 	u16		    frag_threshold;
 	u16		    frag_length, frag_offset = 0;
-	//u16		    total_size;
 	int		    i;
 
 	rt_firmware	    *pfirmware = priv->pFirmware;
Signature · 1 line
2.3.0
#1 lore raw

PATCH 2/4 Staging: rtl8192u: r819xU_firmware: removed commented out assert

Removed an assert that was commented out. The comment provides no documentation value as rt_status is properly handled.

---
 drivers/staging/rtl8192u/r819xU_firmware.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/rtl8192u/r819xU_firmware.c +0 -2
index 9d0067e..6a818c4 100644
@@ -329,8 +329,6 @@ bool init_firmware(struct net_device *dev)
 	}
 
 	RT_TRACE(COMP_FIRMWARE, "Firmware Download Success\n");
-	//assert(pfirmware->firmware_status == FW_STATUS_5_READY, ("Firmware Download Fail\n"));
-
 	return rt_status;
 
 download_firmware_fail:
Signature · 1 line
2.3.0
#2 lore raw

PATCH 3/4 Staging: rtl9182u: r819xU_firmware: Replaced C99 comments with C89

In reply to Tolga Ceylan

Replaced C99 comments with C89.

---
 drivers/staging/rtl8192u/r819xU_firmware.c | 33 +++++++++++++++---------------
 1 file changed, 17 insertions(+), 16 deletions(-)
drivers/staging/rtl8192u/r819xU_firmware.c +17 -16
index 6a818c4..e7b2f33 100644
@@ -47,7 +47,7 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
 	u8		    index;
 
 	firmware_init_param(dev);
-	//Fragmentation might be required
+	/* Fragmentation might be required */
 	frag_threshold = pfirmware->cmdpacket_frag_thresold;
 	do {
 		if ((buffer_len - frag_offset) > frag_threshold) {
@@ -106,19 +106,20 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
 
 }
 
-//-----------------------------------------------------------------------------
-// Procedure:    Check whether main code is download OK. If OK, turn on CPU
-//
-// Description:   CPU register locates in different page against general register.
-//			    Switch to CPU register in the begin and switch back before return
-//
-//
-// Arguments:   The pointer of the adapter
-//
-// Returns:
-//        NDIS_STATUS_FAILURE - the following initialization process should be terminated
-//        NDIS_STATUS_SUCCESS - if firmware initialization process success
-//-----------------------------------------------------------------------------
+/*
+ * Procedure:	Check whether main code is download OK. If OK, turn on CPU
+ *
+ * Description:	CPU register locates in different page against general register.
+ *	    Switch to CPU register in the begin and switch back before return
+ *
+ *
+ * Arguments:   The pointer of the adapter
+ *
+ * Returns:
+ *        NDIS_STATUS_FAILURE - the following initialization process should
+ *				be terminated
+ *        NDIS_STATUS_SUCCESS - if firmware initialization process success
+ */
 static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
 {
 	bool		rt_status = true;
@@ -221,7 +222,7 @@ bool init_firmware(struct net_device *dev)
 		/* it is called by reset */
 		rst_opt = OPT_SYSTEM_RESET;
 		starting_state = FW_INIT_STEP0_BOOT;
-		// TODO: system reset
+		/* TODO: system reset */
 
 	} else if (pfirmware->firmware_status == FW_STATUS_5_READY) {
 		/* it is called by Initialize */
@@ -290,7 +291,7 @@ bool init_firmware(struct net_device *dev)
 			 * will set polling bit when firmware code is also configured
 			 */
 			pfirmware->firmware_status = FW_STATUS_1_MOVE_BOOT_CODE;
-			//mdelay(1000);
+			/* mdelay(1000); */
 			/*
 			 * To initialize IMEM, CPU move code  from 0x80000080,
 			 * hence, we send 0x80 byte packet
Signature · 1 line
2.3.0
#3 lore raw

PATCH 4/4 Staging: rtl8192u: r819xU_firmware: added space after comma

In reply to Tolga Ceylan

Resolved space required after that ',' errors reported by checkpatch.

---
 drivers/staging/rtl8192u/r819xU_firmware.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
drivers/staging/rtl8192u/r819xU_firmware.c +11 -6
index e7b2f33..8e7fe82 100644
@@ -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;
@@ -91,7 +91,7 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
 		if (!priv->ieee80211->check_nic_enough_desc(dev, index) ||
 		       (!skb_queue_empty(&priv->ieee80211->skb_waitQ[index])) ||
 		       (priv->ieee80211->queue_stop)) {
-			RT_TRACE(COMP_FIRMWARE,"=====================================================> tx full!\n");
+			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);
@@ -242,7 +242,8 @@ bool init_firmware(struct net_device *dev)
 		 * 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);
+			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;
@@ -254,12 +255,14 @@ 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;
 			}
@@ -319,7 +322,9 @@ 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;
 			}
 
Signature · 1 line
2.3.0
#4 lore raw

Re: [PATCH 4/4] Staging: rtl8192u: r819xU_firmware: added space after comma

Quoted 1 line · Tolga Ceylan

Resolved space required after that ',' errors reported by checkpatch.

trivia:

drivers/staging/rtl8192u/r819xU_firmware.c

Quoted 1 line
drivers/staging/rtl8192u/r819xU_firmware.c +0 -0

[]

drivers/staging/rtl8192u/r819xU_firmware.c static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, · line 69

Quoted 6 lines
drivers/staging/rtl8192u/r819xU_firmware.c +1 -1
@@ -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));

Might as well remove the unnecessary cast too:

		memcpy(skb->cb, &dev, sizeof(dev));

but it might be better to avoid the memcpy and use an assign

	*(struct net_device *)skb->cb = dev;
#5 lore raw

Re: [PATCH 4/4] Staging: rtl8192u: r819xU_firmware: added space after comma

Quoted 9 lines · Joe Perches

Might as well remove the unnecessary cast too:

                memcpy(skb->cb, &dev, sizeof(dev));

but it might be better to avoid the memcpy and use an assign

        *(struct net_device *)skb->cb = dev;

I'll submit another patch for the memcpy change.

#6 lore raw

Re: [PATCH 4/4] Staging: rtl8192u: r819xU_firmware: added space after comma

Quoted 11 lines · Tolga Ceylan
Quoted 9 lines · Joe Perches

Might as well remove the unnecessary cast too:

                memcpy(skb->cb, &dev, sizeof(dev));

but it might be better to avoid the memcpy and use an assign

        *(struct net_device *)skb->cb = dev;

Should I sent a new set of patches (including memcpy change)? Or reply to the series with a single memcpy change patch?

#7 lore raw

Re: [PATCH 4/4] Staging: rtl8192u: r819xU_firmware: added space after comma

Quoted 6 lines · Tolga Ceylan
Quoted 5 lines · Tolga Ceylan
Quoted 4 lines · Joe Perches

Might as well remove the unnecessary cast too:

                memcpy(skb->cb, &dev, sizeof(dev));
but it might be better to avoid the memcpy and use an assign
        *(struct net_device *)skb->cb = dev;

[]

Quoted 2 lines

Should I sent a new set of patches (including memcpy change)? Or reply to the series with a single memcpy change patch?

Let Larry Finger decide if he wants the
patches at all first.

#8 lore raw

Re: [PATCH 4/4] Staging: rtl8192u: r819xU_firmware: added space after comma

In reply to Tolga Ceylan
Quoted 6 lines · Tolga Ceylan

Resolved space required after that ',' errors reported by checkpatch.

---
 drivers/staging/rtl8192u/r819xU_firmware.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

This patch doesn't apply to my tree for some reason :(