All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: goldfish: Fix coding style issues
@ 2017-03-27  9:53 aviyae
  2017-03-27 10:04 ` Greg KH
  2017-03-27 11:52 ` [PATCH v2] staging: goldfish: Fix style issues in macros aviyae
  0 siblings, 2 replies; 11+ messages in thread
From: aviyae @ 2017-03-27  9:53 UTC (permalink / raw)
  To: gregkh; +Cc: aviyae42, devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 58 bytes --]

fixing some coding style issues in goldfish audio driver


[-- Attachment #2: 0001-staging-goldfish-Fix-coding-style-issues.patch --]
[-- Type: text/x-patch, Size: 1446 bytes --]

>From 8368d1b6404d63da7d502f6cd2ce6b50c7ffa9b9 Mon Sep 17 00:00:00 2001
From: Aviya Erenfeld <aviyae42@gmail.com>
Date: Tue, 21 Mar 2017 00:07:19 +0200
Subject: [PATCH] staging: goldfish: Fix coding style issues

Fix the coding style issues that raised by checkpatch.pl
in that driver.
(For the eudyptula challenge)

Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>
---
 drivers/staging/goldfish/goldfish_audio.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c
index bd55995..f1640ab 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -61,10 +61,12 @@ struct goldfish_audio {
 #define COMBINED_BUFFER_SIZE    ((2 * READ_BUFFER_SIZE) + \
 					(2 * WRITE_BUFFER_SIZE))
 
-#define AUDIO_READ(data, addr)		(readl(data->reg_base + addr))
-#define AUDIO_WRITE(data, addr, x)	(writel(x, data->reg_base + addr))
+#define AUDIO_READ(data, addr)		(readl((data)->reg_base + (addr)))
+#define AUDIO_WRITE(data, addr, x)	(writel(x, (data)->reg_base + (addr)))
 #define AUDIO_WRITE64(data, addr, addr2, x)	\
-	(gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
+	({typeof(data) _data = (data); \
+	gf_write_dma_addr((x), _data->reg_base + (addr), \
+			  _data->reg_base + (addr2)); })
 
 /*
  *  temporary variable used between goldfish_audio_probe() and
-- 
2.7.4


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

* Re: [PATCH] staging: goldfish: Fix coding style issues
  2017-03-27  9:53 [PATCH] staging: goldfish: Fix coding style issues aviyae
@ 2017-03-27 10:04 ` Greg KH
  2017-03-27 11:52 ` [PATCH v2] staging: goldfish: Fix style issues in macros aviyae
  1 sibling, 0 replies; 11+ messages in thread
From: Greg KH @ 2017-03-27 10:04 UTC (permalink / raw)
  To: aviyae; +Cc: devel, linux-kernel

On Mon, Mar 27, 2017 at 12:53:21PM +0300, aviyae wrote:
> fixing some coding style issues in goldfish audio driver
> 

> >From 8368d1b6404d63da7d502f6cd2ce6b50c7ffa9b9 Mon Sep 17 00:00:00 2001
> From: Aviya Erenfeld <aviyae42@gmail.com>
> Date: Tue, 21 Mar 2017 00:07:19 +0200
> Subject: [PATCH] staging: goldfish: Fix coding style issues
> 
> Fix the coding style issues that raised by checkpatch.pl
> in that driver.
> (For the eudyptula challenge)
> 
> Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>
> ---
>  drivers/staging/goldfish/goldfish_audio.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c
> index bd55995..f1640ab 100644
> --- a/drivers/staging/goldfish/goldfish_audio.c
> +++ b/drivers/staging/goldfish/goldfish_audio.c
> @@ -61,10 +61,12 @@ struct goldfish_audio {
>  #define COMBINED_BUFFER_SIZE    ((2 * READ_BUFFER_SIZE) + \
>  					(2 * WRITE_BUFFER_SIZE))
>  
> -#define AUDIO_READ(data, addr)		(readl(data->reg_base + addr))
> -#define AUDIO_WRITE(data, addr, x)	(writel(x, data->reg_base + addr))
> +#define AUDIO_READ(data, addr)		(readl((data)->reg_base + (addr)))
> +#define AUDIO_WRITE(data, addr, x)	(writel(x, (data)->reg_base + (addr)))
>  #define AUDIO_WRITE64(data, addr, addr2, x)	\
> -	(gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
> +	({typeof(data) _data = (data); \
> +	gf_write_dma_addr((x), _data->reg_base + (addr), \
> +			  _data->reg_base + (addr2)); })
>  
>  /*
>   *  temporary variable used between goldfish_audio_probe() and
> -- 
> 2.7.4
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch was attached, please place it inline so that it can be
  applied directly from the email message itself.

- Your patch does not have a Signed-off-by: line.  Please read the
  kernel file, Documentation/SubmittingPatches and resend it after
  adding that line.  Note, the line needs to be in the body of the
  email, before the patch, not at the bottom of the patch or in the
  email signature.

- Your patch did many different things all at once, making it difficult
  to review.  All Linux kernel patches need to only do one thing at a
  time.  If you need to do multiple things (such as clean up all coding
  style issues in a file/driver), do it in a sequence of patches, each
  one doing only one thing.  This will make it easier to review the
  patches to ensure that they are correct, and to help alleviate any
  merge issues that larger patches can cause.

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what is needed in order to
  properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what a proper Subject: line should
  look like.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

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

* [PATCH v2] staging: goldfish: Fix style issues in macros
  2017-03-27  9:53 [PATCH] staging: goldfish: Fix coding style issues aviyae
  2017-03-27 10:04 ` Greg KH
@ 2017-03-27 11:52 ` aviyae
  2017-03-27 12:05   ` Frans Klaver
  2017-03-27 12:19   ` [PATCH v3] " aviyae
  1 sibling, 2 replies; 11+ messages in thread
From: aviyae @ 2017-03-27 11:52 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

From: Aviya Erenfeld <aviyae42@gmail.com>

staging: goldfish: Fix style issues in macros

Fix coding style issues in macros:
1. Add parenthesis around macros argument
2. Avoid arguments reuse in macros

(For the eudyptula challenge)

Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>
---
 drivers/staging/goldfish/goldfish_audio.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c
index bd55995..f1640ab 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -61,10 +61,12 @@ struct goldfish_audio {
 #define COMBINED_BUFFER_SIZE    ((2 * READ_BUFFER_SIZE) + \
                                        (2 * WRITE_BUFFER_SIZE))

-#define AUDIO_READ(data, addr)         (readl(data->reg_base + addr))
-#define AUDIO_WRITE(data, addr, x)     (writel(x, data->reg_base + addr))
+#define AUDIO_READ(data, addr)         (readl((data)->reg_base + (addr)))
+#define AUDIO_WRITE(data, addr, x)     (writel(x, (data)->reg_base + (addr)))
 #define AUDIO_WRITE64(data, addr, addr2, x)    \
-       (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
+       ({typeof(data) _data = (data); \
+       gf_write_dma_addr((x), _data->reg_base + (addr), \
+                         _data->reg_base + (addr2)); })

 /*
  *  temporary variable used between goldfish_audio_probe() and
-- 
2.7.4

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

* Re: [PATCH v2] staging: goldfish: Fix style issues in macros
  2017-03-27 11:52 ` [PATCH v2] staging: goldfish: Fix style issues in macros aviyae
@ 2017-03-27 12:05   ` Frans Klaver
  2017-03-27 12:13     ` aviyae
  2017-03-27 12:19   ` [PATCH v3] " aviyae
  1 sibling, 1 reply; 11+ messages in thread
From: Frans Klaver @ 2017-03-27 12:05 UTC (permalink / raw)
  To: aviyae; +Cc: Greg KH, devel, linux-kernel

On Mon, Mar 27, 2017 at 1:52 PM, aviyae <aviyae42@gmail.com> wrote:
> From: Aviya Erenfeld <aviyae42@gmail.com>
>
> staging: goldfish: Fix style issues in macros
>
> Fix coding style issues in macros:
> 1. Add parenthesis around macros argument
> 2. Avoid arguments reuse in macros
>
> (For the eudyptula challenge)

How is that relevant?

Frans

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

* Re: [PATCH v2] staging: goldfish: Fix style issues in macros
  2017-03-27 12:05   ` Frans Klaver
@ 2017-03-27 12:13     ` aviyae
  2017-03-27 12:19       ` Frans Klaver
  0 siblings, 1 reply; 11+ messages in thread
From: aviyae @ 2017-03-27 12:13 UTC (permalink / raw)
  To: Frans Klaver; +Cc: Greg KH, devel, linux-kernel

I'll remove that eudyptula thing, although there are some patches that mention it

(run git log --grep=eudyptula)


On 27/03/17 15:05, Frans Klaver wrote:
> On Mon, Mar 27, 2017 at 1:52 PM, aviyae <aviyae42@gmail.com> wrote:
>> From: Aviya Erenfeld <aviyae42@gmail.com>
>>
>> staging: goldfish: Fix style issues in macros
>>
>> Fix coding style issues in macros:
>> 1. Add parenthesis around macros argument
>> 2. Avoid arguments reuse in macros
>>
>> (For the eudyptula challenge)
> How is that relevant?
>
> Frans

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

* [PATCH v3] staging: goldfish: Fix style issues in macros
  2017-03-27 11:52 ` [PATCH v2] staging: goldfish: Fix style issues in macros aviyae
  2017-03-27 12:05   ` Frans Klaver
@ 2017-03-27 12:19   ` aviyae
  2017-03-29  7:19     ` Greg KH
  2017-03-29 21:11     ` [PATCH] staging: goldfish: Add parenthesis around macros arguments aviyae
  1 sibling, 2 replies; 11+ messages in thread
From: aviyae @ 2017-03-27 12:19 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

Fix coding style issues in macros:
1. Add parenthesis around macro arguments
2. Avoid arguments reuse in macro

Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>
---
 drivers/staging/goldfish/goldfish_audio.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c
index bd55995..f1640ab 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -61,10 +61,12 @@ struct goldfish_audio {
 #define COMBINED_BUFFER_SIZE    ((2 * READ_BUFFER_SIZE) + \
                                        (2 * WRITE_BUFFER_SIZE))

-#define AUDIO_READ(data, addr)         (readl(data->reg_base + addr))
-#define AUDIO_WRITE(data, addr, x)     (writel(x, data->reg_base + addr))
+#define AUDIO_READ(data, addr)         (readl((data)->reg_base + (addr)))
+#define AUDIO_WRITE(data, addr, x)     (writel(x, (data)->reg_base + (addr)))
 #define AUDIO_WRITE64(data, addr, addr2, x)    \
-       (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
+       ({typeof(data) _data = (data); \
+       gf_write_dma_addr((x), _data->reg_base + (addr), \
+                         _data->reg_base + (addr2)); })

 /*
  *  temporary variable used between goldfish_audio_probe() and
-- 
2.7.4

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

* Re: [PATCH v2] staging: goldfish: Fix style issues in macros
  2017-03-27 12:13     ` aviyae
@ 2017-03-27 12:19       ` Frans Klaver
  0 siblings, 0 replies; 11+ messages in thread
From: Frans Klaver @ 2017-03-27 12:19 UTC (permalink / raw)
  To: aviyae; +Cc: Greg KH, devel, linux-kernel

On Mon, Mar 27, 2017 at 2:13 PM, aviyae <aviyae42@gmail.com> wrote:
> I'll remove that eudyptula thing, although there are some patches that mention it
>
> (run git log --grep=eudyptula)

I haven't checked that and I think it's a shame it didn't get removed.
I don't think it adds value to the patch, as it's just for a personal
goal.

It is also custom to reply _below_ the (part of the) message you're
responding to by the way ;-).

Cheers,
Frans


> On 27/03/17 15:05, Frans Klaver wrote:
>> On Mon, Mar 27, 2017 at 1:52 PM, aviyae <aviyae42@gmail.com> wrote:
>>> From: Aviya Erenfeld <aviyae42@gmail.com>
>>>
>>> staging: goldfish: Fix style issues in macros
>>>
>>> Fix coding style issues in macros:
>>> 1. Add parenthesis around macros argument
>>> 2. Avoid arguments reuse in macros
>>>
>>> (For the eudyptula challenge)
>> How is that relevant?
>>
>> Frans
>

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

* Re: [PATCH v3] staging: goldfish: Fix style issues in macros
  2017-03-27 12:19   ` [PATCH v3] " aviyae
@ 2017-03-29  7:19     ` Greg KH
  2017-03-29 21:11     ` [PATCH] staging: goldfish: Add parenthesis around macros arguments aviyae
  1 sibling, 0 replies; 11+ messages in thread
From: Greg KH @ 2017-03-29  7:19 UTC (permalink / raw)
  To: aviyae; +Cc: devel, linux-kernel

On Mon, Mar 27, 2017 at 03:19:06PM +0300, aviyae wrote:
> Fix coding style issues in macros:
> 1. Add parenthesis around macro arguments
> 2. Avoid arguments reuse in macro

That's different things, please make different patches for this.

Remember, only one patch per "thing" and "fix all style issues" is not
"one thing" :)

thanks,

greg k-h

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

* [PATCH] staging: goldfish: Add parenthesis around macros arguments
  2017-03-27 12:19   ` [PATCH v3] " aviyae
  2017-03-29  7:19     ` Greg KH
@ 2017-03-29 21:11     ` aviyae
  2017-04-08 15:03       ` Greg KH
  2017-04-08 15:03       ` Greg KH
  1 sibling, 2 replies; 11+ messages in thread
From: aviyae @ 2017-03-29 21:11 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel

Fix style issues by adding parenthesis around macros
arguments

Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>
---
 drivers/staging/goldfish/goldfish_audio.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c
index bd55995..2bb1f27 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -61,10 +61,11 @@ struct goldfish_audio {
 #define COMBINED_BUFFER_SIZE    ((2 * READ_BUFFER_SIZE) + \
                                        (2 * WRITE_BUFFER_SIZE))

-#define AUDIO_READ(data, addr)         (readl(data->reg_base + addr))
-#define AUDIO_WRITE(data, addr, x)     (writel(x, data->reg_base + addr))
+#define AUDIO_READ(data, addr)         (readl((data)->reg_base + (addr)))
+#define AUDIO_WRITE(data, addr, x)     (writel(x, (data)->reg_base + (addr)))
 #define AUDIO_WRITE64(data, addr, addr2, x)    \
-       (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
+       (gf_write_dma_addr((x), (data)->reg_base + (addr), \
+       (data)->reg_base + (addr2)))

 /*
  *  temporary variable used between goldfish_audio_probe() and
-- 
2.7.4

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

* Re: [PATCH] staging: goldfish: Add parenthesis around macros arguments
  2017-03-29 21:11     ` [PATCH] staging: goldfish: Add parenthesis around macros arguments aviyae
@ 2017-04-08 15:03       ` Greg KH
  2017-04-08 15:03       ` Greg KH
  1 sibling, 0 replies; 11+ messages in thread
From: Greg KH @ 2017-04-08 15:03 UTC (permalink / raw)
  To: aviyae; +Cc: devel, linux-kernel

On Thu, Mar 30, 2017 at 12:11:05AM +0300, aviyae wrote:
> Fix style issues by adding parenthesis around macros
> arguments
> 
> Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>
> ---
>  drivers/staging/goldfish/goldfish_audio.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c
> index bd55995..2bb1f27 100644
> --- a/drivers/staging/goldfish/goldfish_audio.c
> +++ b/drivers/staging/goldfish/goldfish_audio.c
> @@ -61,10 +61,11 @@ struct goldfish_audio {
>  #define COMBINED_BUFFER_SIZE    ((2 * READ_BUFFER_SIZE) + \
>                                         (2 * WRITE_BUFFER_SIZE))
> 
> -#define AUDIO_READ(data, addr)         (readl(data->reg_base + addr))
> -#define AUDIO_WRITE(data, addr, x)     (writel(x, data->reg_base + addr))
> +#define AUDIO_READ(data, addr)         (readl((data)->reg_base + (addr)))
> +#define AUDIO_WRITE(data, addr, x)     (writel(x, (data)->reg_base + (addr)))
>  #define AUDIO_WRITE64(data, addr, addr2, x)    \
> -       (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
> +       (gf_write_dma_addr((x), (data)->reg_base + (addr), \
> +       (data)->reg_base + (addr2)))

Your indentation here is odd, please fix up.

And is this really a needed change?

thanks,

greg k-h

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

* Re: [PATCH] staging: goldfish: Add parenthesis around macros arguments
  2017-03-29 21:11     ` [PATCH] staging: goldfish: Add parenthesis around macros arguments aviyae
  2017-04-08 15:03       ` Greg KH
@ 2017-04-08 15:03       ` Greg KH
  1 sibling, 0 replies; 11+ messages in thread
From: Greg KH @ 2017-04-08 15:03 UTC (permalink / raw)
  To: aviyae; +Cc: devel, linux-kernel

On Thu, Mar 30, 2017 at 12:11:05AM +0300, aviyae wrote:
> Fix style issues by adding parenthesis around macros
> arguments
> 
> Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>

Also your From: line does not match this line...

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

end of thread, other threads:[~2017-04-08 15:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27  9:53 [PATCH] staging: goldfish: Fix coding style issues aviyae
2017-03-27 10:04 ` Greg KH
2017-03-27 11:52 ` [PATCH v2] staging: goldfish: Fix style issues in macros aviyae
2017-03-27 12:05   ` Frans Klaver
2017-03-27 12:13     ` aviyae
2017-03-27 12:19       ` Frans Klaver
2017-03-27 12:19   ` [PATCH v3] " aviyae
2017-03-29  7:19     ` Greg KH
2017-03-29 21:11     ` [PATCH] staging: goldfish: Add parenthesis around macros arguments aviyae
2017-04-08 15:03       ` Greg KH
2017-04-08 15:03       ` Greg KH

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.