From patchwork Sat Mar 24 11:02:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 10305937 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D6374600F6 for ; Sat, 24 Mar 2018 11:02:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B602F28742 for ; Sat, 24 Mar 2018 11:02:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA0AB287A5; Sat, 24 Mar 2018 11:02:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EED4D28742 for ; Sat, 24 Mar 2018 11:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751879AbeCXLCr (ORCPT ); Sat, 24 Mar 2018 07:02:47 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:43052 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751843AbeCXLCq (ORCPT ); Sat, 24 Mar 2018 07:02:46 -0400 Received: from trochilidae.lan (unknown [IPv6:2001:1620:c6e::127]) by mail.kmu-office.ch (Postfix) with ESMTPSA id BA2915C040F; Sat, 24 Mar 2018 12:02:18 +0100 (CET) From: Stefan Agner To: herbert@gondor.apana.org.au, davem@davemloft.net, raveendra.padasalagi@broadcom.com, clabbe.montjoie@gmail.com Cc: scott.branden@broadcom.com, steven.lin1@broadcom.com, garsilva@embeddedor.com, pravin.shedge4linux@gmail.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Agner Subject: [RFC PATCH] crypto: brcm - explicitly cast cipher to hash type Date: Sat, 24 Mar 2018 12:02:42 +0100 Message-Id: <20180324110242.9474-1-stefan@agner.ch> X-Mailer: git-send-email 2.16.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1521889338; bh=oyi/E/gvmMRjIGff0a0w2CgXU8rbDJOzA4o3F7oznLU=; h=From:To:Cc:Subject:Date:Message-Id; b=y1BFaIyb2G1R8ws+qpp19LUl1D1D5eD81iyMJr9ooDvf+q4OqQE9nnniO+YJxOwkojhjUL3pcrH+NKbaV2lAEZxzVkTtVo1oqCE/oEHcS3Um81Mw5gEmTQV9+NLTKbZnUF05/7fERW5ykqYQJEDK7Hof3D3LCTG4C+NJk/cFtAQ= Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the AES cases enum spu_cipher_type and enum hash_type have the same values, so the assignment is fine. Explicitly cast the enum type conversion. This fixes two warnings when building with clang: drivers/crypto/bcm/cipher.c:821:34: warning: implicit conversion from enumeration type 'enum spu_cipher_type' to different enumeration type 'enum hash_type' [-Wenum-conversion] hash_parms.type = cipher_parms.type; ~ ~~~~~~~~~~~~~^~~~ drivers/crypto/bcm/cipher.c:1412:26: warning: implicit conversion from enumeration type 'enum spu_cipher_type' to different enumeration type 'enum hash_type' [-Wenum-conversion] hash_parms.type = ctx->cipher_type; ~ ~~~~~^~~~~~~~~~~ Signed-off-by: Stefan Agner --- I am not familar with the IP... I would be glad if somebody with better insight could have a look whether that patch makes sense. drivers/crypto/bcm/cipher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index 2b75f95bbe1b..309c67c7012f 100644 --- a/drivers/crypto/bcm/cipher.c +++ b/drivers/crypto/bcm/cipher.c @@ -818,7 +818,7 @@ static int handle_ahash_req(struct iproc_reqctx_s *rctx) /* AES hashing keeps key size in type field, so need to copy it here */ if (hash_parms.alg == HASH_ALG_AES) - hash_parms.type = cipher_parms.type; + hash_parms.type = (enum hash_type)cipher_parms.type; else hash_parms.type = spu->spu_hash_type(rctx->total_sent); @@ -1409,7 +1409,7 @@ static int handle_aead_req(struct iproc_reqctx_s *rctx) rctx->iv_ctr_len); if (ctx->auth.alg == HASH_ALG_AES) - hash_parms.type = ctx->cipher_type; + hash_parms.type = (enum hash_type)ctx->cipher_type; /* General case AAD padding (CCM and RFC4543 special cases below) */ aead_parms.aad_pad_len = spu->spu_gcm_ccm_pad_len(ctx->cipher.mode,