fix serveral checkpatch errors related to lines ending with a '(' by
refactoring the code lines
Signed-off-by: Tanjuate Brunostar <[email protected]>
---
drivers/staging/vt6655/rxtx.c | 149 ++++++++++++++--------------------
1 file changed, 63 insertions(+), 86 deletions(-)
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 1e5036121665..f9d0b00d7cff 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -141,13 +141,11 @@ static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate)
*/
static
unsigned int
-s_uGetTxRsvTime(
- struct vnt_private *pDevice,
- unsigned char byPktType,
- unsigned int cbFrameLength,
- unsigned short wRate,
- bool bNeedAck
-)
+s_uGetTxRsvTime(struct vnt_private *pDevice,
+ unsigned char byPktType,
+ unsigned int cbFrameLength,
+ unsigned short wRate,
+ bool bNeedAck)
{
unsigned int uDataTime, uAckTime;
@@ -215,19 +213,16 @@ static __le16 get_rtscts_time(struct vnt_private *priv,
/* byFreqType 0: 5GHz, 1:2.4Ghz */
static
-unsigned int
-s_uGetDataDuration(
- struct vnt_private *pDevice,
- unsigned char byDurType,
- unsigned int cbFrameLength,
- unsigned char byPktType,
- unsigned short wRate,
- bool bNeedAck,
- unsigned int uFragIdx,
- unsigned int cbLastFragmentSize,
- unsigned int uMACfragNum,
- unsigned char byFBOption
-)
+unsigned int s_uGetDataDuration(struct vnt_private *pDevice,
+ unsigned char byDurType,
+ unsigned int cbFrameLength,
+ unsigned char byPktType,
+ unsigned short wRate,
+ bool bNeedAck,
+ unsigned int uFragIdx,
+ unsigned int cbLastFragmentSize,
+ unsigned int uMACfragNum,
+ unsigned char byFBOption)
{
bool bLastFrag = false;
unsigned int uAckTime = 0, uNextPktTime = 0, len;
@@ -316,17 +311,13 @@ s_uGetDataDuration(
}
/* byFreqType: 0=>5GHZ 1=>2.4GHZ */
-static
-__le16
-s_uGetRTSCTSDuration(
- struct vnt_private *pDevice,
- unsigned char byDurType,
- unsigned int cbFrameLength,
- unsigned char byPktType,
- unsigned short wRate,
- bool bNeedAck,
- unsigned char byFBOption
-)
+static __le16 s_uGetRTSCTSDuration(struct vnt_private *pDevice,
+ unsigned char byDurType,
+ unsigned int cbFrameLength,
+ unsigned char byPktType,
+ unsigned short wRate,
+ bool bNeedAck,
+ unsigned char byFBOption)
{
unsigned int uCTSTime = 0, uDurTime = 0;
@@ -409,22 +400,18 @@ s_uGetRTSCTSDuration(
return cpu_to_le16((u16)uDurTime);
}
-static
-__le16
-s_uFillDataHead(
- struct vnt_private *pDevice,
- unsigned char byPktType,
- void *pTxDataHead,
- unsigned int cbFrameLength,
- unsigned int uDMAIdx,
- bool bNeedAck,
- unsigned int uFragIdx,
- unsigned int cbLastFragmentSize,
- unsigned int uMACfragNum,
- unsigned char byFBOption,
- unsigned short wCurrentRate,
- bool is_pspoll
-)
+static __le16 s_uFillDataHead(struct vnt_private *pDevice,
+ unsigned char byPktType,
+ void *pTxDataHead,
+ unsigned int cbFrameLength,
+ unsigned int uDMAIdx,
+ bool bNeedAck,
+ unsigned int uFragIdx,
+ unsigned int cbLastFragmentSize,
+ unsigned int uMACfragNum,
+ unsigned char byFBOption,
+ unsigned short wCurrentRate,
+ bool is_pspoll)
{
struct vnt_tx_datahead_ab *buf = pTxDataHead;
@@ -555,19 +542,15 @@ s_uFillDataHead(
return buf->duration;
}
-static
-void
-s_vFillRTSHead(
- struct vnt_private *pDevice,
- unsigned char byPktType,
- void *pvRTS,
- unsigned int cbFrameLength,
- bool bNeedAck,
- bool bDisCRC,
- struct ieee80211_hdr *hdr,
- unsigned short wCurrentRate,
- unsigned char byFBOption
-)
+static void s_vFillRTSHead(struct vnt_private *pDevice,
+ unsigned char byPktType,
+ void *pvRTS,
+ unsigned int cbFrameLength,
+ bool bNeedAck,
+ bool bDisCRC,
+ struct ieee80211_hdr *hdr,
+ unsigned short wCurrentRate,
+ unsigned char byFBOption)
{
unsigned int uRTSFrameLen = 20;
@@ -752,17 +735,15 @@ s_vFillRTSHead(
static
void
-s_vFillCTSHead(
- struct vnt_private *pDevice,
- unsigned int uDMAIdx,
- unsigned char byPktType,
- void *pvCTS,
- unsigned int cbFrameLength,
- bool bNeedAck,
- bool bDisCRC,
- unsigned short wCurrentRate,
- unsigned char byFBOption
-)
+s_vFillCTSHead(struct vnt_private *pDevice,
+ unsigned int uDMAIdx,
+ unsigned char byPktType,
+ void *pvCTS,
+ unsigned int cbFrameLength,
+ bool bNeedAck,
+ bool bDisCRC,
+ unsigned short wCurrentRate,
+ unsigned char byFBOption)
{
unsigned int uCTSFrameLen = 14;
@@ -868,21 +849,17 @@ s_vFillCTSHead(
-
* unsigned int cbFrameSize, Hdr+Payload+FCS
*/
-static
-void
-s_vGenerateTxParameter(
- struct vnt_private *pDevice,
- unsigned char byPktType,
- struct vnt_tx_fifo_head *tx_buffer_head,
- void *pvRrvTime,
- void *pvRTS,
- void *pvCTS,
- unsigned int cbFrameSize,
- bool bNeedACK,
- unsigned int uDMAIdx,
- void *psEthHeader,
- unsigned short wCurrentRate
-)
+static void s_vGenerateTxParameter(struct vnt_private *pDevice,
+ unsigned char byPktType,
+ struct vnt_tx_fifo_head *tx_buffer_head,
+ void *pvRrvTime,
+ void *pvRTS,
+ void *pvCTS,
+ unsigned int cbFrameSize,
+ bool bNeedACK,
+ unsigned int uDMAIdx,
+ void *psEthHeader,
+ unsigned short wCurrentRate)
{
u16 fifo_ctl = le16_to_cpu(tx_buffer_head->fifo_ctl);
bool bDisCRC = false;
--
2.34.1
On Sat, 2022-10-22 at 07:06 +0000, Tanjuate Brunostar wrote:
> fix serveral checkpatch errors related to lines ending with a '(' by
> refactoring the code lines
[]
> diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
[]
> @@ -141,13 +141,11 @@ static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate)
> */
> static
> unsigned int
> -s_uGetTxRsvTime(
> - struct vnt_private *pDevice,
> - unsigned char byPktType,
> - unsigned int cbFrameLength,
> - unsigned short wRate,
> - bool bNeedAck
> -)
> +s_uGetTxRsvTime(struct vnt_private *pDevice,
If you end up doing more work here, ou might consider removing the
Hungarian style notations
Maybe something like:
s_uGetTxRsvTime -> get_tx_rsv_time
> + unsigned char byPktType,
byPktType -> pkt_type
etc...
Perhaps patches by unique rename.
On Sat, Oct 22, 2022 at 8:18 AM Joe Perches <[email protected]> wrote:
>
> On Sat, 2022-10-22 at 07:06 +0000, Tanjuate Brunostar wrote:
> > fix serveral checkpatch errors related to lines ending with a '(' by
> > refactoring the code lines
> []
> > diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> []
> > @@ -141,13 +141,11 @@ static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate)
> > */
> > static
> > unsigned int
> > -s_uGetTxRsvTime(
> > - struct vnt_private *pDevice,
> > - unsigned char byPktType,
> > - unsigned int cbFrameLength,
> > - unsigned short wRate,
> > - bool bNeedAck
> > -)
> > +s_uGetTxRsvTime(struct vnt_private *pDevice,
>
> If you end up doing more work here, ou might consider removing the
> Hungarian style notations
>
> Maybe something like:
>
> s_uGetTxRsvTime -> get_tx_rsv_time
>
> > + unsigned char byPktType,
>
> byPktType -> pkt_type
>
> etc...
>
> Perhaps patches by unique rename.
>
Yes I plan on doing that as a separate patch. It could be overwhelming
keeping track of so many changes at a time
thanks
Tanju
On Sat, Oct 22, 2022 at 07:06:07AM +0000, Tanjuate Brunostar wrote:
> fix serveral checkpatch errors related to lines ending with a '(' by
> refactoring the code lines
>
> Signed-off-by: Tanjuate Brunostar <[email protected]>
> ---
> drivers/staging/vt6655/rxtx.c | 149 ++++++++++++++--------------------
> 1 file changed, 63 insertions(+), 86 deletions(-)
>
> diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> index 1e5036121665..f9d0b00d7cff 100644
> --- a/drivers/staging/vt6655/rxtx.c
> +++ b/drivers/staging/vt6655/rxtx.c
> @@ -141,13 +141,11 @@ static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate)
> */
> static
> unsigned int
> -s_uGetTxRsvTime(
> - struct vnt_private *pDevice,
> - unsigned char byPktType,
> - unsigned int cbFrameLength,
> - unsigned short wRate,
> - bool bNeedAck
> -)
> +s_uGetTxRsvTime(struct vnt_private *pDevice,
You have a strange mix of choices here for how you changed the code.
This time you did not move the "static" or "unsigned int" to the same
line as the function name, but then:
> + unsigned char byPktType,
> + unsigned int cbFrameLength,
> + unsigned short wRate,
> + bool bNeedAck)
> {
> unsigned int uDataTime, uAckTime;
>
> @@ -215,19 +213,16 @@ static __le16 get_rtscts_time(struct vnt_private *priv,
>
> /* byFreqType 0: 5GHz, 1:2.4Ghz */
> static
> -unsigned int
> -s_uGetDataDuration(
> - struct vnt_private *pDevice,
> - unsigned char byDurType,
> - unsigned int cbFrameLength,
> - unsigned char byPktType,
> - unsigned short wRate,
> - bool bNeedAck,
> - unsigned int uFragIdx,
> - unsigned int cbLastFragmentSize,
> - unsigned int uMACfragNum,
> - unsigned char byFBOption
> -)
> +unsigned int s_uGetDataDuration(struct vnt_private *pDevice,
You moved "unsigned int" here, but then:
> + unsigned char byDurType,
> + unsigned int cbFrameLength,
> + unsigned char byPktType,
> + unsigned short wRate,
> + bool bNeedAck,
> + unsigned int uFragIdx,
> + unsigned int cbLastFragmentSize,
> + unsigned int uMACfragNum,
> + unsigned char byFBOption)
> {
> bool bLastFrag = false;
> unsigned int uAckTime = 0, uNextPktTime = 0, len;
> @@ -316,17 +311,13 @@ s_uGetDataDuration(
> }
>
> /* byFreqType: 0=>5GHZ 1=>2.4GHZ */
> -static
> -__le16
> -s_uGetRTSCTSDuration(
> - struct vnt_private *pDevice,
> - unsigned char byDurType,
> - unsigned int cbFrameLength,
> - unsigned char byPktType,
> - unsigned short wRate,
> - bool bNeedAck,
> - unsigned char byFBOption
> -)
> +static __le16 s_uGetRTSCTSDuration(struct vnt_private *pDevice,
You did both the static and the return type here.
Pick one style and stick with it please. Consistancy matters, that is
why we have a coding style to start with. Brains and pattern matching
and all that.
In this case, this last one (both static and the return type), should be
used.
thanks,
greg k-h
On Sat, Oct 22, 2022 at 9:17 AM Greg KH <[email protected]> wrote:
>
> On Sat, Oct 22, 2022 at 07:06:07AM +0000, Tanjuate Brunostar wrote:
> > fix serveral checkpatch errors related to lines ending with a '(' by
> > refactoring the code lines
> >
> > Signed-off-by: Tanjuate Brunostar <[email protected]>
> > ---
> > drivers/staging/vt6655/rxtx.c | 149 ++++++++++++++--------------------
> > 1 file changed, 63 insertions(+), 86 deletions(-)
> >
> > diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> > index 1e5036121665..f9d0b00d7cff 100644
> > --- a/drivers/staging/vt6655/rxtx.c
> > +++ b/drivers/staging/vt6655/rxtx.c
> > @@ -141,13 +141,11 @@ static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate)
> > */
> > static
> > unsigned int
> > -s_uGetTxRsvTime(
> > - struct vnt_private *pDevice,
> > - unsigned char byPktType,
> > - unsigned int cbFrameLength,
> > - unsigned short wRate,
> > - bool bNeedAck
> > -)
> > +s_uGetTxRsvTime(struct vnt_private *pDevice,
>
> You have a strange mix of choices here for how you changed the code.
>
> This time you did not move the "static" or "unsigned int" to the same
> line as the function name, but then:
>
> > + unsigned char byPktType,
> > + unsigned int cbFrameLength,
> > + unsigned short wRate,
> > + bool bNeedAck)
> > {
> > unsigned int uDataTime, uAckTime;
> >
> > @@ -215,19 +213,16 @@ static __le16 get_rtscts_time(struct vnt_private *priv,
> >
> > /* byFreqType 0: 5GHz, 1:2.4Ghz */
> > static
> > -unsigned int
> > -s_uGetDataDuration(
> > - struct vnt_private *pDevice,
> > - unsigned char byDurType,
> > - unsigned int cbFrameLength,
> > - unsigned char byPktType,
> > - unsigned short wRate,
> > - bool bNeedAck,
> > - unsigned int uFragIdx,
> > - unsigned int cbLastFragmentSize,
> > - unsigned int uMACfragNum,
> > - unsigned char byFBOption
> > -)
> > +unsigned int s_uGetDataDuration(struct vnt_private *pDevice,
>
> You moved "unsigned int" here, but then:
>
>
> > + unsigned char byDurType,
> > + unsigned int cbFrameLength,
> > + unsigned char byPktType,
> > + unsigned short wRate,
> > + bool bNeedAck,
> > + unsigned int uFragIdx,
> > + unsigned int cbLastFragmentSize,
> > + unsigned int uMACfragNum,
> > + unsigned char byFBOption)
> > {
> > bool bLastFrag = false;
> > unsigned int uAckTime = 0, uNextPktTime = 0, len;
> > @@ -316,17 +311,13 @@ s_uGetDataDuration(
> > }
> >
> > /* byFreqType: 0=>5GHZ 1=>2.4GHZ */
> > -static
> > -__le16
> > -s_uGetRTSCTSDuration(
> > - struct vnt_private *pDevice,
> > - unsigned char byDurType,
> > - unsigned int cbFrameLength,
> > - unsigned char byPktType,
> > - unsigned short wRate,
> > - bool bNeedAck,
> > - unsigned char byFBOption
> > -)
> > +static __le16 s_uGetRTSCTSDuration(struct vnt_private *pDevice,
>
> You did both the static and the return type here.
>
> Pick one style and stick with it please. Consistancy matters, that is
> why we have a coding style to start with. Brains and pattern matching
> and all that.
>
> In this case, this last one (both static and the return type), should be
> used.
>
> thanks,
>
> greg k-h
OK thanks