Skip to contentSkip to conversation

ndctl: Fix missing key_type parameter in ndctl_dimm_remove_key stub

PATCH In review [email protected] 2 participants 2 messages Mar 19 – Mar 20 libnvdimm: non-volatile memory device

lore
Share & tools
lore
#0 lore raw

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

From: Chen Pei <[email protected]>

When keyutils 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
maintainer
#1 lore raw
Quoted 13 lines · On Thu, Mar 19, 2026 at 09:51:49AM +0800, [email protected] wrote:

From: Chen Pei <[email protected]>

When keyutils 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)
| ^~~~~~~~~~~~~~~~~~~~~

Quoted 7 lines

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")

Applied https://github.com/pmem/ndctl/commits/pending/
Thanks!