From a7c33264f9d5fd9523842ef2faddbe32e931a003 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 27 Dec 2020 12:17:15 +0100 Subject: [PATCH] ANDROID: crypto: keysetup: use FSCRYPT_MODE_MAX instead of __FSCRYPT_MODE_MAX In 5.10.3 the commit 3b7c17a81426 ("fscrypt: remove kernel-internal constants from UAPI header") removes __FSCRYPT_MODE_MAX so we need to fix up the out-of-tree crypto code in the android12-5.10 branch that uses it to keep the build working properly. Fixes: 3b7c17a81426 ("fscrypt: remove kernel-internal constants from UAPI header") Cc: Eric Biggers Signed-off-by: Greg Kroah-Hartman Change-Id: I8e6dc371e46d37583c488ccdaec500c46a9734a8 --- fs/crypto/keysetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/crypto/keysetup.c b/fs/crypto/keysetup.c index 83a9a3a01357..f46c939f4109 100644 --- a/fs/crypto/keysetup.c +++ b/fs/crypto/keysetup.c @@ -200,7 +200,7 @@ static int setup_per_mode_enc_key(struct fscrypt_info *ci, err = -EINVAL; goto out_unlock; } - for (i = 0; i <= __FSCRYPT_MODE_MAX; i++) { + for (i = 0; i <= FSCRYPT_MODE_MAX; i++) { if (fscrypt_is_key_prepared(&keys[i], ci)) { fscrypt_warn(ci->ci_inode, "Each hardware-wrapped key can only be used with one encryption mode");