LKML Archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Damien Le Moal <dlemoal@kernel.org>,
	Serge Semin <Sergey.Semin@baikalelectronics.ru>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-acpi@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>,
	Jens Axboe <axboe@kernel.dk>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>, Daniel Scally <djrscally@gmail.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH v2 1/3] ACPI: Move ACPI_DEVICE_CLASS() to mod_devicetable.h
Date: Fri, 9 Jun 2023 19:32:53 +0200	[thread overview]
Message-ID: <CAJZ5v0i29u7RUnhatOANBgjdrH4uoWK_8VCHWK2UO7RS8L3H1A@mail.gmail.com> (raw)
In-Reply-To: <20230609154900.43024-2-andriy.shevchenko@linux.intel.com>

On Fri, Jun 9, 2023 at 5:49 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> The data type of struct acpi_device_id is defined in the
> mod_devicetable.h. It's suboptimal to require user with
> the almost agnostic code to include acpi.h solely for the
> macro that affects the data type defined elsewhere.
>
> Taking into account the above and for the sake of consistency
> move ACPI_DEVICE_CLASS() to mod_devicetable.h.
>
> Note, that with CONFIG_ACPI=n the ID table will be filed with data
> but it does not really matter because either it won't be used, or
> won't be compiled in some cases (when guarded by respective ifdeffery).
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

or please let me know if you want me to apply this.

> ---
>  include/linux/acpi.h            | 14 --------------
>  include/linux/mod_devicetable.h | 13 +++++++++++++
>  2 files changed, 13 insertions(+), 14 deletions(-)
>
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index d41a05d68166..640f1c07c894 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -70,19 +70,6 @@ static inline void acpi_free_fwnode_static(struct fwnode_handle *fwnode)
>         kfree(fwnode);
>  }
>
> -/**
> - * ACPI_DEVICE_CLASS - macro used to describe an ACPI device with
> - * the PCI-defined class-code information
> - *
> - * @_cls : the class, subclass, prog-if triple for this device
> - * @_msk : the class mask for this device
> - *
> - * This macro is used to create a struct acpi_device_id that matches a
> - * specific PCI class. The .id and .driver_data fields will be left
> - * initialized with the default value.
> - */
> -#define ACPI_DEVICE_CLASS(_cls, _msk)  .cls = (_cls), .cls_msk = (_msk),
> -
>  static inline bool has_acpi_companion(struct device *dev)
>  {
>         return is_acpi_device_node(dev->fwnode);
> @@ -782,7 +769,6 @@ const char *acpi_get_subsystem_id(acpi_handle handle);
>  #define ACPI_COMPANION_SET(dev, adev)  do { } while (0)
>  #define ACPI_HANDLE(dev)               (NULL)
>  #define ACPI_HANDLE_FWNODE(fwnode)     (NULL)
> -#define ACPI_DEVICE_CLASS(_cls, _msk)  .cls = (0), .cls_msk = (0),
>
>  #include <acpi/acpi_numa.h>
>
> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> index ccaaeda792c0..486747518aae 100644
> --- a/include/linux/mod_devicetable.h
> +++ b/include/linux/mod_devicetable.h
> @@ -221,6 +221,19 @@ struct acpi_device_id {
>         __u32 cls_msk;
>  };
>
> +/**
> + * ACPI_DEVICE_CLASS - macro used to describe an ACPI device with
> + * the PCI-defined class-code information
> + *
> + * @_cls : the class, subclass, prog-if triple for this device
> + * @_msk : the class mask for this device
> + *
> + * This macro is used to create a struct acpi_device_id that matches a
> + * specific PCI class. The .id and .driver_data fields will be left
> + * initialized with the default value.
> + */
> +#define ACPI_DEVICE_CLASS(_cls, _msk)  .cls = (_cls), .cls_msk = (_msk),
> +
>  #define PNP_ID_LEN     8
>  #define PNP_MAX_DEVICES        8
>
> --
> 2.40.0.1.gaa8946217a0b
>

  reply	other threads:[~2023-06-09 17:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 15:48 [PATCH v2 0/3] device property: Introduce device_is_compatible() Andy Shevchenko
2023-06-09 15:48 ` [PATCH v2 1/3] ACPI: Move ACPI_DEVICE_CLASS() to mod_devicetable.h Andy Shevchenko
2023-06-09 17:32   ` Rafael J. Wysocki [this message]
2023-06-12 15:21     ` Andy Shevchenko
2023-06-12 22:07     ` Damien Le Moal
2023-06-09 15:48 ` [PATCH v2 2/3] device property: Implement device_is_compatible() Andy Shevchenko
2023-06-12  7:57   ` Sakari Ailus
2023-06-13  9:45   ` Serge Semin
2023-06-13 15:14     ` Andy Shevchenko
2023-06-13 15:14       ` Andy Shevchenko
2023-06-13 19:23         ` Serge Semin
2023-06-09 15:49 ` [PATCH v2 3/3] ata: ahci_platform: Make code agnostic to OF/ACPI Andy Shevchenko
2023-06-12  8:02   ` Sakari Ailus
2023-06-12 15:20     ` Andy Shevchenko
2023-06-13  9:26       ` Sakari Ailus
2023-06-12  9:06   ` Sakari Ailus
2023-06-12 15:19     ` Andy Shevchenko
2023-06-13  9:27       ` Sakari Ailus
2023-06-13  9:52   ` Serge Semin

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=CAJZ5v0i29u7RUnhatOANBgjdrH4uoWK_8VCHWK2UO7RS8L3H1A@mail.gmail.com \
    --to=rafael@kernel.org \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=axboe@kernel.dk \
    --cc=djrscally@gmail.com \
    --cc=dlemoal@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sakari.ailus@linux.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).