Skip to contentSkip to conversation

staging: comedi: Remove a newline inside a dereference

PATCH Superseded Eisha Chen-yen-su 3 participants 3 messages Feb 17, 2018 – Feb 19, 2018 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: comedi: Remove a newline inside a dereference

This patch fixes the checkpatch.pl warning:

WARNING: Avoid multiple line dereference - prefer 'devpriv->ao_buffer_bus_addr[i]'

---
Changes in v2:
- Change the commit log to mention what I have done.
- Remove the unnecessary cited lines from checkpatch inside the commit body.

 drivers/staging/comedi/drivers/cb_pcidas64.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/comedi/drivers/cb_pcidas64.c +1 -2
index b657beedd5ff..eea44435a2aa 100644
@@ -1490,8 +1490,7 @@ static int alloc_and_init_dma_members(struct comedi_device *dev)
 			devpriv->ao_buffer[i] =
 				dma_alloc_coherent(&pcidev->dev,
 						   DMA_BUFFER_SIZE,
-						   &devpriv->
-						   ao_buffer_bus_addr[i],
+						   &devpriv->ao_buffer_bus_addr[i],
 						   GFP_KERNEL);
 			if (!devpriv->ao_buffer[i])
 				return -ENOMEM;

--
2.14.3

#1 lore raw
Quoted 3 lines · Eisha Chen-yen-su

This patch fixes the checkpatch.pl warning:

WARNING: Avoid multiple line dereference - prefer 'devpriv->ao_buffer_bus_addr[i]'

Hi Eisha,

Good work on subject.

For the commit log, as Julia mentioned in her previous comments it's not necessary to keep the checkpatch.pl's warning message in the commit log. Instead you can write about what change you with the reason of doing that change. And at the end to give credit to the tool, you can add something like 'Problem detected by checkpatch.pl'.

Quoted 32 lines

---
Changes in v2:
- Change the commit log to mention what I have done.
- Remove the unnecessary cited lines from checkpatch inside the commit body.

 drivers/staging/comedi/drivers/cb_pcidas64.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/comedi/drivers/cb_pcidas64.c +1 -3
index b657beedd5ff..eea44435a2aa 100644
@@ -1490,8 +1490,7 @@ static int alloc_and_init_dma_members(struct comedi_device *dev)
                        devpriv->ao_buffer[i] =
                                dma_alloc_coherent(&pcidev->dev,
                                                   DMA_BUFFER_SIZE,
-                                                  &devpriv->
-                                                  ao_buffer_bus_addr[i],
+                                                  &devpriv->ao_buffer_bus_addr[i],
                                                   GFP_KERNEL);
                        if (!devpriv->ao_buffer[i])
                                return -ENOMEM;
--

2.14.3

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20180217081047.5763-1-chenyensu0%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
In reply to Eisha Chen-yen-su
Quoted 18 lines · Eisha Chen-yen-su

This patch fixes the checkpatch.pl warning:

WARNING: Avoid multiple line dereference - prefer 'devpriv->ao_buffer_bus_addr[i]'

---
Changes in v2:
- Change the commit log to mention what I have done.
- Remove the unnecessary cited lines from checkpatch inside the commit body.

  drivers/staging/comedi/drivers/cb_pcidas64.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/comedi/drivers/cb_pcidas64.c +0 -0
index b657beedd5ff..eea44435a2aa 100644

drivers/staging/comedi/drivers/cb_pcidas64.c static int alloc_and_init_dma_members(struct comedi_device *dev) · line 1494

Quoted 7 lines
drivers/staging/comedi/drivers/cb_pcidas64.c +1 -2
@@ -1490,8 +1490,7 @@ static int alloc_and_init_dma_members(struct comedi_device *dev)
  			devpriv->ao_buffer[i] =
  				dma_alloc_coherent(&pcidev->dev,
  						   DMA_BUFFER_SIZE,
-						   &devpriv->
-						   ao_buffer_bus_addr[i],
+						   &devpriv->ao_buffer_bus_addr[i],
  						   GFP_KERNEL);

That makes the line go over 80 columns. You could avoid that by moving the whole dma_alloc_coherent() call back 4 columns (so the amount of indentation after the line break following the '=' is reduced from 8 to 4). You could even move it back by 8 columns (so the amount of indentation would be 0), but I think it looks better with *some* indentation.

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-