summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAashish Sharma <shraash@google.com>2022-02-11 15:15:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-20 10:08:17 +0300
commit455750e8e91cd367a6087929a62e536e03c27b18 (patch)
tree42b89ca282588a58014074869a5fe13cabd599e7 /drivers
parentc120ca2386e33acad842a41a0d89e11c029963e2 (diff)
downloadlinux-455750e8e91cd367a6087929a62e536e03c27b18.tar.xz
dm crypt: fix get_key_size compiler warning if !CONFIG_KEYS
[ Upstream commit 6fc51504388c1a1a53db8faafe9fff78fccc7c87 ] Explicitly convert unsigned int in the right of the conditional expression to int to match the left side operand and the return type, fixing the following compiler warning: drivers/md/dm-crypt.c:2593:43: warning: signed and unsigned type in conditional expression [-Wsign-compare] Fixes: c538f6ec9f56 ("dm crypt: add ability to use keys from the kernel key retention service") Signed-off-by: Aashish Sharma <shraash@google.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-crypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index b8a9695af141..0b6d4337aaab 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -2114,7 +2114,7 @@ static int crypt_set_keyring_key(struct crypt_config *cc, const char *key_string
static int get_key_size(char **key_string)
{
- return (*key_string[0] == ':') ? -EINVAL : strlen(*key_string) >> 1;
+ return (*key_string[0] == ':') ? -EINVAL : (int)(strlen(*key_string) >> 1);
}
#endif