From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37E5BC433F5 for ; Thu, 14 Apr 2022 13:35:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242360AbiDNNhK (ORCPT ); Thu, 14 Apr 2022 09:37:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244502AbiDNN1e (ORCPT ); Thu, 14 Apr 2022 09:27:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 387A597BA9; Thu, 14 Apr 2022 06:20:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E44BDB82910; Thu, 14 Apr 2022 13:20:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35B61C385A5; Thu, 14 Apr 2022 13:20:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649942416; bh=iQtxJ56id/+EmDG8JKDb8NZeezi+pYDMNN57Cf0Csr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0yBv8aDXnAxUs3J9euX2DJ9bOpuMzW3Gp6Jg4nxemrhxcGeDvivdm9G8kdZ34i/bh O7Up/XqBxQ1kKn+D3AcHWVIVWD8OMEFQobym3hOH/4xnSiidC78pF8Krag6AW5C2/9 rSRljxppOSvslhwYQS167LCCMFc1qoxubfCnSP3g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aashish Sharma , Mike Snitzer , Sasha Levin Subject: [PATCH 4.19 128/338] dm crypt: fix get_key_size compiler warning if !CONFIG_KEYS Date: Thu, 14 Apr 2022 15:10:31 +0200 Message-Id: <20220414110842.544912086@linuxfoundation.org> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220414110838.883074566@linuxfoundation.org> References: <20220414110838.883074566@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aashish Sharma [ 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 Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- 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 a6a26f8e4d8e..3441ad140b58 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -2107,7 +2107,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