Skip to contentSkip to conversation

i3c/master/mipi-i3c-hci: Fix position of __maybe_unused in i3c_hci_of_match

PATCH Applied Nathan Chancellor 4 participants 4 messages Dec 22, 2020 – Feb 9, 2021 I3C

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i3c/master/mipi-i3c-hci: Fix position of __maybe_unused in i3c_hci_of_match

Clang warns:

../drivers/i3c/master/mipi-i3c-hci/core.c:780:21: warning: attribute declaration must precede definition [-Wignored-attributes]

 static const struct __maybe_unused of_device_id i3c_hci_of_match[] = {
                     ^
 ../include/linux/compiler_attributes.h:267:56: note: expanded from macro
 '__maybe_unused'
 #define __maybe_unused                  __attribute__((__unused__))
                                                        ^
 ../include/linux/mod_devicetable.h:262:8: note: previous definition is
 here
 struct of_device_id {
        ^

1 warning generated.

'struct of_device_id' should not be split, as it is a type. Move the __maybe_unused attribute after the static and const qualifiers so that there are no warnings about this variable, period.

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", },
 	{},
 };

base-commit: 95393f3e07ab53855b91881692a4a5b52dcdc03c

Signature · 1 line
2.30.0.rc1
Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines · Nathan Chancellor

Clang warns:

../drivers/i3c/master/mipi-i3c-hci/core.c:780:21: warning: attribute declaration must precede definition [-Wignored-attributes]

 static const struct __maybe_unused of_device_id i3c_hci_of_match[] = {
                     ^
 ../include/linux/compiler_attributes.h:267:56: note: expanded from macro
 '__maybe_unused'
 #define __maybe_unused                  __attribute__((__unused__))
                                                        ^
 ../include/linux/mod_devicetable.h:262:8: note: previous definition is
 here
 struct of_device_id {
        ^

1 warning generated.

Quoted 7 lines

'struct of_device_id' should not be split, as it is a type. Move the __maybe_unused attribute after the static and const qualifiers so that there are no warnings about this variable, period.

Fixes 95393f3e07ab ("i3c/master/mipi-i3c-hci: quiet maybe-unused variable warning")
Quoted 23 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", },
 	{},
 };

base-commit: 95393f3e07ab53855b91881692a4a5b52dcdc03c

Signature · 1 line
2.30.0.rc1
Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
maintainer Applied
#2 lore raw
In reply to Nathan Chancellor
Quoted 14 lines · Nathan Chancellor

Clang warns:

../drivers/i3c/master/mipi-i3c-hci/core.c:780:21: warning: attribute declaration must precede definition [-Wignored-attributes]

 static const struct __maybe_unused of_device_id i3c_hci_of_match[] = {
                     ^
 ../include/linux/compiler_attributes.h:267:56: note: expanded from macro
 '__maybe_unused'
 #define __maybe_unused                  __attribute__((__unused__))
                                                        ^
 ../include/linux/mod_devicetable.h:262:8: note: previous definition is
 here
 struct of_device_id {
        ^
Quoted 3 lines

1 warning generated.

[...]

Applied, thanks!

[1/1] i3c/master/mipi-i3c-hci: Fix position of __maybe_unused in i3c_hci_of_match

      commit: 291b5c9870fc546376d69cf792b7885cd0c9c1b3

Best regards,

Signature · 6 lines
Alexandre Belloni <[email protected]>

-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
#3 lore raw
Quoted 17 lines · Alexandre Belloni
Quoted 16 lines · Nathan Chancellor

Clang warns:

../drivers/i3c/master/mipi-i3c-hci/core.c:780:21: warning: attribute declaration must precede definition [-Wignored-attributes]

 static const struct __maybe_unused of_device_id i3c_hci_of_match[] = {
                     ^
 ../include/linux/compiler_attributes.h:267:56: note: expanded from macro
 '__maybe_unused'
 #define __maybe_unused                  __attribute__((__unused__))
                                                        ^
 ../include/linux/mod_devicetable.h:262:8: note: previous definition is
 here
 struct of_device_id {
        ^

1 warning generated.

Quoted 11 lines
Quoted 1 line

[...]

Applied, thanks!

[1/1] i3c/master/mipi-i3c-hci: Fix position of __maybe_unused in i3c_hci_of_match

      commit: 291b5c9870fc546376d69cf792b7885cd0c9c1b3

Best regards,

Signature · 1 line
Alexandre Belloni <[email protected]>

Hi Alexandre,

I see as of v5.11-rc7 that this is still an issue even though it has been applied to the fixes branch. Is it possible for this to make it in to 5.11 final?

Cheers,
Nathan