From 8ca46ad9700033b232bc30023c6a45cc3dcf88ba Mon Sep 17 00:00:00 2001 From: Oliver O'Halloran Date: Tue, 5 Feb 2019 19:16:52 +1100 Subject: [PATCH] ndctl: Fix building in the absence of keyutils Fix build errors when ndctl is configured without keyutils support. Fixes: 79728f15fb6f ("ndctl: allow for a 'secure erase' using the master passphrase") Fixes: 9925be9d6793 ("ndctl: add a load-keys command and a modprobe config") Signed-off-by: Oliver O'Halloran Signed-off-by: Vishal Verma --- ndctl/ndctl.c | 2 ++ ndctl/util/keys.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ndctl/ndctl.c b/ndctl/ndctl.c index b5c3bf88..bd333b29 100644 --- a/ndctl/ndctl.c +++ b/ndctl/ndctl.c @@ -93,7 +93,9 @@ static struct cmd_struct commands[] = { { "remove-passphrase", { cmd_remove_passphrase } }, { "freeze-security", { cmd_freeze_security } }, { "sanitize-dimm", { cmd_sanitize_dimm } }, +#ifdef ENABLE_KEYUTILS { "load-keys", { cmd_load_keys } }, +#endif { "wait-overwrite", { cmd_wait_overwrite } }, { "list", { cmd_list } }, { "monitor", { cmd_monitor } }, diff --git a/ndctl/util/keys.h b/ndctl/util/keys.h index c4d57eae..30687a13 100644 --- a/ndctl/util/keys.h +++ b/ndctl/util/keys.h @@ -46,7 +46,7 @@ static inline int ndctl_dimm_remove_key(struct ndctl_dimm *dimm) } static inline int ndctl_dimm_secure_erase_key(struct ndctl_dimm *dimm, - enum ndctl_key_type key_type); + enum ndctl_key_type key_type) { return -EOPNOTSUPP; }