From: Damien Le Moal <dlemoal@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Hannes Reinecke <hare@suse.de>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Niklas Cassel <cassel@kernel.org>
Subject: Re: [PATCH v1 1/1] ata: libata: Move inclusion to where it belongs
Date: Fri, 5 Apr 2024 08:16:29 +0900 [thread overview]
Message-ID: <8e37f392-1ddd-4c8e-87df-acb3bb5bdf0b@kernel.org> (raw)
In-Reply-To: <20240404192111.3580578-1-andriy.shevchenko@linux.intel.com>
On 4/5/24 04:21, Andy Shevchenko wrote:
> Replace rather heavy acpi.h inclusion by a simple forward declaration
> in the public header. Update the local one to include acpi.h as some
> of the code requires it.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/ata/libata.h | 3 +++
> include/linux/libata.h | 5 ++++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
> index 5c685bb1939e..29e9387eb249 100644
> --- a/drivers/ata/libata.h
> +++ b/drivers/ata/libata.h
> @@ -90,6 +90,9 @@ extern unsigned int ata_read_log_page(struct ata_device *dev, u8 log,
> #define to_ata_port(d) container_of(d, struct ata_port, tdev)
>
> /* libata-acpi.c */
> +
> +#include <linux/acpi.h>
I am really not a big fan of including files in the middle of a header file.
> +
> #ifdef CONFIG_ATA_ACPI
> extern unsigned int ata_acpi_gtf_filter;
> extern void ata_acpi_dissociate(struct ata_host *host);
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index 66937b787cca..68b969de410f 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -19,7 +19,6 @@
> #include <linux/ata.h>
> #include <linux/workqueue.h>
> #include <scsi/scsi_host.h>
> -#include <linux/acpi.h>
Why not:
#ifdef CONFIG_ATA_ACPI
#include <linux/acpi.h>
#endif
Which avoids the union forward declaration below.
> #include <linux/cdrom.h>
> #include <linux/sched.h>
> #include <linux/async.h>
> @@ -660,6 +659,10 @@ struct ata_cpr_log {
> struct ata_cpr cpr[] __counted_by(nr_cpr);
> };
>
> +#ifdef CONFIG_ATA_ACPI
> +union acpi_object;
> +#endif
> +
> struct ata_device {
> struct ata_link *link;
> unsigned int devno; /* 0 or 1 */
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2024-04-04 23:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-04 19:21 [PATCH v1 1/1] ata: libata: Move inclusion to where it belongs Andy Shevchenko
2024-04-04 23:16 ` Damien Le Moal [this message]
2024-04-05 15:24 ` 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=8e37f392-1ddd-4c8e-87df-acb3bb5bdf0b@kernel.org \
--to=dlemoal@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=cassel@kernel.org \
--cc=hare@suse.de \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.