linux-i3c.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i3c/master/mipi-i3c-hci: re-fix __maybe_unused attribute
@ 2020-12-30 15:42 Arnd Bergmann
  2020-12-30 21:23 ` Nicolas Pitre
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2020-12-30 15:42 UTC (permalink / raw)
  To: Alexandre Belloni, Nathan Chancellor, Nick Desaulniers,
	Boris Brezillon, Nicolas Pitre
  Cc: clang-built-linux, linux-i3c, linux-kernel, Arnd Bergmann

From: Arnd Bergmann <arnd@arndb.de>

clang warns because the added __maybe_unused attribute is in
the wrong place:

drivers/i3c/master/mipi-i3c-hci/core.c:780:21: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
static const struct __maybe_unused of_device_id i3c_hci_of_match[] = {
                    ^
include/linux/compiler_attributes.h:267:56: note: expanded

Fixes: 95393f3e07ab ("i3c/master/mipi-i3c-hci: quiet maybe-unused variable warning")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
index 500abd27fb22..1b73647cc3b1 100644
--- a/drivers/i3c/master/mipi-i3c-hci/core.c
+++ b/drivers/i3c/master/mipi-i3c-hci/core.c
@@ -777,7 +777,7 @@ static int i3c_hci_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct __maybe_unused of_device_id i3c_hci_of_match[] = {
+static const __maybe_unused struct of_device_id i3c_hci_of_match[] = {
 	{ .compatible = "mipi-i3c-hci", },
 	{},
 };
-- 
2.29.2


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH] i3c/master/mipi-i3c-hci: re-fix __maybe_unused attribute
  2020-12-30 15:42 [PATCH] i3c/master/mipi-i3c-hci: re-fix __maybe_unused attribute Arnd Bergmann
@ 2020-12-30 21:23 ` Nicolas Pitre
  2020-12-30 21:40   ` Alexandre Belloni
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Pitre @ 2020-12-30 21:23 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexandre Belloni, Arnd Bergmann, Nick Desaulniers, linux-kernel,
	clang-built-linux, Boris Brezillon, linux-i3c, Nathan Chancellor

On Wed, 30 Dec 2020, Arnd Bergmann wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> clang warns because the added __maybe_unused attribute is in
> the wrong place:
> 
> drivers/i3c/master/mipi-i3c-hci/core.c:780:21: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
> static const struct __maybe_unused of_device_id i3c_hci_of_match[] = {
>                     ^
> include/linux/compiler_attributes.h:267:56: note: expanded
> 
> Fixes: 95393f3e07ab ("i3c/master/mipi-i3c-hci: quiet maybe-unused variable warning")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Nicolas Pitre <npitre@baylibre.com>

This might be the 3rd patch from 3 different people fixing the same 
thing. Looks like I3C maintainer is on vacation. Please feel free to 
send this trivial fix upstream some other way.

> ---
>  drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
> index 500abd27fb22..1b73647cc3b1 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/core.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/core.c
> @@ -777,7 +777,7 @@ static int i3c_hci_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static const struct __maybe_unused of_device_id i3c_hci_of_match[] = {
> +static const __maybe_unused struct of_device_id i3c_hci_of_match[] = {
>  	{ .compatible = "mipi-i3c-hci", },
>  	{},
>  };
> -- 
> 2.29.2
> 
> 

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH] i3c/master/mipi-i3c-hci: re-fix __maybe_unused attribute
  2020-12-30 21:23 ` Nicolas Pitre
@ 2020-12-30 21:40   ` Alexandre Belloni
  2020-12-30 21:43     ` Nathan Chancellor
  0 siblings, 1 reply; 5+ messages in thread
From: Alexandre Belloni @ 2020-12-30 21:40 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: Arnd Bergmann, Arnd Bergmann, Nick Desaulniers, linux-kernel,
	clang-built-linux, Boris Brezillon, Nathan Chancellor, linux-i3c

On 30/12/2020 16:23:56-0500, Nicolas Pitre wrote:
> On Wed, 30 Dec 2020, Arnd Bergmann wrote:
> 
> > From: Arnd Bergmann <arnd@arndb.de>
> > 
> > clang warns because the added __maybe_unused attribute is in
> > the wrong place:
> > 
> > drivers/i3c/master/mipi-i3c-hci/core.c:780:21: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
> > static const struct __maybe_unused of_device_id i3c_hci_of_match[] = {
> >                     ^
> > include/linux/compiler_attributes.h:267:56: note: expanded
> > 
> > Fixes: 95393f3e07ab ("i3c/master/mipi-i3c-hci: quiet maybe-unused variable warning")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> Acked-by: Nicolas Pitre <npitre@baylibre.com>
> 
> This might be the 3rd patch from 3 different people fixing the same 
> thing. Looks like I3C maintainer is on vacation. Please feel free to 
> send this trivial fix upstream some other way.
> 

Isn't it already upstream?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=95393f3e07ab53855b91881692a4a5b52dcdc03c

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH] i3c/master/mipi-i3c-hci: re-fix __maybe_unused attribute
  2020-12-30 21:40   ` Alexandre Belloni
@ 2020-12-30 21:43     ` Nathan Chancellor
  2020-12-30 22:00       ` Alexandre Belloni
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2020-12-30 21:43 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Arnd Bergmann, Arnd Bergmann, Nick Desaulniers, linux-kernel,
	Nicolas Pitre, clang-built-linux, Boris Brezillon, linux-i3c

On Wed, Dec 30, 2020 at 10:40:53PM +0100, Alexandre Belloni wrote:
> On 30/12/2020 16:23:56-0500, Nicolas Pitre wrote:
> > On Wed, 30 Dec 2020, Arnd Bergmann wrote:
> > 
> > > From: Arnd Bergmann <arnd@arndb.de>
> > > 
> > > clang warns because the added __maybe_unused attribute is in
> > > the wrong place:
> > > 
> > > drivers/i3c/master/mipi-i3c-hci/core.c:780:21: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
> > > static const struct __maybe_unused of_device_id i3c_hci_of_match[] = {
> > >                     ^
> > > include/linux/compiler_attributes.h:267:56: note: expanded
> > > 
> > > Fixes: 95393f3e07ab ("i3c/master/mipi-i3c-hci: quiet maybe-unused variable warning")
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > 
> > Acked-by: Nicolas Pitre <npitre@baylibre.com>
> > 
> > This might be the 3rd patch from 3 different people fixing the same 
> > thing. Looks like I3C maintainer is on vacation. Please feel free to 
> > send this trivial fix upstream some other way.
> > 
> 
> Isn't it already upstream?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=95393f3e07ab53855b91881692a4a5b52dcdc03c

This patch is fixing that one, the attribute was added between the
struct type, causing a new warning for clang.

I sent a fix for this earlier too, I do not care which one goes in as
long as one does so:

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

Cheers,
Nathan

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH] i3c/master/mipi-i3c-hci: re-fix __maybe_unused attribute
  2020-12-30 21:43     ` Nathan Chancellor
@ 2020-12-30 22:00       ` Alexandre Belloni
  0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2020-12-30 22:00 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Arnd Bergmann, Arnd Bergmann, Nick Desaulniers, linux-kernel,
	Nicolas Pitre, clang-built-linux, Boris Brezillon, linux-i3c

On 30/12/2020 14:43:21-0700, Nathan Chancellor wrote:
> On Wed, Dec 30, 2020 at 10:40:53PM +0100, Alexandre Belloni wrote:
> > On 30/12/2020 16:23:56-0500, Nicolas Pitre wrote:
> > > On Wed, 30 Dec 2020, Arnd Bergmann wrote:
> > > 
> > > > From: Arnd Bergmann <arnd@arndb.de>
> > > > 
> > > > clang warns because the added __maybe_unused attribute is in
> > > > the wrong place:
> > > > 
> > > > drivers/i3c/master/mipi-i3c-hci/core.c:780:21: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
> > > > static const struct __maybe_unused of_device_id i3c_hci_of_match[] = {
> > > >                     ^
> > > > include/linux/compiler_attributes.h:267:56: note: expanded
> > > > 
> > > > Fixes: 95393f3e07ab ("i3c/master/mipi-i3c-hci: quiet maybe-unused variable warning")
> > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > 
> > > Acked-by: Nicolas Pitre <npitre@baylibre.com>
> > > 
> > > This might be the 3rd patch from 3 different people fixing the same 
> > > thing. Looks like I3C maintainer is on vacation. Please feel free to 
> > > send this trivial fix upstream some other way.
> > > 
> > 
> > Isn't it already upstream?
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=95393f3e07ab53855b91881692a4a5b52dcdc03c
> 
> This patch is fixing that one, the attribute was added between the
> struct type, causing a new warning for clang.
> 

Ah yes, even after reading that 3 times, I got it wrong.

> I sent a fix for this earlier too, I do not care which one goes in as
> long as one does so:
> 
> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
> 

I was going to review and apply yours now that I have access to the i3c
repo. I must admit I didn't have a look at i3c patches until now and the
holiday season is not helping.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

end of thread, other threads:[~2020-12-31 17:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 15:42 [PATCH] i3c/master/mipi-i3c-hci: re-fix __maybe_unused attribute Arnd Bergmann
2020-12-30 21:23 ` Nicolas Pitre
2020-12-30 21:40   ` Alexandre Belloni
2020-12-30 21:43     ` Nathan Chancellor
2020-12-30 22:00       ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).