From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20CB1138A; Sat, 24 Feb 2024 00:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=144.6.53.87 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708735821; cv=none; b=gd2DIRIWFAfccX/srFjTERMpuM3juCR0t5r6/fT+ZGlXmL7FiLS0AmjZIUyTbkTuikNfbQWYdALBKVlKZpFvOnTVjaM/4DbgOkFt9nbNI3hMKa5Aom6EN43ZKaPD5YeevxlvezwAzKNsXQBXCXmf4t3RwesVZkhLmNfm8G5jmAQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708735821; c=relaxed/simple; bh=OURXWeTGQgQ2HAg6ncbqMkI52asahTJjjBDFRcVHSJQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bkUAI1w6aiABy0DqDkWqrX4ANCYsMtGxXRDu9B5VrcSSzgOOOnyVivhXRVU/b5G5uhcfK49/9Pv5D8pcQCU6kmDLXo8ZWPmcqQKaamwuJRUlC4VnMeEcxkEnL8dDp5opD+qRJcljMoWbHNa+f5C+2d4ApEyCzVfBZWyK1jggOWM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au; spf=pass smtp.mailfrom=gondor.apana.org.au; arc=none smtp.client-ip=144.6.53.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gondor.apana.org.au Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1rdgEX-00HDv3-Uo; Sat, 24 Feb 2024 08:49:43 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Sat, 24 Feb 2024 08:49:56 +0800 Date: Sat, 24 Feb 2024 08:49:56 +0800 From: Herbert Xu To: Arnd Bergmann Cc: Arnd Bergmann , "David S. Miller" , Russell King , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Ard Biesheuvel , Jussi Kivilinna , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] [v2] ARM: crypto: fix function cast warnings Message-ID: References: <20240213135000.3400052-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240213135000.3400052-1-arnd@kernel.org> On Tue, Feb 13, 2024 at 02:49:46PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > clang-16 warns about casting between incompatible function types: > > arch/arm/crypto/sha256_glue.c:37:5: error: cast from 'void (*)(u32 *, const void *, unsigned int)' (aka 'void (*)(unsigned int *, const void *, unsigned int)') to 'sha256_block_fn *' (aka 'void (*)(struct sha256_state *, const unsigned char *, int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] > 37 | (sha256_block_fn *)sha256_block_data_order); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > arch/arm/crypto/sha512-glue.c:34:3: error: cast from 'void (*)(u64 *, const u8 *, int)' (aka 'void (*)(unsigned long long *, const unsigned char *, int)') to 'sha512_block_fn *' (aka 'void (*)(struct sha512_state *, const unsigned char *, int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] > 34 | (sha512_block_fn *)sha512_block_data_order); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Fix the prototypes for the assembler functions to match the typedef. > The code already relies on the digest being the first part of the > state structure, so there is no change in behavior. > > Fixes: c80ae7ca3726 ("crypto: arm/sha512 - accelerated SHA-512 using ARM generic ASM and NEON") > Fixes: b59e2ae3690c ("crypto: arm/sha256 - move SHA-224/256 ASM/NEON implementation to base layer") > Signed-off-by: Arnd Bergmann > --- > v2: rewrite change as suggested by Herbert Xu. > --- > arch/arm/crypto/sha256_glue.c | 13 +++++-------- > arch/arm/crypto/sha512-glue.c | 12 +++++------- > 2 files changed, 10 insertions(+), 15 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt