Re: [PATCH v2 1/4] acpi: Move common tables helper functions to common lib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 6/1/23 07:50, Jonathan Cameron wrote:
On Thu, 18 May 2023 11:33:02 -0700
Dave Jiang <dave.jiang@xxxxxxxxx> wrote:

Some of the routines in ACPI tables.c can be shared with parsing CDAT.
However, CDAT is used by CXL and can exist on platforms that do not use
ACPI. Split out the common routine from ACPI to accomodate platforms that
do not support ACPI. The common routines can be built outside of ACPI if
ACPI_TABLES_LIB is selected.

Signed-off-by: Dave Jiang <dave.jiang@xxxxxxxxx>
Comment inline - otherwise looks fine to me.

Jonathan

diff --git a/drivers/acpi/tables_lib.c b/drivers/acpi/tables_lib.c
new file mode 100644
index 000000000000..701001610fa9
--- /dev/null
+++ b/drivers/acpi/tables_lib.c
@@ -0,0 +1,194 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *  acpi_tables.c - ACPI Boot-Time Table Parsing
+ *
+ *  Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@xxxxxxxxx>
+ */
+
+/* Uncomment next line to get verbose printout */
+/* #define DEBUG */
+#define pr_fmt(fmt) "ACPI: " fmt
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/smp.h>
+#include <linux/string.h>
+#include <linux/types.h>
+#include <linux/irq.h>
Check these includes are all needed by this subset of the
original file.

Also could take opportunity to put what is left in
alphabetical order or some other convention.


Sure I'll clean that up.



+#include <linux/errno.h>
+#include <linux/acpi.h>
+#include <linux/memblock.h>
+#include <linux/earlycpio.h>
+#include <linux/initrd.h>
+#include <linux/security.h>
+#include <linux/kmemleak.h>
...




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux