mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
dm crypt: fix get_key_size compiler warning if !CONFIG_KEYS
[ Upstream commit6fc5150438
] 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:c538f6ec9f
("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>
This commit is contained in:
parent
958b599015
commit
29cabf372b
1 changed files with 1 additions and 1 deletions
|
@ -2590,7 +2590,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 */
|
||||
|
|
Loading…
Reference in a new issue