Skip to contentSkip to conversation

stable/linux-5.10.y: (build) passing 'const struct fwnode_handle *' to parameter of type 'struc...

REGRESSION Applied KernelCI bot 3 participants 3 messages Apr 18 – Apr 20

Subsystems (2)
lore
Share & tools
lore

KernelCI bot

author CI
#0 lore raw

Hello,

New build issue found on stable/linux-5.10.y:

---
passing 'const struct fwnode_handle *' to parameter of type 'struct fwnode_handle *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] in drivers/base/property.o (drivers/base/property.c) [logspec:kbuild,kbuild.compiler.error]
---

- dashboard: https://d.kernelci.org/i/maestro:d1b6c3b17ff7c2164252525fdfd0d4e68224e5ad
- giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
- commit HEAD: 49e5d20074c20b20773c6dc0f8dce0635591093b
- tags: v5.10.253

Please include the KernelCI tag when submitting a fix:

Log excerpt:
=====================================================
/tmp/kci/linux/drivers/base/property.c:896:48: error: passing 'const struct fwnode_handle *' to parameter of type 'struct fwnode_handle *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
896 | return acpi_dma_supported(to_acpi_device_node(fwnode));
| ^~~~~~
/tmp/kci/linux/include/linux/acpi.h:756:77: note: passing argument to parameter 'fwnode' here
756 | static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
| ^
/tmp/kci/linux/drivers/base/property.c:911:48: error: passing 'const struct fwnode_handle *' to parameter of type 'struct fwnode_handle *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
911 | attr = acpi_get_dma_attr(to_acpi_device_node(fwnode));
| ^~~~~~
/tmp/kci/linux/include/linux/acpi.h:756:77: note: passing argument to parameter 'fwnode' here
756 | static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
| ^
2 errors generated.

=====================================================

# Builds where the incident occurred:

## multi_v7_defconfig on (arm):
- compiler: clang-21
- config: None
- dashboard: https://d.kernelci.org/build/maestro:69e3511d9b5a968309e62062

#kernelci issue maestro:d1b6c3b17ff7c2164252525fdfd0d4e68224e5ad

--
This is an experimental report format. Please send feedback in! Talk to us at [email protected]

Made with love by the KernelCI team - https://kernelci.org

#1 lore raw

PATCH 1/1 ACPI: property: Constify stubs for CONFIG_ACPI=n case

From: Andy Shevchenko <[email protected]>

commit 5c1a72a0fbe1b02c3ce0537f85f92ea935e0beec upstream.

There is a few stubs that left untouched during constification of the fwnode related APIs. Constify three more stubs here.

Fixes 8b9d6802583a ("ACPI: Constify acpi_bus helper functions, switch to macros")
[ rjw: Subject edit ]

---
This resolves compiler warning/errors seen in 5.10.253.

GCC:

drivers/base/property.c: In function 'device_dma_supported':
drivers/base/property.c:896:55: warning: passing argument 1 of 'to_acpi_device_node' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

    896 |         return acpi_dma_supported(to_acpi_device_node(fwnode));
        |                                                       ^~~~~~
  In file included from drivers/base/property.c:10:
  include/linux/acpi.h:756:77: note: expected 'struct fwnode_handle *' but argument is of type 'const struct fwnode_handle *'
    756 | static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
        |                                                       ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
  drivers/base/property.c: In function 'device_get_dma_attr':
  drivers/base/property.c:911:62: warning: passing argument 1 of 'to_acpi_device_node' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    911 |                 attr = acpi_get_dma_attr(to_acpi_device_node(fwnode));
        |                                                              ^~~~~~

include/linux/acpi.h:756:77: note: expected 'struct fwnode_handle *' but argument is of type 'const struct fwnode_handle *'
756 | static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~

Clang:

drivers/base/property.c:896:48: error: passing 'const struct fwnode_handle *' to parameter of type 'struct fwnode_handle *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]

    896 |         return acpi_dma_supported(to_acpi_device_node(fwnode));
        |                                                       ^~~~~~
  include/linux/acpi.h:756:77: note: passing argument to parameter 'fwnode' here
    756 | static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
        |                                                                             ^
  drivers/base/property.c:911:48: error: passing 'const struct fwnode_handle *' to parameter of type 'struct fwnode_handle *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    911 |                 attr = acpi_get_dma_attr(to_acpi_device_node(fwnode));
        |                                                              ^~~~~~

include/linux/acpi.h:756:77: note: passing argument to parameter 'fwnode' here
756 | static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
| ^
2 errors generated.

https://github.com/ClangBuiltLinux/continuous-integration2/actions/runs/24605516423

---
 include/linux/acpi.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/acpi.h +3 -3
index 9c184dbceba4..c5b51d8dcbe1 100644
@@ -753,7 +753,7 @@ static inline bool is_acpi_device_node(struct fwnode_handle *fwnode)
 	return false;
 }
 
-static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
+static inline struct acpi_device *to_acpi_device_node(const struct fwnode_handle *fwnode)
 {
 	return NULL;
 }
@@ -763,12 +763,12 @@ static inline bool is_acpi_data_node(struct fwnode_handle *fwnode)
 	return false;
 }
 
-static inline struct acpi_data_node *to_acpi_data_node(struct fwnode_handle *fwnode)
+static inline struct acpi_data_node *to_acpi_data_node(const struct fwnode_handle *fwnode)
 {
 	return NULL;
 }
 
-static inline bool acpi_data_node_match(struct fwnode_handle *fwnode,
+static inline bool acpi_data_node_match(const struct fwnode_handle *fwnode,
 					const char *name)
 {
 	return false;

base-commit: 49e5d20074c20b20773c6dc0f8dce0635591093b

Signature · 1 line
2.53.0
maintainer Applied
#2 lore raw

Re: [PATCH 5.10] ACPI: property: Constify stubs for CONFIG_ACPI=n case

Quoted 2 lines · Nathan Chancellor

Backport of 5c1a72a0fbe1 ("ACPI: property: Constify stubs for CONFIG_ACPI=n case") to 5.10.y.

Queued for 5.10, thanks.

--
Thanks,
Sasha