lkml.org 
[lkml]   [2022]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 182/475] dm crypt: fix get_key_size compiler warning if !CONFIG_KEYS
    Date
    From: Aashish Sharma <shraash@google.com>

    [ 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>
    ---
    drivers/md/dm-crypt.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
    index 571c04e70343..3ed8ca47bc6e 100644
    --- a/drivers/md/dm-crypt.c
    +++ b/drivers/md/dm-crypt.c
    @@ -2010,7 +2010,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
    --
    2.34.1


    \
     
     \ /
      Last update: 2022-04-14 17:11    [W:3.184 / U:0.652 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site