Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5988195ybc; Wed, 27 Nov 2019 12:59:20 -0800 (PST) X-Google-Smtp-Source: APXvYqynLokvrjgqBJwvbpL1cG13hcDtVV95Ld5YbHd8Wkw9DZ95qqdNzhwO9q1OaEUZMdCOVSOU X-Received: by 2002:a50:ef16:: with SMTP id m22mr34128207eds.154.1574888360447; Wed, 27 Nov 2019 12:59:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888360; cv=none; d=google.com; s=arc-20160816; b=FubrJt2gqCsQ45jnaXPQ/LrtXjifbGjbast2XtRh+Q0yG/r5F02QP/ZAB5U/TCo+u1 Htxmgv0/WynxUxj5i721ELySCc+nO+stelhMThRq40irUdQ5JcwQt0XvPDO4KL8wEuv4 CmX27uiSW4QlnSkLagPwktTqsRJREh6WdgXHkXZ0CRuJ4DinZMscYgXIcBcy6xHIdlEd hz3MhOSiqqVL07AftoA3xQ6Kxt1v43LB/9iogQW5Roz6VaLDd5fULMWaVPox8glasHfk 06CCp/Trgp2iLxQvyz8GPYQgypApPW3FQkef87Hc7xBv2/btijdv5Mwr/cuADmld2sTK QQ8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IbSHHNJ1BJfnBSRPxWTZVjVs2LppG/RFWPjvkslQXWg=; b=POnlo+dA5IFiN9fmsg2vNhtO4jznbitXk0NN1HoikRXwqOiS1pHWUOAmY+Ojs59sMs 52ZPmRqSZYJ6byMhSiyGMfGk4SETo980sFa9zUF8anwFZGg1S/8BsD31bttmSJw1KN+o V4jF/zLyXBwjHMeMbkAKxoki0CeQ2YIN51BbVxU+ZfLD9eiG2AU2vbblvWoF3NBuqT+2 H4Ii48eG/rkTAIFXDazkDkSONmw6+BBEWES2NCKjm75OSRwJq6KkY4MdzH87sRdGhdU6 gpoldmTrw9vruDDI193rrYl6kAP0oT9rRNVti9JGmlKmrwRkZtLpbQ2HH45EpnYmParS euAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t+Wm45ze; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o10si13055846edj.316.2019.11.27.12.58.57; Wed, 27 Nov 2019 12:59:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t+Wm45ze; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731269AbfK0U6E (ORCPT + 99 others); Wed, 27 Nov 2019 15:58:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:49228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730054AbfK0U6D (ORCPT ); Wed, 27 Nov 2019 15:58:03 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 599E42084D; Wed, 27 Nov 2019 20:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888282; bh=OKqeG2P+tPeyHFAyZKVWcBe8xkMu2lCZ2qbbeu6ZUeo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t+Wm45zeLQg0eRG/yQge8a7zbK5adzzvENgx0F5qEuV4Yt1aTjs76eLAXe/tvaxvc WeaL6yTt1xTnAU3+Cp2+A+BUZUZSmuJ0mVB1Cf6wSqauNt8OXrH4cxdQHPDY4vsWN9 dg0QbnXaLujRBtmCCGwQyUWGz0rJz6dBJgdmRMeI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Gilad Ben-Yossef , Nick Desaulniers , Herbert Xu , Sasha Levin Subject: [PATCH 4.19 074/306] crypto: ccree - avoid implicit enum conversion Date: Wed, 27 Nov 2019 21:28:44 +0100 Message-Id: <20191127203120.260795091@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit 18e732b8035d175181aae2ded127994cb01694f7 ] Clang warns when one enumerated type is implicitly converted to another and this happens in several locations in this driver, ultimately related to the set_cipher_{mode,config0} functions. set_cipher_mode expects a mode of type drv_cipher_mode and set_cipher_config0 expects a mode of type drv_crypto_direction. drivers/crypto/ccree/cc_ivgen.c:58:35: warning: implicit conversion from enumeration type 'enum cc_desc_direction' to different enumeration type 'enum drv_crypto_direction' [-Wenum-conversion] set_cipher_config0(&iv_seq[idx], DESC_DIRECTION_ENCRYPT_ENCRYPT); drivers/crypto/ccree/cc_hash.c:99:28: warning: implicit conversion from enumeration type 'enum cc_hash_conf_pad' to different enumeration type 'enum drv_crypto_direction' [-Wenum-conversion] set_cipher_config0(desc, HASH_DIGEST_RESULT_LITTLE_ENDIAN); drivers/crypto/ccree/cc_aead.c:1643:30: warning: implicit conversion from enumeration type 'enum drv_hash_hw_mode' to different enumeration type 'enum drv_cipher_mode' [-Wenum-conversion] set_cipher_mode(&desc[idx], DRV_HASH_HW_GHASH); Since this fundamentally isn't a problem because these values just represent simple integers for a shift operation, make it clear to Clang that this is okay by making the mode parameter in both functions an int. Link: https://github.com/ClangBuiltLinux/linux/issues/46 Signed-off-by: Nathan Chancellor Acked-by: Gilad Ben-Yossef Reviewed-by: Nick Desaulniers Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/ccree/cc_hw_queue_defs.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ccree/cc_hw_queue_defs.h b/drivers/crypto/ccree/cc_hw_queue_defs.h index a091ae57f9024..45985b955d2c8 100644 --- a/drivers/crypto/ccree/cc_hw_queue_defs.h +++ b/drivers/crypto/ccree/cc_hw_queue_defs.h @@ -449,8 +449,7 @@ static inline void set_flow_mode(struct cc_hw_desc *pdesc, * @pdesc: pointer HW descriptor struct * @mode: Any one of the modes defined in [CC7x-DESC] */ -static inline void set_cipher_mode(struct cc_hw_desc *pdesc, - enum drv_cipher_mode mode) +static inline void set_cipher_mode(struct cc_hw_desc *pdesc, int mode) { pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_MODE, mode); } @@ -461,8 +460,7 @@ static inline void set_cipher_mode(struct cc_hw_desc *pdesc, * @pdesc: pointer HW descriptor struct * @mode: Any one of the modes defined in [CC7x-DESC] */ -static inline void set_cipher_config0(struct cc_hw_desc *pdesc, - enum drv_crypto_direction mode) +static inline void set_cipher_config0(struct cc_hw_desc *pdesc, int mode) { pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_CONF0, mode); } -- 2.20.1