Skip to contentSkip to conversation

staging: comedi: cb_pcidas64: fix alignment of function parameters

PATCH In review Gabriel Francisco Mandaji 3 participants 5 messages Apr 10, 2018 – Apr 12, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: comedi: cb_pcidas64: fix alignment of function parameters

Fix most checkpatch.pl issues of type:

CHECK: Alignment should match open parenthesis

---
 drivers/staging/comedi/drivers/cb_pcidas64.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/comedi/drivers/cb_pcidas64.c +3 -3
index fdd81c3..631a703 100644
@@ -2268,14 +2268,14 @@ static inline unsigned int dma_transfer_size(struct comedi_device *dev)
 }
 
 static u32 ai_convert_counter_6xxx(const struct comedi_device *dev,
-					const struct comedi_cmd *cmd)
+				   const struct comedi_cmd *cmd)
 {
 	/* supposed to load counter with desired divisor minus 3 */
 	return cmd->convert_arg / TIMER_BASE - 3;
 }
 
 static u32 ai_scan_counter_6xxx(struct comedi_device *dev,
-				     struct comedi_cmd *cmd)
+				struct comedi_cmd *cmd)
 {
 	u32 count;
 
@@ -2296,7 +2296,7 @@ static u32 ai_scan_counter_6xxx(struct comedi_device *dev,
 }
 
 static u32 ai_convert_counter_4020(struct comedi_device *dev,
-					struct comedi_cmd *cmd)
+				   struct comedi_cmd *cmd)
 {
 	struct pcidas64_private *devpriv = dev->private;
 	unsigned int divisor;
Signature · 6 lines
1.9.1

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#1 lore raw
Quoted 14 lines · Gabriel Francisco Mandaji

Fix most checkpatch.pl issues of type:

CHECK: Alignment should match open parenthesis

---
 drivers/staging/comedi/drivers/cb_pcidas64.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/comedi/drivers/cb_pcidas64.c +0 -0
index fdd81c3..631a703 100644

drivers/staging/comedi/drivers/cb_pcidas64.c static inline unsigned int dma_transfer_size(struct comedi_device *dev) · line 2271

Quoted 5 lines
drivers/staging/comedi/drivers/cb_pcidas64.c +1 -1
@@ -2268,14 +2268,14 @@ static inline unsigned int dma_transfer_size(struct comedi_device *dev)
 }
 
 static u32 ai_convert_counter_6xxx(const struct comedi_device *dev,
-					const struct comedi_cmd *cmd)
+				   const struct comedi_cmd *cmd)

Someone has made the effort to put const on these parameters, but not on the other similar functions. Perhaps this can be improved as well.

julia

Quoted 21 lines
drivers/staging/comedi/drivers/cb_pcidas64.c +2 -3
 {
 	/* supposed to load counter with desired divisor minus 3 */
 	return cmd->convert_arg / TIMER_BASE - 3;
 }
 
 static u32 ai_scan_counter_6xxx(struct comedi_device *dev,
-				     struct comedi_cmd *cmd)
+				struct comedi_cmd *cmd)
 {
 	u32 count;
 
@@ -2296,7 +2296,7 @@ static u32 ai_scan_counter_6xxx(struct comedi_device *dev,
 }
 
 static u32 ai_convert_counter_4020(struct comedi_device *dev,
-					struct comedi_cmd *cmd)
+				   struct comedi_cmd *cmd)
 {
 	struct pcidas64_private *devpriv = dev->private;
 	unsigned int divisor;
--
Quoted 3 lines

1.9.1

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#2 lore raw
Quoted 1 line · Julia Lawall

On Tue, 10 Apr 2018, Gabriel Francisco Mandaji wrote:

[snip]

Quoted 7 lines
Quoted 7 lines
drivers/staging/comedi/drivers/cb_pcidas64.c +0 -0
index fdd81c3..631a703 100644
@@ -2268,14 +2268,14 @@ static inline unsigned int dma_transfer_size(struct comedi_device *dev)
  }
 
Quoted 6 lines

drivers/staging/comedi/drivers/cb_pcidas64.c static inline unsigned int dma_transfer_size(struct comedi_device *dev) · line 2271

Quoted 3 lines
drivers/staging/comedi/drivers/cb_pcidas64.c +1 -1
  static u32 ai_convert_counter_6xxx(const struct comedi_device *dev,
-					const struct comedi_cmd *cmd)
+				   const struct comedi_cmd *cmd)

Someone has made the effort to put const on these parameters, but not on the other similar functions. Perhaps this can be improved as well.

Perhaps, but that should be in a separate patch.

Signature · 6 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Reviewed-by on v1 1/1
#3 lore raw
In reply to Gabriel Francisco Mandaji
Quoted 32 lines · Gabriel Francisco Mandaji

Fix most checkpatch.pl issues of type:

CHECK: Alignment should match open parenthesis

---
  drivers/staging/comedi/drivers/cb_pcidas64.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/comedi/drivers/cb_pcidas64.c +2 -2
index fdd81c3..631a703 100644
@@ -2268,14 +2268,14 @@ static inline unsigned int dma_transfer_size(struct comedi_device *dev)
  }
 
  static u32 ai_convert_counter_6xxx(const struct comedi_device *dev,
-					const struct comedi_cmd *cmd)
+				   const struct comedi_cmd *cmd)
  {
  	/* supposed to load counter with desired divisor minus 3 */
  	return cmd->convert_arg / TIMER_BASE - 3;
  }
 
  static u32 ai_scan_counter_6xxx(struct comedi_device *dev,
-				     struct comedi_cmd *cmd)
+				struct comedi_cmd *cmd)
  {
  	u32 count;
 

drivers/staging/comedi/drivers/cb_pcidas64.c static u32 ai_scan_counter_6xxx(struct comedi_device *dev, · line 2302

Quoted 8 lines
drivers/staging/comedi/drivers/cb_pcidas64.c +1 -1
@@ -2296,7 +2296,7 @@ static u32 ai_scan_counter_6xxx(struct comedi_device *dev,
  }
 
  static u32 ai_convert_counter_4020(struct comedi_device *dev,
-					struct comedi_cmd *cmd)
+				   struct comedi_cmd *cmd)
  {
  	struct pcidas64_private *devpriv = dev->private;
  	unsigned int divisor;

Looks good, thanks. I guess the remaining case of open parentheses alignment wasn't changed because that would exceed 80 columns.

Signature · 6 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#4 lore raw
Quoted 7 lines · Ian Abbott
Quoted 4 lines · Gabriel Francisco Mandaji

Fix most checkpatch.pl issues of type:

CHECK: Alignment should match open parenthesis
---

Looks good, thanks. I guess the remaining case of open parentheses alignment wasn't changed because that would exceed 80 columns.

Exactly. I wasn't sure whether it would be OK to use a temporary variable to store the longest parameter on that line (devpriv->ai_buffer[devpriv->ai_dma_index]), so I ended up fixing only the straightforward occurrences.

Thanks!
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel