Skip to contentSkip to conversation

i3c/master/mipi-i3c-hci: re-fix __maybe_unused attribute

PATCH In review Arnd Bergmann 4 participants 5 messages Dec 30, 2020 I3C

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i3c/master/mipi-i3c-hci: re-fix __maybe_unused attribute

From: Arnd Bergmann <[email protected]>

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")
---
 drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i3c/master/mipi-i3c-hci/core.c +1 -1
index 500abd27fb22..1b73647cc3b1 100644
@@ -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", },
 	{},
 };
Signature · 1 line
2.29.2
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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

Quoted 7 lines

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")

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.

Quoted 21 lines
---
 drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i3c/master/mipi-i3c-hci/core.c +1 -1
index 500abd27fb22..1b73647cc3b1 100644
@@ -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", },
 	{},
 };
Signature · 1 line
2.29.2
Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
#2 lore raw
Quoted 12 lines · Nicolas Pitre
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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

Quoted 9 lines
Quoted 2 lines
Fixes 95393f3e07ab ("i3c/master/mipi-i3c-hci: quiet maybe-unused variable warning")

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

Signature · 8 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
Reviewed-by
#3 lore raw
Quoted 18 lines · Alexandre Belloni
Quoted 17 lines · Nicolas Pitre
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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

Quoted 7 lines

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")
Quoted 7 lines
Quoted 4 lines

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:

Cheers,
Nathan

#4 lore raw
Quoted 24 lines · Nathan Chancellor
Quoted 23 lines · Alexandre Belloni
Quoted 21 lines · Nicolas Pitre
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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

Quoted 7 lines

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")

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.

Quoted 6 lines
Quoted 2 lines

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.

Quoted 5 lines

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

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.

Signature · 8 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c