[PATCH v3] staging: vt6655: fix open parentheses alignment

Matthias Yee posted 1 patch 1 year, 11 months ago
drivers/staging/vt6655/card.c | 74 +++++++++++++++++------------------
1 file changed, 37 insertions(+), 37 deletions(-)
[PATCH v3] staging: vt6655: fix open parentheses alignment
Posted by Matthias Yee 1 year, 11 months ago
Adjusted whitespace to fix checkpatch warning Alignment Should Match
Open Parenthesis.

Signed-off-by: Matthias Yee <mgyee9@gmail.com>
---
Changes in v3
-fixed line wrapping for commit message
---
 drivers/staging/vt6655/card.c | 74 +++++++++++++++++------------------
 1 file changed, 37 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 36183f2a64c1..688c870d89bc 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -81,9 +81,9 @@ static void vt6655_mac_set_bb_type(void __iomem *iobase, u32 mask)
  * Return Value: none
  */
 static void calculate_ofdmr_parameter(unsigned char rate,
-				       u8 bb_type,
-				       unsigned char *tx_rate,
-				       unsigned char *rsv_time)
+				      u8 bb_type,
+				      unsigned char *tx_rate,
+				      unsigned char *rsv_time)
 {
 	switch (rate) {
 	case RATE_6M:
@@ -288,7 +288,7 @@ bool card_set_phy_parameter(struct vnt_private *priv, u8 bb_type)
  * Return Value: none
  */
 bool card_update_tsf(struct vnt_private *priv, unsigned char rx_rate,
-		    u64 bss_timestamp)
+		     u64 bss_timestamp)
 {
 	u64 local_tsf;
 	u64 tsf_offset = 0;
@@ -297,7 +297,7 @@ bool card_update_tsf(struct vnt_private *priv, unsigned char rx_rate,
 
 	if (bss_timestamp != local_tsf) {
 		tsf_offset = card_get_tsf_offset(rx_rate, bss_timestamp,
-						local_tsf);
+						 local_tsf);
 		/* adjust TSF, HW's TSF add TSF Offset reg */
 		tsf_offset =  le64_to_cpu(tsf_offset);
 		iowrite32((u32)tsf_offset, priv->port_offset + MAC_REG_TSFOFST);
@@ -321,7 +321,7 @@ bool card_update_tsf(struct vnt_private *priv, unsigned char rx_rate,
  * Return Value: true if succeed; otherwise false
  */
 bool card_set_beacon_period(struct vnt_private *priv,
-			  unsigned short beacon_interval)
+			    unsigned short beacon_interval)
 {
 	u64 next_tbtt;
 
@@ -586,61 +586,61 @@ void card_set_rspinf(struct vnt_private *priv, u8 bb_type)
 
 	/* RSPINF_a_6 */
 	calculate_ofdmr_parameter(RATE_6M,
-				   bb_type,
-				   &byTxRate,
-				   &byRsvTime);
+				  bb_type,
+				  &byTxRate,
+				  &byRsvTime);
 	iowrite16(MAKEWORD(byTxRate, byRsvTime), priv->port_offset + MAC_REG_RSPINF_A_6);
 	/* RSPINF_a_9 */
 	calculate_ofdmr_parameter(RATE_9M,
-				   bb_type,
-				   &byTxRate,
-				   &byRsvTime);
+				  bb_type,
+				  &byTxRate,
+				  &byRsvTime);
 	iowrite16(MAKEWORD(byTxRate, byRsvTime), priv->port_offset + MAC_REG_RSPINF_A_9);
 	/* RSPINF_a_12 */
 	calculate_ofdmr_parameter(RATE_12M,
-				   bb_type,
-				   &byTxRate,
-				   &byRsvTime);
+				  bb_type,
+				  &byTxRate,
+				  &byRsvTime);
 	iowrite16(MAKEWORD(byTxRate, byRsvTime), priv->port_offset + MAC_REG_RSPINF_A_12);
 	/* RSPINF_a_18 */
 	calculate_ofdmr_parameter(RATE_18M,
-				   bb_type,
-				   &byTxRate,
-				   &byRsvTime);
+				  bb_type,
+				  &byTxRate,
+				  &byRsvTime);
 	iowrite16(MAKEWORD(byTxRate, byRsvTime), priv->port_offset + MAC_REG_RSPINF_A_18);
 	/* RSPINF_a_24 */
 	calculate_ofdmr_parameter(RATE_24M,
-				   bb_type,
-				   &byTxRate,
-				   &byRsvTime);
+				  bb_type,
+				  &byTxRate,
+				  &byRsvTime);
 	iowrite16(MAKEWORD(byTxRate, byRsvTime), priv->port_offset + MAC_REG_RSPINF_A_24);
 	/* RSPINF_a_36 */
 	calculate_ofdmr_parameter(CARDwGetOFDMControlRate((void *)priv,
-							   RATE_36M),
-				   bb_type,
-				   &byTxRate,
-				   &byRsvTime);
+							  RATE_36M),
+				  bb_type,
+				  &byTxRate,
+				  &byRsvTime);
 	iowrite16(MAKEWORD(byTxRate, byRsvTime), priv->port_offset + MAC_REG_RSPINF_A_36);
 	/* RSPINF_a_48 */
 	calculate_ofdmr_parameter(CARDwGetOFDMControlRate((void *)priv,
-							   RATE_48M),
-				   bb_type,
-				   &byTxRate,
-				   &byRsvTime);
+							  RATE_48M),
+				  bb_type,
+				  &byTxRate,
+				  &byRsvTime);
 	iowrite16(MAKEWORD(byTxRate, byRsvTime), priv->port_offset + MAC_REG_RSPINF_A_48);
 	/* RSPINF_a_54 */
 	calculate_ofdmr_parameter(CARDwGetOFDMControlRate((void *)priv,
-							   RATE_54M),
-				   bb_type,
-				   &byTxRate,
-				   &byRsvTime);
+							  RATE_54M),
+				  bb_type,
+				  &byTxRate,
+				  &byRsvTime);
 	iowrite16(MAKEWORD(byTxRate, byRsvTime), priv->port_offset + MAC_REG_RSPINF_A_54);
 	/* RSPINF_a_72 */
 	calculate_ofdmr_parameter(CARDwGetOFDMControlRate((void *)priv,
-							   RATE_54M),
-				   bb_type,
-				   &byTxRate,
-				   &byRsvTime);
+							  RATE_54M),
+				  bb_type,
+				  &byTxRate,
+				  &byRsvTime);
 	iowrite16(MAKEWORD(byTxRate, byRsvTime), priv->port_offset + MAC_REG_RSPINF_A_72);
 	/* Set to Page0 */
 	VT6655_MAC_SELECT_PAGE0(priv->port_offset);
-- 
2.34.1
Re: [PATCH v3] staging: vt6655: fix open parentheses alignment
Posted by Randy Dunlap 1 year, 11 months ago
Greg, Dan,


On 1/9/24 23:23, Matthias Yee wrote:
> Adjusted whitespace to fix checkpatch warning Alignment Should Match
> Open Parenthesis.
> 
> Signed-off-by: Matthias Yee <mgyee9@gmail.com>
> ---
> Changes in v3
> -fixed line wrapping for commit message
> ---
>  drivers/staging/vt6655/card.c | 74 +++++++++++++++++------------------
>  1 file changed, 37 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
> index 36183f2a64c1..688c870d89bc 100644
> --- a/drivers/staging/vt6655/card.c
> +++ b/drivers/staging/vt6655/card.c
> @@ -81,9 +81,9 @@ static void vt6655_mac_set_bb_type(void __iomem *iobase, u32 mask)
>   * Return Value: none
>   */
>  static void calculate_ofdmr_parameter(unsigned char rate,
> -				       u8 bb_type,
> -				       unsigned char *tx_rate,
> -				       unsigned char *rsv_time)
> +				      u8 bb_type,
> +				      unsigned char *tx_rate,
> +				      unsigned char *rsv_time)
>  {
>  	switch (rate) {
>  	case RATE_6M:

Is there any chance that checkpatch is wrong about this warning?

I much prefer the alignment as it was before this patch: following lines
are aligned with the first parameter after the '('.


-- 
#Randy
Re: [PATCH v3] staging: vt6655: fix open parentheses alignment
Posted by Dan Carpenter 1 year, 11 months ago
On Tue, Jan 09, 2024 at 11:30:17PM -0800, Randy Dunlap wrote:
> > diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
> > index 36183f2a64c1..688c870d89bc 100644
> > --- a/drivers/staging/vt6655/card.c
> > +++ b/drivers/staging/vt6655/card.c
> > @@ -81,9 +81,9 @@ static void vt6655_mac_set_bb_type(void __iomem *iobase, u32 mask)
> >   * Return Value: none
> >   */
> >  static void calculate_ofdmr_parameter(unsigned char rate,
> > -				       u8 bb_type,
> > -				       unsigned char *tx_rate,
> > -				       unsigned char *rsv_time)
> > +				      u8 bb_type,
> > +				      unsigned char *tx_rate,
> > +				      unsigned char *rsv_time)
> >  {
> >  	switch (rate) {
> >  	case RATE_6M:
> 
> Is there any chance that checkpatch is wrong about this warning?
> 
> I much prefer the alignment as it was before this patch: following lines
> are aligned with the first parameter after the '('.
> 

It just looks weird in the diff because of the + character at the front
and how the tabs work out.  It looks ok in the code.

regards,
dan carpenter
Re: [PATCH v3] staging: vt6655: fix open parentheses alignment
Posted by Randy Dunlap 1 year, 11 months ago

On 1/9/24 23:51, Dan Carpenter wrote:
> On Tue, Jan 09, 2024 at 11:30:17PM -0800, Randy Dunlap wrote:
>>> diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
>>> index 36183f2a64c1..688c870d89bc 100644
>>> --- a/drivers/staging/vt6655/card.c
>>> +++ b/drivers/staging/vt6655/card.c
>>> @@ -81,9 +81,9 @@ static void vt6655_mac_set_bb_type(void __iomem *iobase, u32 mask)
>>>   * Return Value: none
>>>   */
>>>  static void calculate_ofdmr_parameter(unsigned char rate,
>>> -				       u8 bb_type,
>>> -				       unsigned char *tx_rate,
>>> -				       unsigned char *rsv_time)
>>> +				      u8 bb_type,
>>> +				      unsigned char *tx_rate,
>>> +				      unsigned char *rsv_time)
>>>  {
>>>  	switch (rate) {
>>>  	case RATE_6M:
>>
>> Is there any chance that checkpatch is wrong about this warning?
>>
>> I much prefer the alignment as it was before this patch: following lines
>> are aligned with the first parameter after the '('.
>>
> 
> It just looks weird in the diff because of the + character at the front
> and how the tabs work out.  It looks ok in the code.

Oops, sorry, you are correct. Thanks!

-- 
#Randy
Re: [PATCH v3] staging: vt6655: fix open parentheses alignment
Posted by Dan Carpenter 1 year, 11 months ago
On Tue, Jan 09, 2024 at 11:23:05PM -0800, Matthias Yee wrote:
> Adjusted whitespace to fix checkpatch warning Alignment Should Match
> Open Parenthesis.
> 
> Signed-off-by: Matthias Yee <mgyee9@gmail.com>
> ---
> Changes in v3
> -fixed line wrapping for commit message

Thanks!

Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>

regards,
dan carpenter