Skip to contentSkip to conversation

ndctl: Fix build issues when fwctl is disabled

PATCH Superseded [email protected] 2 participants 5 messages Mar 10 – Mar 19

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover ndctl: Fix build issues when fwctl is disabled

From: Chen Pei <[email protected]>

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(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/2 ndctl: Fix missing key_type parameter in ndctl_dimm_remove_key stub

From: Chen Pei <[email protected]>

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")
---
 ndctl/keys.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
ndctl/keys.h +2 -1
index ce71ff2..b60c209 100644
@@ -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;
 }
Signature · 1 line
2.43.0
#3 lore raw

PATCH 2/2 ndctl/test: Fix meson configuration error when fwctl is disabled

In reply to [email protected]

From: Chen Pei <[email protected]>

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.

---
 test/meson.build | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)
test/meson.build +18 -13
index 615376e..a4e3805 100644
@@ -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,
Signature · 1 line
2.43.0
maintainer
#4 lore raw

Re: [ndctl PATCH 2/2] ndctl/test: Fix meson configuration error when fwctl is disabled

Quoted 7 lines · On Tue, Mar 10, 2026 at 10:41:02AM +0800, [email protected] wrote:

From: Chen Pei <[email protected]>

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:

Quoted 8 lines

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/

Quoted 55 lines
---
 test/meson.build | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)
test/meson.build +18 -13
index 615376e..a4e3805 100644
@@ -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,
Signature · 1 line
2.43.0
maintainer
#2 lore raw

Re: [ndctl PATCH 1/2] ndctl: Fix missing key_type parameter in ndctl_dimm_remove_key stub

In reply to [email protected]
Quoted 4 lines · On Tue, Mar 10, 2026 at 10:41:01AM +0800, [email protected] wrote:

From: Chen Pei <[email protected]>

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

Quoted 37 lines

../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")
---
 ndctl/keys.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
ndctl/keys.h +2 -1
index ce71ff2..b60c209 100644
@@ -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;
 }
Signature · 1 line
2.43.0