All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: comedi: Remove a newline inside a dereference
@ 2018-02-17  8:10 Eisha Chen-yen-su
  2018-02-19  7:37 ` [Outreachy kernel] " Vaishali Thakkar
  2018-02-19 10:40 ` Ian Abbott
  0 siblings, 2 replies; 3+ messages in thread
From: Eisha Chen-yen-su @ 2018-02-17  8:10 UTC (permalink / raw)
  To: gregkh; +Cc: abbotti, hsweeten, outreachy-kernel, Eisha Chen-yen-su

This patch fixes the checkpatch.pl warning:

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

Signed-off-by: Eisha Chen-yen-su <chenyensu0@gmail.com>
---
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(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
index b657beedd5ff..eea44435a2aa 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Outreachy kernel] [PATCH v2] staging: comedi: Remove a newline inside a dereference
  2018-02-17  8:10 [PATCH v2] staging: comedi: Remove a newline inside a dereference Eisha Chen-yen-su
@ 2018-02-19  7:37 ` Vaishali Thakkar
  2018-02-19 10:40 ` Ian Abbott
  1 sibling, 0 replies; 3+ messages in thread
From: Vaishali Thakkar @ 2018-02-19  7:37 UTC (permalink / raw)
  To: Eisha Chen-yen-su; +Cc: Greg KH, abbotti, hsweeten, outreachy-kernel

On Sat, Feb 17, 2018 at 1:40 PM, Eisha Chen-yen-su <chenyensu0@gmail.com> wrote:
> 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'.

> Signed-off-by: Eisha Chen-yen-su <chenyensu0@gmail.com>
> ---
> 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(-)
>
> diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
> index b657beedd5ff..eea44435a2aa 100644
> --- a/drivers/staging/comedi/drivers/cb_pcidas64.c
> +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
> @@ -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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] staging: comedi: Remove a newline inside a dereference
  2018-02-17  8:10 [PATCH v2] staging: comedi: Remove a newline inside a dereference Eisha Chen-yen-su
  2018-02-19  7:37 ` [Outreachy kernel] " Vaishali Thakkar
@ 2018-02-19 10:40 ` Ian Abbott
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Abbott @ 2018-02-19 10:40 UTC (permalink / raw)
  To: Eisha Chen-yen-su, gregkh; +Cc: hsweeten, outreachy-kernel

On 17/02/18 08:10, Eisha Chen-yen-su wrote:
> This patch fixes the checkpatch.pl warning:
> 
> WARNING: Avoid multiple line dereference - prefer 'devpriv->ao_buffer_bus_addr[i]'
> 
> Signed-off-by: Eisha Chen-yen-su <chenyensu0@gmail.com>
> ---
> 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(-)
> 
> diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
> index b657beedd5ff..eea44435a2aa 100644
> --- a/drivers/staging/comedi/drivers/cb_pcidas64.c
> +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
> @@ -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.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-19 10:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-17  8:10 [PATCH v2] staging: comedi: Remove a newline inside a dereference Eisha Chen-yen-su
2018-02-19  7:37 ` [Outreachy kernel] " Vaishali Thakkar
2018-02-19 10:40 ` Ian Abbott

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.