From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-i2c@vger.kernel.org,
acpica-devel@lists.linuxfoundation.org
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, Andi Shyti <andi.shyti@kernel.org>,
Robert Moore <robert.moore@intel.com>,
Michael Walle <michael@walle.cc>
Subject: [PATCH v3 1/4] ACPI: bus: Constify acpi_companion_match() returned value
Date: Mon, 26 Jun 2023 14:00:23 +0300 [thread overview]
Message-ID: <20230626110026.65825-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20230626110026.65825-1-andriy.shevchenko@linux.intel.com>
acpi_companion_match() doesn't alter the contents of the passed
parameter, so we don't expect that returned value can be altered
either. So constify it.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/acpi/bus.c | 6 +++---
drivers/acpi/device_sysfs.c | 2 +-
drivers/acpi/internal.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index e3e0bd0c5a50..20cdfb37da79 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -682,7 +682,7 @@ bool acpi_device_is_first_physical_node(struct acpi_device *adev,
* resources available from it but they will be matched normally using functions
* provided by their bus types (and analogously for their modalias).
*/
-struct acpi_device *acpi_companion_match(const struct device *dev)
+const struct acpi_device *acpi_companion_match(const struct device *dev)
{
struct acpi_device *adev;
@@ -706,7 +706,7 @@ struct acpi_device *acpi_companion_match(const struct device *dev)
* identifiers and a _DSD object with the "compatible" property, use that
* property to match against the given list of identifiers.
*/
-static bool acpi_of_match_device(struct acpi_device *adev,
+static bool acpi_of_match_device(const struct acpi_device *adev,
const struct of_device_id *of_match_table,
const struct of_device_id **of_id)
{
@@ -808,7 +808,7 @@ static bool __acpi_match_device_cls(const struct acpi_device_id *id,
return true;
}
-static bool __acpi_match_device(struct acpi_device *device,
+static bool __acpi_match_device(const struct acpi_device *device,
const struct acpi_device_id *acpi_ids,
const struct of_device_id *of_ids,
const struct acpi_device_id **acpi_id,
diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c
index 0fbfbaa8d8e3..b9bbf0746199 100644
--- a/drivers/acpi/device_sysfs.c
+++ b/drivers/acpi/device_sysfs.c
@@ -283,7 +283,7 @@ int acpi_device_uevent_modalias(const struct device *dev, struct kobj_uevent_env
}
EXPORT_SYMBOL_GPL(acpi_device_uevent_modalias);
-static int __acpi_device_modalias(struct acpi_device *adev, char *buf, int size)
+static int __acpi_device_modalias(const struct acpi_device *adev, char *buf, int size)
{
int len, count;
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 50dcb35c9965..f4148dc50b9c 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -121,7 +121,7 @@ int acpi_bus_register_early_device(int type);
/* --------------------------------------------------------------------------
Device Matching and Notification
-------------------------------------------------------------------------- */
-struct acpi_device *acpi_companion_match(const struct device *dev);
+const struct acpi_device *acpi_companion_match(const struct device *dev);
int __acpi_device_uevent_modalias(const struct acpi_device *adev,
struct kobj_uevent_env *env);
--
2.40.0.1.gaa8946217a0b
next prev parent reply other threads:[~2023-06-26 11:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 11:00 [PATCH v3 0/4] ACPI: platform: Fix SMB0001 enumeration on Kontron devices Andy Shevchenko
2023-06-26 11:00 ` Andy Shevchenko [this message]
2023-06-29 8:49 ` [PATCH v3 1/4] ACPI: bus: Constify acpi_companion_match() returned value Rafael J. Wysocki
2023-06-29 9:08 ` Andy Shevchenko
2023-06-29 9:43 ` Rafael J. Wysocki
2023-06-29 15:52 ` Andi Shyti
2023-06-26 11:00 ` [PATCH v3 2/4] ACPI: bus: Introduce acpi_match_acpi_device() helper Andy Shevchenko
2023-06-29 8:44 ` Rafael J. Wysocki
2023-06-26 11:00 ` [PATCH v3 3/4] ACPI: platform: Ignore SMB0001 only when it has resources Andy Shevchenko
2023-06-29 15:59 ` Andi Shyti
2023-06-26 11:00 ` [PATCH v3 4/4] ACPI: platform: Move SMB0001 HID to the header and reuse Andy Shevchenko
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=20230626110026.65825-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=acpica-devel@lists.linuxfoundation.org \
--cc=andi.shyti@kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@walle.cc \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
/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