From nobody Mon Jun 8 05:24:59 2026 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (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 1F0A737187F for ; Tue, 2 Jun 2026 22:26:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780439176; cv=none; b=O6tzahvYAHP7cifEOdSf8FbsQ6p8saDRGVf/T9QHfWZU7vvqwItIcNa0+GK0kW07iBWVKVbR4uxGaEXb+XlntILHPaiSUqNLorv4upwRqQ2RE/np8x6WbWMXCQp3ZGbtXJ0JTC0Mk6cTn9fcLjMlMsEp2P0KZYXsVD89QQlo68o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780439176; c=relaxed/simple; bh=GHxDkgIiIX6c6vtHT0FV/dwHUgNRsmaaQ7EjOBafrV8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mPkQBHMHwWYPHJ87ge+oHg63o/3KMxejVck30Dkao/+s5KDdmTEEWZ2Lk4SmDmGPmL5ofV2gqPtweFFCvMnwX7IqpvpSHg24IlBDBB8hSyRvsuImOXfdRn07ZmmsweVEmXR9OXdCxfL7Yj3CzCAVOamkMpDuhUCuTdFsHRCzyIU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=OgtWM0zv; arc=none smtp.client-ip=91.218.175.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="OgtWM0zv" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1780439173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sFhdpRv9iR7Qc8J7Cw//4CHayJHFtnc2pfvbLSWkvUY=; b=OgtWM0zvkiDPhp8fyZHlDO02xUt8hzA9wHXqs+QH5bqDQ7zRmljlsuoRQ9N8STnpgf1B76 Z9twu5MNXJBxF9EVzqWJed6G4561e3IPelvLpKakvVxLAcDIpCyBIUuVSpTKOBICZXpaKk kCx2UidvHC79lpsQdDXqp4t79UPeTfk= From: Thorsten Blum To: Thorsten Blum , Herbert Xu , "David S. Miller" , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: atmel-ecc - drop dead code in atmel_ecdh_max_size Date: Wed, 3 Jun 2026 00:25:19 +0200 Message-ID: <20260602222517.1071850-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1037; i=thorsten.blum@linux.dev; h=from:subject; bh=GHxDkgIiIX6c6vtHT0FV/dwHUgNRsmaaQ7EjOBafrV8=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFnyEb6Teu69zq+5KL7i9fmNljwS5kZ9jHMuv66bFrH8z 9fll05t7ihlYRDjYpAVU2R5MOvHDN/SmspNJhE7YeawMoEMYeDiFICJXHrE8N8vKvr4osBQuzwL 2zaR9nNZ758LcbC+fnRSNSitI57L24/hf1GN4HNv8dT1Nwt11yXus7lj6RPk6/hkGksr12SzDgY LNgA= X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" atmel_ecdh_init_tfm() always allocates ctx->fallback, so it is never NULL in atmel_ecdh_max_size(). Remove the dead code and return crypto_kpp_maxsize() directly. Signed-off-by: Thorsten Blum --- drivers/crypto/atmel-ecc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/crypto/atmel-ecc.c b/drivers/crypto/atmel-ecc.c index 9c380351d2f9..6a1716175b30 100644 --- a/drivers/crypto/atmel-ecc.c +++ b/drivers/crypto/atmel-ecc.c @@ -284,15 +284,7 @@ static unsigned int atmel_ecdh_max_size(struct crypto_= kpp *tfm) { struct atmel_ecdh_ctx *ctx =3D kpp_tfm_ctx(tfm); =20 - if (ctx->fallback) - return crypto_kpp_maxsize(ctx->fallback); - - /* - * The device only supports NIST P256 ECC keys. The public key size will - * always be the same. Use a macro for the key size to avoid unnecessary - * computations. - */ - return ATMEL_ECC_PUBKEY_SIZE; + return crypto_kpp_maxsize(ctx->fallback); } =20 static struct kpp_alg atmel_ecdh_nist_p256 =3D {