public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sasha Levin <sashal@kernel.org>
Cc: stable@vger.kernel.org, Nathan Chancellor <nathan@kernel.org>,
	kernelci-results@groups.io
Subject: [PATCH 5.10] ACPI: property: Constify stubs for CONFIG_ACPI=n case
Date: Sat, 18 Apr 2026 16:07:04 -0700	[thread overview]
Message-ID: <20260418230704.4178547-1-nathan@kernel.org> (raw)
In-Reply-To: <177650634337.369.12638743148475442890@062ea10430ee>

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[ rjw: Subject edit ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
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(-)

diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 9c184dbceba4..c5b51d8dcbe1 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -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
-- 
2.53.0


  reply	other threads:[~2026-04-18 23:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-18  9:59 [REGRESSION] stable/linux-5.10.y: (build) passing 'const struct fwnode_handle *' to parameter of type 'struc KernelCI bot
2026-04-18 23:07 ` Nathan Chancellor [this message]
2026-04-20 13:21   ` [PATCH 5.10] ACPI: property: Constify stubs for CONFIG_ACPI=n case Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260418230704.4178547-1-nathan@kernel.org \
    --to=nathan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernelci-results@groups.io \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox