public inbox for linux-cxl@vger.kernel.org
 help / color / mirror / Atom feed
* [ndctl PATCH 0/2] ndctl: Fix build issues when fwctl is disabled
@ 2026-03-10  2:41 cp0613
  2026-03-10  2:41 ` [ndctl PATCH 1/2] ndctl: Fix missing key_type parameter in ndctl_dimm_remove_key stub cp0613
  2026-03-10  2:41 ` [ndctl PATCH 2/2] ndctl/test: Fix meson configuration error when fwctl is disabled cp0613
  0 siblings, 2 replies; 5+ messages in thread
From: cp0613 @ 2026-03-10  2:41 UTC (permalink / raw)
  To: ishal.l.verma, alison.schofield, nvdimm; +Cc: linux-cxl, Chen Pei

From: Chen Pei <cp0613@linux.alibaba.com>

This patch series addresses two closely related build failures that
occur when the fwctl feature is not enabled in the build configuration
(-Dfwctl=disabled).

The patches fix these problems by:
1. Updating the stub function signature to match its actual usage.
2. Conditionally including fwctl in test dependencies only when enabled.

These changes ensure that ndctl builds cleanly regardless of the fwctl
build option.

Chen Pei (2):
  ndctl: Fix missing key_type parameter in ndctl_dimm_remove_key stub
  ndctl/test: Fix meson configuration error when fwctl is disabled

 ndctl/keys.h     |  3 ++-
 test/meson.build | 31 ++++++++++++++++++-------------
 2 files changed, 20 insertions(+), 14 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ndctl PATCH 1/2] ndctl: Fix missing key_type parameter in ndctl_dimm_remove_key stub
  2026-03-10  2:41 [ndctl PATCH 0/2] ndctl: Fix build issues when fwctl is disabled cp0613
@ 2026-03-10  2:41 ` cp0613
  2026-03-19  0:45   ` Alison Schofield
  2026-03-10  2:41 ` [ndctl PATCH 2/2] ndctl/test: Fix meson configuration error when fwctl is disabled cp0613
  1 sibling, 1 reply; 5+ messages in thread
From: cp0613 @ 2026-03-10  2:41 UTC (permalink / raw)
  To: ishal.l.verma, alison.schofield, nvdimm; +Cc: linux-cxl, Chen Pei

From: Chen Pei <cp0613@linux.alibaba.com>

When fwctl is disabled, the following compilation error occurs:

  ../ndctl/dimm.c: In function ‘action_remove_passphrase’:
  ../ndctl/dimm.c:1030:16: error: too many arguments to function ‘ndctl_dimm_remove_key’
   1030 |         return ndctl_dimm_remove_key(dimm, param.master_pass ? ND_MASTER_KEY :
        |                ^~~~~~~~~~~~~~~~~~~~~
  In file included from ../ndctl/dimm.c:25:
  ../ndctl/keys.h:51:19: note: declared here
     51 | static inline int ndctl_dimm_remove_key(struct ndctl_dimm *dimm)
        |                   ^~~~~~~~~~~~~~~~~~~~~

This patch fixes the issue by adding the missing key_type parameter to
the stub declaration of ndctl_dimm_remove_key in keys.h, ensuring the
function signature matches its usage.

Fixes: a79375a9b0cd ("ndctl: Add  master-passphrase removal support")

Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
---
 ndctl/keys.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ndctl/keys.h b/ndctl/keys.h
index ce71ff2..b60c209 100644
--- a/ndctl/keys.h
+++ b/ndctl/keys.h
@@ -48,7 +48,8 @@ static inline int ndctl_dimm_update_key(struct ndctl_dimm *dimm,
 	return -EOPNOTSUPP;
 }
 
-static inline int ndctl_dimm_remove_key(struct ndctl_dimm *dimm)
+static inline int ndctl_dimm_remove_key(struct ndctl_dimm *dimm,
+		enum ndctl_key_type key_type)
 {
 	return -EOPNOTSUPP;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [ndctl PATCH 2/2] ndctl/test: Fix meson configuration error when fwctl is disabled
  2026-03-10  2:41 [ndctl PATCH 0/2] ndctl: Fix build issues when fwctl is disabled cp0613
  2026-03-10  2:41 ` [ndctl PATCH 1/2] ndctl: Fix missing key_type parameter in ndctl_dimm_remove_key stub cp0613
@ 2026-03-10  2:41 ` cp0613
  2026-03-19  0:39   ` Alison Schofield
  1 sibling, 1 reply; 5+ messages in thread
From: cp0613 @ 2026-03-10  2:41 UTC (permalink / raw)
  To: ishal.l.verma, alison.schofield, nvdimm; +Cc: linux-cxl, Chen Pei

From: Chen Pei <cp0613@linux.alibaba.com>

The meson.build script unconditionally references the fwctl
executable in the depends list of test definitions. However,
fwctl is only defined when the fwctl build option is enabled.
This causes a meson configuration error:

  test/meson.build:283:6: ERROR: Unknown variable "fwctl".

when building with -Dfwctl=disabled.

This patch fixes the issue by moving the test dependencies
into a conditional list (tests_deps) that includes fwctl only
when the option is enabled, ensuring all referenced variables
are properly defined during meson configuration.

Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
---
 test/meson.build | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/test/meson.build b/test/meson.build
index 615376e..a4e3805 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -267,22 +267,27 @@ test_env = [
     'DATA_PATH=@0@'.format(meson.current_source_dir()),
 ]
 
+tests_deps = [
+  ndctl_tool,
+  daxctl_tool,
+  cxl_tool,
+  smart_notify,
+  list_smart_dimm,
+  dax_pmd,
+  dax_errors,
+  daxdev_errors,
+  dax_dev,
+  mmap,
+]
+
+if get_option('fwctl').enabled()
+  tests_deps += [fwctl]
+endif
+
 foreach t : tests
   test(t[0], t[1],
     is_parallel : false,
-    depends : [
-      ndctl_tool,
-      daxctl_tool,
-      cxl_tool,
-      smart_notify,
-      list_smart_dimm,
-      dax_pmd,
-      dax_errors,
-      daxdev_errors,
-      dax_dev,
-      fwctl,
-      mmap,
-    ],
+    depends : tests_deps,
     suite: t[2],
     timeout : 600,
     env : test_env,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [ndctl PATCH 2/2] ndctl/test: Fix meson configuration error when fwctl is disabled
  2026-03-10  2:41 ` [ndctl PATCH 2/2] ndctl/test: Fix meson configuration error when fwctl is disabled cp0613
@ 2026-03-19  0:39   ` Alison Schofield
  0 siblings, 0 replies; 5+ messages in thread
From: Alison Schofield @ 2026-03-19  0:39 UTC (permalink / raw)
  To: cp0613; +Cc: vishal.l.verma, nvdimm, linux-cxl

On Tue, Mar 10, 2026 at 10:41:02AM +0800, cp0613@linux.alibaba.com wrote:
> From: Chen Pei <cp0613@linux.alibaba.com>
> 
> The meson.build script unconditionally references the fwctl
> executable in the depends list of test definitions. However,
> fwctl is only defined when the fwctl build option is enabled.
> This causes a meson configuration error:
> 
>   test/meson.build:283:6: ERROR: Unknown variable "fwctl".
> 
> when building with -Dfwctl=disabled.
> 
> This patch fixes the issue by moving the test dependencies
> into a conditional list (tests_deps) that includes fwctl only
> when the option is enabled, ensuring all referenced variables
> are properly defined during meson configuration.

Thanks for the patch Chen Pei!

I've applied it with a minor commit message change:
https://github.com/pmem/ndctl/commits/pending/



> 
> Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
> ---
>  test/meson.build | 31 ++++++++++++++++++-------------
>  1 file changed, 18 insertions(+), 13 deletions(-)
> 
> diff --git a/test/meson.build b/test/meson.build
> index 615376e..a4e3805 100644
> --- a/test/meson.build
> +++ b/test/meson.build
> @@ -267,22 +267,27 @@ test_env = [
>      'DATA_PATH=@0@'.format(meson.current_source_dir()),
>  ]
>  
> +tests_deps = [
> +  ndctl_tool,
> +  daxctl_tool,
> +  cxl_tool,
> +  smart_notify,
> +  list_smart_dimm,
> +  dax_pmd,
> +  dax_errors,
> +  daxdev_errors,
> +  dax_dev,
> +  mmap,
> +]
> +
> +if get_option('fwctl').enabled()
> +  tests_deps += [fwctl]
> +endif
> +
>  foreach t : tests
>    test(t[0], t[1],
>      is_parallel : false,
> -    depends : [
> -      ndctl_tool,
> -      daxctl_tool,
> -      cxl_tool,
> -      smart_notify,
> -      list_smart_dimm,
> -      dax_pmd,
> -      dax_errors,
> -      daxdev_errors,
> -      dax_dev,
> -      fwctl,
> -      mmap,
> -    ],
> +    depends : tests_deps,
>      suite: t[2],
>      timeout : 600,
>      env : test_env,
> -- 
> 2.43.0
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ndctl PATCH 1/2] ndctl: Fix missing key_type parameter in ndctl_dimm_remove_key stub
  2026-03-10  2:41 ` [ndctl PATCH 1/2] ndctl: Fix missing key_type parameter in ndctl_dimm_remove_key stub cp0613
@ 2026-03-19  0:45   ` Alison Schofield
  0 siblings, 0 replies; 5+ messages in thread
From: Alison Schofield @ 2026-03-19  0:45 UTC (permalink / raw)
  To: cp0613; +Cc: ishal.l.verma, nvdimm, linux-cxl

On Tue, Mar 10, 2026 at 10:41:01AM +0800, cp0613@linux.alibaba.com wrote:
> From: Chen Pei <cp0613@linux.alibaba.com>
> 
> When fwctl is disabled, the following compilation error occurs:
> 

Thanks for the patch Chen Pei!

This failure does not appear to be tied to -Dfwctl=disabled.
The mismatch is gated by ENABLE_KEYUTILS in keys.h, so this
should be reproducible when keytuils support is disabled, 
not fwctl.

Please update the commit message to reflect the correct
configuration trigger.

Send a v2 of this patch alone, since I've already applied
the other patch in this series.

-- Alison


>   ../ndctl/dimm.c: In function ‘action_remove_passphrase’:
>   ../ndctl/dimm.c:1030:16: error: too many arguments to function ‘ndctl_dimm_remove_key’
>    1030 |         return ndctl_dimm_remove_key(dimm, param.master_pass ? ND_MASTER_KEY :
>         |                ^~~~~~~~~~~~~~~~~~~~~
>   In file included from ../ndctl/dimm.c:25:
>   ../ndctl/keys.h:51:19: note: declared here
>      51 | static inline int ndctl_dimm_remove_key(struct ndctl_dimm *dimm)
>         |                   ^~~~~~~~~~~~~~~~~~~~~
> 
> This patch fixes the issue by adding the missing key_type parameter to
> the stub declaration of ndctl_dimm_remove_key in keys.h, ensuring the
> function signature matches its usage.
> 
> Fixes: a79375a9b0cd ("ndctl: Add  master-passphrase removal support")
> 
> Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
> ---
>  ndctl/keys.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/ndctl/keys.h b/ndctl/keys.h
> index ce71ff2..b60c209 100644
> --- a/ndctl/keys.h
> +++ b/ndctl/keys.h
> @@ -48,7 +48,8 @@ static inline int ndctl_dimm_update_key(struct ndctl_dimm *dimm,
>  	return -EOPNOTSUPP;
>  }
>  
> -static inline int ndctl_dimm_remove_key(struct ndctl_dimm *dimm)
> +static inline int ndctl_dimm_remove_key(struct ndctl_dimm *dimm,
> +		enum ndctl_key_type key_type)
>  {
>  	return -EOPNOTSUPP;
>  }
> -- 
> 2.43.0
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-19  0:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10  2:41 [ndctl PATCH 0/2] ndctl: Fix build issues when fwctl is disabled cp0613
2026-03-10  2:41 ` [ndctl PATCH 1/2] ndctl: Fix missing key_type parameter in ndctl_dimm_remove_key stub cp0613
2026-03-19  0:45   ` Alison Schofield
2026-03-10  2:41 ` [ndctl PATCH 2/2] ndctl/test: Fix meson configuration error when fwctl is disabled cp0613
2026-03-19  0:39   ` Alison Schofield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox