Skip to contentSkip to conversation

staging: vt6656: Cleanup of the vnt_get_frame_time function

PATCH In review Oscar Carter 2 participants 7 messages Apr 7, 2020 – Apr 13, 2020 Staging

lore
Share & tools
lore
#0 lore raw

v3 cover staging: vt6656: Cleanup of the vnt_get_frame_time function

This patch series makes a cleanup of the vnt_get_frame_time function.

The first patch makes use of the define RATE_11M instead of a magic number. The second patch remove unnecessary local variable initialization.

Changelog v1 -> v2
- Not use the ARRAY_SIZE macro to compare against the tx_rate variable.

Changelog v2 -> v3
- Use the version number in the subject line of patch 1/2 and 2/2.

Oscar Carter (2):
staging: vt6656: Use define instead of magic number for tx_rate
staging: vt6656: Remove unnecessary local variable initialization

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

--
2.20.1

#1 lore raw

PATCH v3 1/2 staging: vt6656: Use define instead of magic number for tx_rate

Use the define RATE_11M present in the file "device.h" instead of the magic number 3. So the code is more clear.

---
 drivers/staging/vt6656/baseband.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/vt6656/baseband.c +2 -1
index a19a563d8bcc..092e56668a09 100644
@@ -24,6 +24,7 @@
 
 #include <linux/bits.h>
 #include <linux/kernel.h>
+#include "device.h"
 #include "mac.h"
 #include "baseband.h"
 #include "rf.h"
@@ -141,7 +142,7 @@ unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
 
 	rate = (unsigned int)vnt_frame_time[tx_rate];
 
-	if (tx_rate <= 3) {
+	if (tx_rate <= RATE_11M) {
 		if (preamble_type == 1)
 			preamble = 96;
 		else

--
2.20.1

#2 lore raw

Re: [PATCH v3 1/2] staging: vt6656: Use define instead of magic number for tx_rate

Quoted 8 lines · Oscar Carter

Use the define RATE_11M present in the file "device.h" instead of the magic number 3. So the code is more clear.

---
 drivers/staging/vt6656/baseband.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

This patch did not apply to my tree, please rebase and resend.

thanks,

greg k-h

#3 lore raw

Re: [PATCH v3 1/2] staging: vt6656: Use define instead of magic number for tx_rate

Quoted 4 lines · Greg Kroah-Hartman
Quoted 3 lines · Oscar Carter

Use the define RATE_11M present in the file "device.h" instead of the magic number 3. So the code is more clear.

Quoted 8 lines
Quoted 5 lines
---
 drivers/staging/vt6656/baseband.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

This patch did not apply to my tree, please rebase and resend.

I need to rebase only this patch for this serie so, it's necessary to send all the serie or only this patch?

If it's only this patch I need to indicate v4 in the subject or a v2 due it's related only with this patch?

Quoted 3 lines

thanks,

greg k-h

thanks,

oscar carter

#4 lore raw

Re: [PATCH v3 1/2] staging: vt6656: Use define instead of magic number for tx_rate

Quoted 11 lines · Oscar Carter
Quoted 10 lines · Greg Kroah-Hartman
Quoted 8 lines · Oscar Carter

Use the define RATE_11M present in the file "device.h" instead of the magic number 3. So the code is more clear.

---
 drivers/staging/vt6656/baseband.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 4 lines
Quoted 2 lines

This patch did not apply to my tree, please rebase and resend.

I need to rebase only this patch for this serie so, it's necessary to send all the serie or only this patch?

If I applied the other one, just this patch.

Quoted 2 lines

If it's only this patch I need to indicate v4 in the subject or a v2 due it's related only with this patch?

As so many of your patches were rejected because of this, rebase them all, and resend them all as a single patch series, so that I know what order to apply them in and have a chance to get it right :)

thanks,

greg k-h

#5 lore raw

Re: [PATCH v3 1/2] staging: vt6656: Use define instead of magic number for tx_rate

Quoted 17 lines · Greg Kroah-Hartman
Quoted 11 lines · Oscar Carter
Quoted 10 lines · Greg Kroah-Hartman
Quoted 8 lines · Oscar Carter

Use the define RATE_11M present in the file "device.h" instead of the magic number 3. So the code is more clear.

---
 drivers/staging/vt6656/baseband.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 4 lines
Quoted 2 lines

This patch did not apply to my tree, please rebase and resend.

I need to rebase only this patch for this serie so, it's necessary to send all the serie or only this patch?

Quoted 8 lines

If I applied the other one, just this patch.

Quoted 2 lines

If it's only this patch I need to indicate v4 in the subject or a v2 due it's related only with this patch?

As so many of your patches were rejected because of this, rebase them all, and resend them all as a single patch series, so that I know what order to apply them in and have a chance to get it right :)

Ok, I will create a patch series with all the rejected patches rebased.

Quoted 4 lines

thanks,

greg k-h

thanks,

oscar carter

#6 lore raw

PATCH v3 2/2 staging: vt6656: Remove unnecessary local variable initialization

In reply to Oscar Carter

Don't initialize the rate variable as it is set a few lines later.

---
 drivers/staging/vt6656/baseband.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6656/baseband.c +1 -1
index 092e56668a09..5d9bc97916a5 100644
@@ -135,7 +135,7 @@ unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
 {
 	unsigned int frame_time;
 	unsigned int preamble;
-	unsigned int rate = 0;
+	unsigned int rate;
 
 	if (tx_rate > RATE_54M)
 		return 0;

--
2.20.1