diff mbox

[1/3] acpi nfit: move definitions which nfit_test will use

Message ID 20170818134749.8EBF.E1E9C6FF@jp.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gotou, Yasunori/五島 康文 Aug. 18, 2017, 4:47 a.m. UTC
To use nfit_test.ko can use the definition of NFIT_CMD_TRANSLATE_SPA,
the defintion is moved from nfit/core.c to ndctl.h.

Probably, other NFIT_CMD_XXX defintions will be used by nfit_test.ko in future.
move them to ndctl.h at this time.

---
 drivers/acpi/nfit/core.c   | 11 -----------
 include/uapi/linux/ndctl.h | 11 +++++++++++
 2 files changed, 11 insertions(+), 11 deletions(-)

Comments

Dan Williams Aug. 26, 2017, 12:07 a.m. UTC | #1
On Thu, Aug 17, 2017 at 9:47 PM, Yasunori Goto <y-goto@jp.fujitsu.com> wrote:
>
> To use nfit_test.ko can use the definition of NFIT_CMD_TRANSLATE_SPA,
> the defintion is moved from nfit/core.c to ndctl.h.
>
> Probably, other NFIT_CMD_XXX defintions will be used by nfit_test.ko in future.
> move them to ndctl.h at this time.
>
> ---
>  drivers/acpi/nfit/core.c   | 11 -----------
>  include/uapi/linux/ndctl.h | 11 +++++++++++
>  2 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 19182d0..00e49c2 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -1621,17 +1621,6 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
>                         acpi_desc);
>  }
>
> -/*
> - * These constants are private because there are no kernel consumers of
> - * these commands.
> - */
> -enum nfit_aux_cmds {
> -        NFIT_CMD_TRANSLATE_SPA = 5,
> -        NFIT_CMD_ARS_INJECT_SET = 7,
> -        NFIT_CMD_ARS_INJECT_CLEAR = 8,
> -        NFIT_CMD_ARS_INJECT_GET = 9,
> -};
> -
>  static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc)
>  {
>         struct nvdimm_bus_descriptor *nd_desc = &acpi_desc->nd_desc;
> diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
> index 6d3c542..a359d19 100644
> --- a/include/uapi/linux/ndctl.h
> +++ b/include/uapi/linux/ndctl.h
> @@ -204,6 +204,17 @@ enum {
>         ND_CMD_CALL = 10,
>  };
>
> +/*
> + * Though These constants are mainly used by acpi nfit driver,
> + * they are defined here for nfit_test.ko to be able to use them.
> + */
> +enum nfit_aux_cmds {
> +        NFIT_CMD_TRANSLATE_SPA = 5,
> +        NFIT_CMD_ARS_INJECT_SET = 7,
> +        NFIT_CMD_ARS_INJECT_CLEAR = 8,
> +        NFIT_CMD_ARS_INJECT_GET = 9,

Like I mentioned in the ndctl patches let's instead move these to a
libndctl-nfit.h header. There's no need for the kernel to export these
command numbers since it only passes them through to the acpi device.
diff mbox

Patch

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 19182d0..00e49c2 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -1621,17 +1621,6 @@  static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
 			acpi_desc);
 }
 
-/*
- * These constants are private because there are no kernel consumers of
- * these commands.
- */
-enum nfit_aux_cmds {
-        NFIT_CMD_TRANSLATE_SPA = 5,
-        NFIT_CMD_ARS_INJECT_SET = 7,
-        NFIT_CMD_ARS_INJECT_CLEAR = 8,
-        NFIT_CMD_ARS_INJECT_GET = 9,
-};
-
 static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc)
 {
 	struct nvdimm_bus_descriptor *nd_desc = &acpi_desc->nd_desc;
diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
index 6d3c542..a359d19 100644
--- a/include/uapi/linux/ndctl.h
+++ b/include/uapi/linux/ndctl.h
@@ -204,6 +204,17 @@  enum {
 	ND_CMD_CALL = 10,
 };
 
+/*
+ * Though These constants are mainly used by acpi nfit driver,
+ * they are defined here for nfit_test.ko to be able to use them.
+ */
+enum nfit_aux_cmds {
+        NFIT_CMD_TRANSLATE_SPA = 5,
+        NFIT_CMD_ARS_INJECT_SET = 7,
+        NFIT_CMD_ARS_INJECT_CLEAR = 8,
+        NFIT_CMD_ARS_INJECT_GET = 9,
+};
+
 enum {
 	ND_ARS_VOLATILE = 1,
 	ND_ARS_PERSISTENT = 2,