Linux CXL
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: <linux-acpi@vger.kernel.org>, <linux-cxl@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>, <lenb@kernel.org>,
	<dan.j.williams@intel.com>, <ira.weiny@intel.com>,
	<vishal.l.verma@intel.com>, <alison.schofield@intel.com>,
	<lukas@wunner.de>
Subject: Re: [PATCH v3 1/4] acpi: Move common tables helper functions to common lib
Date: Fri, 2 Jun 2023 13:35:04 +0100	[thread overview]
Message-ID: <20230602133504.00001c69@Huawei.com> (raw)
In-Reply-To: <168565511236.1098279.11767193165079131197.stgit@djiang5-mobl3>

On Thu, 01 Jun 2023 14:31:52 -0700
Dave Jiang <dave.jiang@intel.com> wrote:

> Some of the routines in ACPI driver/acpi/tables.c can be shared with
> parsing CDAT. CDAT is a device-provided data structure that is formatted
> similar to a platform provided ACPI table. CDAT is used by CXL and can
> exist on platforms that do not use ACPI. Split out the common routine
> from ACPI to accommodate platforms that do not support ACPI and move that
> to /lib. The common routines can be built outside of ACPI if
> FIRMWARE_TABLES is selected.
> 
> Link: https://lore.kernel.org/linux-cxl/CAJZ5v0jipbtTNnsA0-o5ozOk8ZgWnOg34m34a9pPenTyRLj=6A@mail.gmail.com/
> Suggested-by: Rafael J. Wysocki <rafael@kernel.org>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>

Minor comment to fix inline. With that tidied up

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> diff --git a/include/linux/fw_table.h b/include/linux/fw_table.h
> new file mode 100644
> index 000000000000..ff8fa58d5818
> --- /dev/null
> +++ b/include/linux/fw_table.h
> @@ -0,0 +1,43 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + *  fw_tables.h - Parsing support for ACPI and ACPI-like tables provided by
> + *                platform or device firmware
> + *
> + *  Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
> + *  Copyright (C) 2023 Intel Corp.
> + */
> +#ifndef _FW_TABLE_H_
> +#define _FW_TABLE_H_
> +
> +union acpi_subtable_headers;
> +
> +typedef int (*acpi_tbl_entry_handler)(union acpi_subtable_headers *header,
> +				      const unsigned long end);
> +
> +typedef int (*acpi_tbl_entry_handler_arg)(union acpi_subtable_headers *header,
> +					  void *arg, const unsigned long end);
> +
> +struct acpi_subtable_proc {
> +	int id;
> +	acpi_tbl_entry_handler handler;
> +	acpi_tbl_entry_handler_arg handler_arg;
> +	void *arg;
> +	int count;
> +};
> +
> +#include <linux/acpi.h>
> +#include <acpi/acpi.h>

Includes mid way down the files is not a common pattern and I can't see why
it's particularly useful to do so here.

+ linux/acpi.h includes acpi/acpi.h and I can't see that changing any time
soon...

> +
> +union acpi_subtable_headers {
> +	struct acpi_subtable_header common;
> +	struct acpi_hmat_structure hmat;
> +	struct acpi_prmt_module_header prmt;
> +	struct acpi_cedt_header cedt;
> +};
> +
> +int acpi_parse_entries_array(char *id, unsigned long table_size,
> +			     struct acpi_table_header *table_header,
> +			     struct acpi_subtable_proc *proc,
> +			     int proc_num, unsigned int max_entries);
> +
> +#endif



  reply	other threads:[~2023-06-02 12:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 21:31 [PATCH v3 0/4] acpi: Add CDAT parsing support to ACPI tables code Dave Jiang
2023-06-01 21:31 ` [PATCH v3 1/4] acpi: Move common tables helper functions to common lib Dave Jiang
2023-06-02 12:35   ` Jonathan Cameron [this message]
2023-06-12 20:47     ` Dave Jiang
2023-06-01 21:31 ` [PATCH v3 2/4] lib/firmware_table: tables: Add CDAT table parsing support Dave Jiang
2023-06-02 12:36   ` Jonathan Cameron
2023-06-01 21:32 ` [PATCH v3 3/4] acpi: fix misnamed define for CDAT DSMAS Dave Jiang
2023-06-02 12:38   ` Jonathan Cameron
2023-06-01 21:32 ` [PATCH v3 4/4] acpi: Add defines for CDAT SSLBIS Dave Jiang
2023-06-02 12:38   ` Jonathan Cameron
2023-06-04 16:09 ` [PATCH v3 0/4] acpi: Add CDAT parsing support to ACPI tables code Rafael J. Wysocki
2023-06-12 20:16   ` Dave Jiang
2023-06-06  1:36 ` Hanjun Guo
2023-06-12 20:17   ` Dave Jiang

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=20230602133504.00001c69@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=rafael@kernel.org \
    --cc=vishal.l.verma@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