ndctl: Fix missing key_type parameter in ndctl_dimm_remove_key stub
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.
--- ndctl/keys.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
ndctl/keys.h +2 -1
@@ -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
Alison Schofield
maintainerQuoted 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 intndctl_dimm_remove_key(struct ndctl_dimm *dimm)
| ^~~~~~~~~~~~~~~~~~~~~
Quoted 7 lines
This patch fixes the issue by adding the missing
key_typeparameter to the stub declaration ofndctl_dimm_remove_keyinkeys.h, ensuring the function signature matches its usage.Fixes a79375a9b0cd ("ndctl: Add master-passphrase removal support")Signed-off-by Chen Pei <[email protected]>
Applied https://github.com/pmem/ndctl/commits/pending/
Thanks!