From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Linux ACPI" <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Hans de Goede" <hansg@kernel.org>,
platform-driver-x86@vger.kernel.org,
amd-gfx@lists.freedesktop.org,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH v1 9/9] ACPI: AC: Define ACPI_AC_CLASS in one place
Date: Fri, 6 Mar 2026 14:44:12 +0200 (EET) [thread overview]
Message-ID: <ba409fad-7b2e-6fb1-eeee-8d9cacf4cb74@linux.intel.com> (raw)
In-Reply-To: <2787819.X9hSmTKtgW@rafael.j.wysocki>
[-- Attachment #1: Type: text/plain, Size: 3673 bytes --]
On Thu, 5 Mar 2026, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The ACPI_AC_CLASS symbol is defined in several places in the same way
> which is rather unfortunate.
>
> Instead, define it in one common header file (acpi_bus.h) that is
> already included by all of its users.
It's a bit misleading to say it like that as acpi_bus.h is included only
through another include (at least acpi/acpi.h) for most of the
cases.
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
> No intentional functional impact.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> drivers/acpi/ac.c | 1 -
> drivers/acpi/sbs.c | 1 -
> drivers/gpu/drm/amd/include/amd_acpi.h | 2 --
> drivers/gpu/drm/radeon/radeon_acpi.c | 2 --
> drivers/platform/x86/hp/hp-wmi.c | 2 --
> drivers/platform/x86/lenovo/wmi-capdata.c | 1 -
> include/acpi/acpi_bus.h | 2 ++
> 7 files changed, 2 insertions(+), 9 deletions(-)
>
> --- a/drivers/acpi/ac.c
> +++ b/drivers/acpi/ac.c
> @@ -21,7 +21,6 @@
> #include <linux/acpi.h>
> #include <acpi/battery.h>
>
> -#define ACPI_AC_CLASS "ac_adapter"
> #define ACPI_AC_FILE_STATE "state"
> #define ACPI_AC_NOTIFY_STATUS 0x80
> #define ACPI_AC_STATUS_OFFLINE 0x00
> --- a/drivers/acpi/sbs.c
> +++ b/drivers/acpi/sbs.c
> @@ -26,7 +26,6 @@
>
> #include "sbshc.h"
>
> -#define ACPI_AC_CLASS "ac_adapter"
> #define ACPI_SBS_DEVICE_NAME "Smart Battery System"
> #define ACPI_BATTERY_DIR_NAME "BAT%i"
> #define ACPI_AC_DIR_NAME "AC0"
> --- a/drivers/gpu/drm/amd/include/amd_acpi.h
> +++ b/drivers/gpu/drm/amd/include/amd_acpi.h
> @@ -26,8 +26,6 @@
>
> #include <linux/types.h>
>
> -#define ACPI_AC_CLASS "ac_adapter"
> -
> struct atif_verify_interface {
> u16 size; /* structure size in bytes (includes size field) */
> u16 version; /* version */
> --- a/drivers/gpu/drm/radeon/radeon_acpi.c
> +++ b/drivers/gpu/drm/radeon/radeon_acpi.c
> @@ -44,8 +44,6 @@ bool radeon_atpx_dgpu_req_power_for_disp
> static inline bool radeon_atpx_dgpu_req_power_for_displays(void) { return false; }
> #endif
>
> -#define ACPI_AC_CLASS "ac_adapter"
> -
> struct atif_verify_interface {
> u16 size; /* structure size in bytes (includes size field) */
> u16 version; /* version */
> --- a/drivers/platform/x86/hp/hp-wmi.c
> +++ b/drivers/platform/x86/hp/hp-wmi.c
> @@ -58,8 +58,6 @@ enum hp_ec_offsets {
> #define HP_POWER_LIMIT_DEFAULT 0x00
> #define HP_POWER_LIMIT_NO_CHANGE 0xFF
>
> -#define ACPI_AC_CLASS "ac_adapter"
> -
> #define zero_if_sup(tmp) (zero_insize_support?0:sizeof(tmp)) // use when zero insize is required
>
> enum hp_thermal_profile_omen_v0 {
> --- a/drivers/platform/x86/lenovo/wmi-capdata.c
> +++ b/drivers/platform/x86/lenovo/wmi-capdata.c
> @@ -53,7 +53,6 @@
> #define LENOVO_CAPABILITY_DATA_01_GUID "7A8F5407-CB67-4D6E-B547-39B3BE018154"
> #define LENOVO_FAN_TEST_DATA_GUID "B642801B-3D21-45DE-90AE-6E86F164FB21"
>
> -#define ACPI_AC_CLASS "ac_adapter"
> #define ACPI_AC_NOTIFY_STATUS 0x80
>
> #define LWMI_FEATURE_ID_FAN_TEST 0x05
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -613,6 +613,8 @@ struct acpi_bus_event {
> u32 data;
> };
>
> +#define ACPI_AC_CLASS "ac_adapter"
> +
> extern struct kobject *acpi_kobj;
> extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
> void acpi_bus_private_data_handler(acpi_handle, void *);
next prev parent reply other threads:[~2026-03-06 12:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 20:09 [PATCH v1 0/9] ACPI: driver: Cleanups and fixes, mostly related to acpi_device_name/class() Rafael J. Wysocki
2026-03-05 20:10 ` [PATCH v1 1/9] ACPI: AC: Get rid of unnecessary declarations Rafael J. Wysocki
2026-03-05 20:11 ` [PATCH v1 2/9] ACPI: PAD: Rearrange notify handler installation and removal Rafael J. Wysocki
2026-03-05 20:12 ` [PATCH v1 3/9] ACPI: video: Consolidate pnp.bus_id workarounds handling Rafael J. Wysocki
2026-03-05 20:16 ` [PATCH v1 4/9] ACPI: video: Rework checking for duplicate video bus devices Rafael J. Wysocki
2026-03-05 20:17 ` [PATCH v1 5/9] ACPI: driver: Do not set acpi_device_name() unnecessarily Rafael J. Wysocki
2026-03-05 20:18 ` [PATCH v1 6/9] ACPI: event: Redefine acpi_notifier_call_chain() Rafael J. Wysocki
2026-03-05 20:20 ` [PATCH v1 7/9] ACPI: driver: Avoid using pnp.device_class for netlink handling Rafael J. Wysocki
2026-03-05 20:21 ` [PATCH v1 8/9] ACPI: driver: Do not set acpi_device_class() unnecessarily Rafael J. Wysocki
2026-03-05 20:27 ` [PATCH v1 9/9] ACPI: AC: Define ACPI_AC_CLASS in one place Rafael J. Wysocki
2026-03-06 12:44 ` Ilpo Järvinen [this message]
2026-03-06 12:49 ` Rafael J. Wysocki
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=ba409fad-7b2e-6fb1-eeee-8d9cacf4cb74@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=hansg@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rafael@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