From patchwork Thu Dec 3 22:25:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 336947 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp671760ilb; Thu, 3 Dec 2020 14:28:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwD7FPtKwvZGVtbXrEpAbJcZqhQFAcR8v2jbhRXTc/X0xaJJi4SXibtWlb6+qqxi0/MInpA X-Received: by 2002:a17:906:70d7:: with SMTP id g23mr4584624ejk.443.1607034486346; Thu, 03 Dec 2020 14:28:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607034486; cv=none; d=google.com; s=arc-20160816; b=VC3k560itoM79vxhb9huU71jdwfbXInqmuqG4rVxjKh96wBDR35807xGsBPuPh+6Y7 JWLjw9gdNymRqiDJQrTRQ/PMJp6Fdleo+MbhEeM/AJatizULX79SmjyruvhLVmkDfiws aTlFHn1r6fpeZqIsdHcF7lVlvc1xmMYm73oG+ZsLaHkf+L09o977vlLtoEEf/LOUFzVu JkCfq700ymgvGbYc214/klAe0IDVWb4rCBsTf4gCY9xifzWCUY2VHPHDKTVDodaD/CFv cHqfSeoRBMp9P7lI+G/6CUpvLMggl1WcJkEwhBhhHvAQUTN1Y1a+tml/nmsEvK6/bbr1 NT4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=AHhc/5io2QDxdLOZ9gS9AfXOoOfEvzY38ld9afnKqoY=; b=T7G/eVEcvFoDokYNcV+lU7D4ebkF38zfTZXaG215h4CBCVST4y1SCNdaMc9YOo4Un1 z2HTrzdVYSLflwVnhRKDsJNi4FV3ivoWynHVb2E8bhrP8XkJVqGSNqm0ceqkPnA3FEeW O2rgzkRdBw07shM53pRt4lj6aFm0T3pi1PpTSCnX2M6TIUjW6SRkX5lwUogYW1TFR9rK N4IWP5YkzI95VY+LaTqXH3QzXEP+eqQ7PbslX8dadlwGAYUPPVUDIuMMlnXqUj9ALUyh t0dSVZWrWHHXIHEl2IW7bLW2EBsN7NBwetJzd8ELB81Lc39n6VZTprPRZ8AlNw0HY94U TSug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si1741540edt.394.2020.12.03.14.28.06; Thu, 03 Dec 2020 14:28:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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 S2387396AbgLCW0n (ORCPT + 2 others); Thu, 3 Dec 2020 17:26:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:53232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728020AbgLCW0n (ORCPT ); Thu, 3 Dec 2020 17:26:43 -0500 From: Arnd Bergmann Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Herbert Xu , "David S. Miller" , Ondrej Mosnacek , Ard Biesheuvel Cc: Arnd Bergmann , Eric Biggers , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: aegis128 - fix link error without SIMD Date: Thu, 3 Dec 2020 23:25:49 +0100 Message-Id: <20201203222557.952393-1-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Arnd Bergmann When the SIMD portion of the driver is disabled, the compiler cannot figure out in advance if it will be called: ERROR: modpost: "crypto_aegis128_update_simd" [crypto/aegis128.ko] undefined! Add a conditional to let the compiler use dead code elimination as before. Fixes: ac50aec41a9f ("crypto: aegis128 - expose SIMD code path as separate driver") Signed-off-by: Arnd Bergmann --- crypto/aegis128-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.27.0 diff --git a/crypto/aegis128-core.c b/crypto/aegis128-core.c index 2b05f79475d3..89dc1c559689 100644 --- a/crypto/aegis128-core.c +++ b/crypto/aegis128-core.c @@ -89,7 +89,7 @@ static void crypto_aegis128_update_a(struct aegis_state *state, const union aegis_block *msg, bool do_simd) { - if (do_simd) { + if (IS_ENABLED(CONFIG_CRYPTO_AEGIS128_SIMD) && do_simd) { crypto_aegis128_update_simd(state, msg); return; } @@ -101,7 +101,7 @@ static void crypto_aegis128_update_a(struct aegis_state *state, static void crypto_aegis128_update_u(struct aegis_state *state, const void *msg, bool do_simd) { - if (do_simd) { + if (IS_ENABLED(CONFIG_CRYPTO_AEGIS128_SIMD) && do_simd) { crypto_aegis128_update_simd(state, msg); return; }