Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8897812rwb; Tue, 13 Dec 2022 11:55:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf6lrGCsmUjFwcha1w70kFxxVtHtmzT+frm278K6bUva2mNKms/ZT09eNF3QqIImWijHDpdg X-Received: by 2002:a05:6402:1cce:b0:470:49a2:ad7d with SMTP id ds14-20020a0564021cce00b0047049a2ad7dmr2117479edb.25.1670961301048; Tue, 13 Dec 2022 11:55:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670961301; cv=none; d=google.com; s=arc-20160816; b=u5P4jON28QutjgyRA2Ih12mpDg9cLnak6WmbEE4dJVJQYKRzFEkiwBTDKymV2kXyDM urzaOjRaZH6U8DoOWwYvwChh2cMjSD0ERLZh8ma+bVTeGOIdQT9x05Lif05lCRK52OTQ 2PAKX+b/wR2l6ue29nL04Jw9rVwJ/2EiR7fKwLgOLfbEqbxKgep0Ok1UEclDIs16RcVp Vl864sPaZb0SCeZplN6feBCeusCCj9VX4cVT09WmzKUBzQTPjPpndDbD+PzDkLgqBSmB 4iVaEWzKpDkHO9w6VnhrX8g/4jE56qensdT5oUEKGdoYjt8yewCzk1Z0gJGLpqbjCwVV FLVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZBCl5Px+e8B7Mi0hZy5CXkaj5905nPAIbEpkCENDm7M=; b=0oRuIA6Rh/BPVucBXKn/m3+UiTf57IFeRWAZngguCCoB/z9kCV5XblthkEn5M9uggF z3ysMb0Z+ZKp5+XJJ9NTBWYZu2KrbPYjInRZ+TSzMkEmBxel7Si34j9eTs1CG3jYDeeP ft4GMPxJprJ3QsL5gAyT2R+YFvkzMa110k/QzduiayL5HJ1OVWfnOCricCRu+6bSBA/J 9yV/d2NGt7eXLpIhAHaO4TQwCnsfgFBXX+1hHAhn/L3SMirkQbVckBsURHMni0x672JL ImZfCbOVBDfEaXH+a116GS4PVRB92Pda2MKvDjCubpNhbqzxfJC9zMqtHqi7Z25D8sxs SpYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FtnCt7ND; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y16-20020aa7ce90000000b0046cc4440fbasi9901283edv.434.2022.12.13.11.54.32; Tue, 13 Dec 2022 11:55:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FtnCt7ND; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235551AbiLMTp1 (ORCPT + 99 others); Tue, 13 Dec 2022 14:45:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236715AbiLMTp0 (ORCPT ); Tue, 13 Dec 2022 14:45:26 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21EE0DFF6; Tue, 13 Dec 2022 11:45:26 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id B29836171D; Tue, 13 Dec 2022 19:45:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9C8EC433D2; Tue, 13 Dec 2022 19:45:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670960725; bh=Rus8LKt6JC2vTsynj6VmjIXsVmtuWiGAxvSB33tcGtU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FtnCt7NDom2YFBeiaXE07DgnEvo+e0z+9S42m7CDIRcmHqKGrsUyMH/yUuOQN7gCa bu/M4IALLygYoc+Tx2ovEk1nkkghHLG+S5k9RIZI71lx0nv11s9RawHc5Iv3gjDJML 16uLLLO1WjeKBjCV1Gd+19LTqKZQNxvyN6iEIyoEOU6OdF495BwK9SRVT8dE5jzbOo HpvX014WRDFHwMbcFuMulVlQDT5rdoBZ8UcfWFjks3bohla5hDciiuK6y+Y3DBcrvm xjFvDppW4y0Dj19fs3ma16blEXCBDQtGqJ9ctpaxidhH3g964Mwksi16aSDeZL3IUE vFAhq+T+mO6Ww== Date: Tue, 13 Dec 2022 11:45:23 -0800 From: Eric Biggers To: Herbert Xu Cc: Ard Biesheuvel , kernel test robot , Robert Elliott , llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Linux Crypto Mailing List Subject: Re: [PATCH] crypto: arm/sha1 - Fix clang function cast warnings Message-ID: References: <202211041904.f9S5gAGL-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Dec 13, 2022 at 06:43:30PM +0800, Herbert Xu wrote: > -asmlinkage void sha1_block_data_order(u32 *digest, > - const unsigned char *data, unsigned int rounds); > +asmlinkage void sha1_block_data_order(struct sha1_state *digest, > + const u8 *data, int rounds); The last parameter should be called 'blocks', not 'rounds'. > int sha1_update_arm(struct shash_desc *desc, const u8 *data, > unsigned int len) > { > - /* make sure casting to sha1_block_fn() is safe */ > + /* make sure signature matches sha1_block_fn() */ > BUILD_BUG_ON(offsetof(struct sha1_state, state) != 0); The above comment doesn't really make sense, since making sure function signatures match is the responsibility of the compiler. A better comment would be: /* sha1_block_data_order() expects the actual state at the beginning. */ It would also be helpful to add a comment to the definition of struct sha1_state, analogous to the comment in struct blake2s_state: struct sha1_state { /* 'state' is used by assembly code, so keep it as-is. */ u32 state[SHA1_DIGEST_SIZE / 4]; - Eric