* [Outreachy][PATCH] staging: vt6655: Remove multiple assignments.
@ 2020-03-26 23:03 Briana Oursler
2020-03-27 0:59 ` [Outreachy kernel] " Lakshmi Ramasubramanian
0 siblings, 1 reply; 7+ messages in thread
From: Briana Oursler @ 2020-03-26 23:03 UTC (permalink / raw)
To: gregkh, forest, outreachy-kernel; +Cc: Briana Oursler
Removes multiple assignments at initialization and in computations to
better match Linux style. Issue found by checkpatch.pl.
Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
---
drivers/staging/vt6655/rxtx.c | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 37fcc42ed000..cdea2ff1c8f0 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -195,21 +195,29 @@ s_uGetRTSCTSRsvTime(
unsigned short wCurrentRate
)
{
- unsigned int uRrvTime, uRTSTime, uCTSTime, uAckTime, uDataTime;
-
- uRrvTime = uRTSTime = uCTSTime = uAckTime = uDataTime = 0;
+ unsigned int uRrvTime = 0;
+ unsigned int uRTSTime = 0;
+ unsigned int uCTSTime = 0;
+ unsigned int uAckTime = 0;
+ unsigned int uDataTime = 0;
uDataTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, cbFrameLength, wCurrentRate);
if (byRTSRsvType == 0) { /* RTSTxRrvTime_bb */
- uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopCCKBasicRate);
- uCTSTime = uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
+ uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType,
+ 20, pDevice->byTopCCKBasicRate);
+ uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType,
+ 14, pDevice->byTopCCKBasicRate);
+ uCTSTime = uAckTime;
} else if (byRTSRsvType == 1) { /* RTSTxRrvTime_ba, only in 2.4GHZ */
uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopCCKBasicRate);
uCTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
} else if (byRTSRsvType == 2) { /* RTSTxRrvTime_aa */
- uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopOFDMBasicRate);
- uCTSTime = uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
+ uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType,
+ 20, pDevice->byTopOFDMBasicRate);
+ uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType,
+ 14, pDevice->byTopOFDMBasicRate);
+ uCTSTime = uAckTime;
} else if (byRTSRsvType == 3) { /* CTSTxRrvTime_ba, only in 2.4GHZ */
uCTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
@@ -1040,16 +1048,14 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
bool bRTS = (bool)(fifo_ctl & FIFOCTL_RTS);
struct vnt_tx_desc *ptdCurr;
unsigned int cbHeaderLength = 0;
- void *pvRrvTime;
- struct vnt_mic_hdr *pMICHDR;
- void *pvRTS;
- void *pvCTS;
- void *pvTxDataHd;
+ void *pvRrvTime = NULL;
+ struct vnt_mic_hdr *pMICHDR = NULL;
+ void *pvRTS = NULL;
+ void *pvCTS = NULL;
+ void *pvTxDataHd = NULL;
unsigned short wTxBufSize; /* FFinfo size */
unsigned char byFBOption = AUTO_FB_NONE;
- pvRrvTime = pMICHDR = pvRTS = pvCTS = pvTxDataHd = NULL;
-
cbFrameSize = skb->len + 4;
if (info->control.hw_key) {
--
2.24.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] [Outreachy][PATCH] staging: vt6655: Remove multiple assignments.
2020-03-26 23:03 [Outreachy][PATCH] staging: vt6655: Remove multiple assignments Briana Oursler
@ 2020-03-27 0:59 ` Lakshmi Ramasubramanian
2020-03-27 2:35 ` [PATCH v2] " Briana Oursler
0 siblings, 1 reply; 7+ messages in thread
From: Lakshmi Ramasubramanian @ 2020-03-27 0:59 UTC (permalink / raw)
To: Briana Oursler, gregkh, forest, outreachy-kernel
On 3/26/20 4:03 PM, Briana Oursler wrote:
> Removes multiple assignments at initialization and in computations to
> better match Linux style. Issue found by checkpatch.pl.
Change "Removes" to "Remove".
thanks,
-lakshmi
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] staging: vt6655: Remove multiple assignments.
2020-03-27 0:59 ` [Outreachy kernel] " Lakshmi Ramasubramanian
@ 2020-03-27 2:35 ` Briana Oursler
2020-03-27 9:05 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Briana Oursler @ 2020-03-27 2:35 UTC (permalink / raw)
To: nramas, gregkh, forest, outreachy-kernel; +Cc: Briana Oursler
Remove multiple assignments at initialization and in computations to
better match Linux style. Issue found by checkpatch.pl.
Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
---
Changes in v2:
- Change removes to remove in patch description.
drivers/staging/vt6655/rxtx.c | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 37fcc42ed000..cdea2ff1c8f0 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -195,21 +195,29 @@ s_uGetRTSCTSRsvTime(
unsigned short wCurrentRate
)
{
- unsigned int uRrvTime, uRTSTime, uCTSTime, uAckTime, uDataTime;
-
- uRrvTime = uRTSTime = uCTSTime = uAckTime = uDataTime = 0;
+ unsigned int uRrvTime = 0;
+ unsigned int uRTSTime = 0;
+ unsigned int uCTSTime = 0;
+ unsigned int uAckTime = 0;
+ unsigned int uDataTime = 0;
uDataTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, cbFrameLength, wCurrentRate);
if (byRTSRsvType == 0) { /* RTSTxRrvTime_bb */
- uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopCCKBasicRate);
- uCTSTime = uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
+ uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType,
+ 20, pDevice->byTopCCKBasicRate);
+ uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType,
+ 14, pDevice->byTopCCKBasicRate);
+ uCTSTime = uAckTime;
} else if (byRTSRsvType == 1) { /* RTSTxRrvTime_ba, only in 2.4GHZ */
uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopCCKBasicRate);
uCTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
} else if (byRTSRsvType == 2) { /* RTSTxRrvTime_aa */
- uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopOFDMBasicRate);
- uCTSTime = uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
+ uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType,
+ 20, pDevice->byTopOFDMBasicRate);
+ uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType,
+ 14, pDevice->byTopOFDMBasicRate);
+ uCTSTime = uAckTime;
} else if (byRTSRsvType == 3) { /* CTSTxRrvTime_ba, only in 2.4GHZ */
uCTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
@@ -1040,16 +1048,14 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
bool bRTS = (bool)(fifo_ctl & FIFOCTL_RTS);
struct vnt_tx_desc *ptdCurr;
unsigned int cbHeaderLength = 0;
- void *pvRrvTime;
- struct vnt_mic_hdr *pMICHDR;
- void *pvRTS;
- void *pvCTS;
- void *pvTxDataHd;
+ void *pvRrvTime = NULL;
+ struct vnt_mic_hdr *pMICHDR = NULL;
+ void *pvRTS = NULL;
+ void *pvCTS = NULL;
+ void *pvTxDataHd = NULL;
unsigned short wTxBufSize; /* FFinfo size */
unsigned char byFBOption = AUTO_FB_NONE;
- pvRrvTime = pMICHDR = pvRTS = pvCTS = pvTxDataHd = NULL;
-
cbFrameSize = skb->len + 4;
if (info->control.hw_key) {
--
2.24.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] staging: vt6655: Remove multiple assignments.
2020-03-27 2:35 ` [PATCH v2] " Briana Oursler
@ 2020-03-27 9:05 ` Greg KH
2020-03-27 19:27 ` [Patch v3] " Briana Oursler
2020-03-29 1:12 ` [PATCH v2] " Briana Oursler
0 siblings, 2 replies; 7+ messages in thread
From: Greg KH @ 2020-03-27 9:05 UTC (permalink / raw)
To: Briana Oursler; +Cc: nramas, forest, outreachy-kernel
On Thu, Mar 26, 2020 at 07:35:50PM -0700, Briana Oursler wrote:
> Remove multiple assignments at initialization and in computations to
> better match Linux style. Issue found by checkpatch.pl.
>
> Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
> ---
>
> Changes in v2:
> - Change removes to remove in patch description.
>
> drivers/staging/vt6655/rxtx.c | 34 ++++++++++++++++++++--------------
> 1 file changed, 20 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> index 37fcc42ed000..cdea2ff1c8f0 100644
> --- a/drivers/staging/vt6655/rxtx.c
> +++ b/drivers/staging/vt6655/rxtx.c
> @@ -195,21 +195,29 @@ s_uGetRTSCTSRsvTime(
> unsigned short wCurrentRate
> )
> {
> - unsigned int uRrvTime, uRTSTime, uCTSTime, uAckTime, uDataTime;
> -
> - uRrvTime = uRTSTime = uCTSTime = uAckTime = uDataTime = 0;
> + unsigned int uRrvTime = 0;
> + unsigned int uRTSTime = 0;
> + unsigned int uCTSTime = 0;
> + unsigned int uAckTime = 0;
> + unsigned int uDataTime = 0;
>
> uDataTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, cbFrameLength, wCurrentRate);
> if (byRTSRsvType == 0) { /* RTSTxRrvTime_bb */
> - uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopCCKBasicRate);
> - uCTSTime = uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
> + uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType,
> + 20, pDevice->byTopCCKBasicRate);
While I understand the compulsion to want to fix up coding style issues
all over the place, don't mix changes like this with changes like:
> + uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType,
> + 14, pDevice->byTopCCKBasicRate);
> + uCTSTime = uAckTime;
That, as it makes it much harder to review when you do multiple
different things in the same patch.
And you didn't document that you did the reformatting here...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Patch v3] staging: vt6655: Remove multiple assignments.
2020-03-27 9:05 ` Greg KH
@ 2020-03-27 19:27 ` Briana Oursler
2020-03-30 8:17 ` [Outreachy kernel] " Stefano Brivio
2020-03-29 1:12 ` [PATCH v2] " Briana Oursler
1 sibling, 1 reply; 7+ messages in thread
From: Briana Oursler @ 2020-03-27 19:27 UTC (permalink / raw)
To: gregkh, nramas, forest, outreachy-kernel; +Cc: Briana Oursler
Remove multiple assignments at initialization and in computations to
better match Linux style. Issue found by checkpatch.pl.
Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
---
Changes in v3:
- Undo formatting changes to better focus scope of commit.
Changes in v2:
- Change removes to remove in patch description.
drivers/staging/vt6655/rxtx.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 37fcc42ed000..a1ddd7990e81 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -195,21 +195,25 @@ s_uGetRTSCTSRsvTime(
unsigned short wCurrentRate
)
{
- unsigned int uRrvTime, uRTSTime, uCTSTime, uAckTime, uDataTime;
-
- uRrvTime = uRTSTime = uCTSTime = uAckTime = uDataTime = 0;
+ unsigned int uRrvTime = 0;
+ unsigned int uRTSTime = 0;
+ unsigned int uCTSTime = 0;
+ unsigned int uAckTime = 0;
+ unsigned int uDataTime = 0;
uDataTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, cbFrameLength, wCurrentRate);
if (byRTSRsvType == 0) { /* RTSTxRrvTime_bb */
uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopCCKBasicRate);
- uCTSTime = uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
+ uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
+ uCTSTime = uAckTime;
} else if (byRTSRsvType == 1) { /* RTSTxRrvTime_ba, only in 2.4GHZ */
uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopCCKBasicRate);
uCTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
} else if (byRTSRsvType == 2) { /* RTSTxRrvTime_aa */
uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopOFDMBasicRate);
- uCTSTime = uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
+ uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
+ uCTSTime = uAckTime;
} else if (byRTSRsvType == 3) { /* CTSTxRrvTime_ba, only in 2.4GHZ */
uCTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
@@ -1040,16 +1044,14 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
bool bRTS = (bool)(fifo_ctl & FIFOCTL_RTS);
struct vnt_tx_desc *ptdCurr;
unsigned int cbHeaderLength = 0;
- void *pvRrvTime;
- struct vnt_mic_hdr *pMICHDR;
- void *pvRTS;
- void *pvCTS;
- void *pvTxDataHd;
+ void *pvRrvTime = NULL;
+ struct vnt_mic_hdr *pMICHDR = NULL;
+ void *pvRTS = NULL;
+ void *pvCTS = NULL;
+ void *pvTxDataHd = NULL;
unsigned short wTxBufSize; /* FFinfo size */
unsigned char byFBOption = AUTO_FB_NONE;
- pvRrvTime = pMICHDR = pvRTS = pvCTS = pvTxDataHd = NULL;
-
cbFrameSize = skb->len + 4;
if (info->control.hw_key) {
--
2.24.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] staging: vt6655: Remove multiple assignments.
2020-03-27 9:05 ` Greg KH
2020-03-27 19:27 ` [Patch v3] " Briana Oursler
@ 2020-03-29 1:12 ` Briana Oursler
1 sibling, 0 replies; 7+ messages in thread
From: Briana Oursler @ 2020-03-29 1:12 UTC (permalink / raw)
To: Greg KH; +Cc: nramas, forest, outreachy-kernel
On Fri, 2020-03-27 at 10:05 +0100, Greg KH wrote:
> On Thu, Mar 26, 2020 at 07:35:50PM -0700, Briana Oursler wrote:
> > Remove multiple assignments at initialization and in computations
> > to
> > better match Linux style. Issue found by checkpatch.pl.
> >
> > Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
> > ---
> >
> > Changes in v2:
> > - Change removes to remove in patch description.
> >
> > drivers/staging/vt6655/rxtx.c | 34 ++++++++++++++++++++-----------
> > ---
> > 1 file changed, 20 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/staging/vt6655/rxtx.c
> > b/drivers/staging/vt6655/rxtx.c
> > index 37fcc42ed000..cdea2ff1c8f0 100644
> > --- a/drivers/staging/vt6655/rxtx.c
> > +++ b/drivers/staging/vt6655/rxtx.c
> > @@ -195,21 +195,29 @@ s_uGetRTSCTSRsvTime(
> > unsigned short wCurrentRate
> > )
> > {
> > - unsigned int uRrvTime, uRTSTime, uCTSTime, uAckTime, uDataTime;
> > -
> > - uRrvTime = uRTSTime = uCTSTime = uAckTime = uDataTime = 0;
> > + unsigned int uRrvTime = 0;
> > + unsigned int uRTSTime = 0;
> > + unsigned int uCTSTime = 0;
> > + unsigned int uAckTime = 0;
> > + unsigned int uDataTime = 0;
> >
> > uDataTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType,
> > cbFrameLength, wCurrentRate);
> > if (byRTSRsvType == 0) { /* RTSTxRrvTime_bb */
> > - uRTSTime = BBuGetFrameTime(pDevice->byPreambleType,
> > byPktType, 20, pDevice->byTopCCKBasicRate);
> > - uCTSTime = uAckTime = BBuGetFrameTime(pDevice-
> > >byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
> > + uRTSTime = BBuGetFrameTime(pDevice->byPreambleType,
> > byPktType,
> > + 20, pDevice-
> > >byTopCCKBasicRate);
>
> While I understand the compulsion to want to fix up coding style
> issues
> all over the place, don't mix changes like this with changes like:
>
> > + uAckTime = BBuGetFrameTime(pDevice->byPreambleType,
> > byPktType,
> > + 14, pDevice-
> > >byTopCCKBasicRate);
> > + uCTSTime = uAckTime;
>
> That, as it makes it much harder to review when you do multiple
> different things in the same patch.
Thanks, I sent another version where I undid reformatting to try to
make the log more readable. I'm trying to be more disciplined in the
commits so that they are not so messy to read.
> And you didn't document that you did the reformatting here...
Thank you,
Briana
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] [Patch v3] staging: vt6655: Remove multiple assignments.
2020-03-27 19:27 ` [Patch v3] " Briana Oursler
@ 2020-03-30 8:17 ` Stefano Brivio
0 siblings, 0 replies; 7+ messages in thread
From: Stefano Brivio @ 2020-03-30 8:17 UTC (permalink / raw)
To: Briana Oursler; +Cc: gregkh, nramas, forest, outreachy-kernel
On Fri, 27 Mar 2020 12:27:00 -0700
Briana Oursler <briana.oursler@gmail.com> wrote:
> Remove multiple assignments at initialization and in computations to
> better match Linux style. Issue found by checkpatch.pl.
>
> Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
--
Stefano
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-03-30 8:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 23:03 [Outreachy][PATCH] staging: vt6655: Remove multiple assignments Briana Oursler
2020-03-27 0:59 ` [Outreachy kernel] " Lakshmi Ramasubramanian
2020-03-27 2:35 ` [PATCH v2] " Briana Oursler
2020-03-27 9:05 ` Greg KH
2020-03-27 19:27 ` [Patch v3] " Briana Oursler
2020-03-30 8:17 ` [Outreachy kernel] " Stefano Brivio
2020-03-29 1:12 ` [PATCH v2] " Briana Oursler
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.