Commit 6fc51504 authored by Aashish Sharma's avatar Aashish Sharma Committed by Mike Snitzer
Browse files

dm crypt: fix get_key_size compiler warning if !CONFIG_KEYS



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: c538f6ec ("dm crypt: add ability to use keys from the kernel key retention service")
Signed-off-by: default avatarAashish Sharma <shraash@google.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 588b7f5d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2582,7 +2582,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 /* CONFIG_KEYS */