Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp628392pxb; Thu, 12 Nov 2020 12:07:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjqMayQiKFBqntgbBCwVPG7Jw+1PTNcAiURzRWuwGxwoTi/z1xuYYp/7akJKB9bgqVytWM X-Received: by 2002:aa7:d84a:: with SMTP id f10mr1669918eds.163.1605211673470; Thu, 12 Nov 2020 12:07:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605211673; cv=none; d=google.com; s=arc-20160816; b=C3VdLhMGOdeVdyPcFhBCnmxwKA6zlopZEjiyEpSdJ8H7cx/gPUbRw1jv+cC8gPbjEy MB96o7mJ54d9KCWK/xlPXzDsSojWikVhCiHRGXH5FBe0p0Eoe/AJAXSzsr2reLRSxBBs 8sAJ9h8h0PBqX6X1ATNvI5lFw0ncwo3fTrs7AFVFwaqobEQSoj0bZa+1W4F02R8LbKNE 6bsHm7T9QjFsVTx1NOhG6v9eGIQnW133X8B6/ePeMLgt0p76cORPuZHU8V6TVnw1Bf+2 rdf8iNxLTSbue5cOQc8TkcT6FP2r8rDYSNzWAUHEHYdZfT4Cxn1FzTLFFOsssdiysYFE ZQHQ== 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:dkim-signature; bh=E6ppXCmiSFyh9upyqD1fFw+i5gNBFjv39zREmHQXKsI=; b=NBwN3RWPWkJJxY7epmHr+IvYRI98bRa2wVZ32mS0sNc3OEhtHXSmwYenpfkHus5N6U 0njgVeiJ1nOHpmDzkgL9TLORMTOTxyCBmVZZE985LBsMtiGClAsfUJoArBmbnnWSE1U+ bTF9REYo3jCD6q4jNLWHJotldBpof6CvX9cYvdGXyhZBltNJSAGZsBD8Dux72c7wXhAf Xi75Vhj45PSszOCsoJ9cIgkvjdjNZUoqZBWbKqzohQQjRI+bjwZOiJWrX50U7UL46OZZ GZbHGj8EQt4XywW0F9z3NN92tITXAYZwI7yiYhLHdlcTgvH+LQOVb5qBT8yAThVlHgyC ESFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=myhEdHA1; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m8si4859847edj.357.2020.11.12.12.07.18; Thu, 12 Nov 2020 12:07:53 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=myhEdHA1; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726868AbgKLUHP (ORCPT + 99 others); Thu, 12 Nov 2020 15:07:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbgKLUHP (ORCPT ); Thu, 12 Nov 2020 15:07:15 -0500 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BC0DC0613D1; Thu, 12 Nov 2020 12:07:13 -0800 (PST) Received: by mail-qt1-x841.google.com with SMTP id t5so5031567qtp.2; Thu, 12 Nov 2020 12:07:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=E6ppXCmiSFyh9upyqD1fFw+i5gNBFjv39zREmHQXKsI=; b=myhEdHA1B+Ej9tlUM2QY462pQS+lE1+d0F8YJn7uklWfzytdxoWcCAY7P0ddXLrRDi 088d1KYqblvd+TKWi/We+OXgH4RO15ateqbXuxp4CoAvzm3O+hPOUOZ7ImTo2JOmpbGi 8J9V5W+0hjdMa/khKXfNGf7ULDi7+Zda1GOng3kRHW41Qbdd4wsQ7CqSLBM0bjijzqN8 NINcJQ6a6UqrCowsKdOYlXdfLe03nnMuwJZWruePkHy76YQcsHc4Iv7k5ymP2Ezf0xix vCFRlGzW0Yj5bFx2udjeoppzzSLw5hZBr1AkWmvrrHcgzCJtu5ESuScfXAmTGRYn9See wh6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=E6ppXCmiSFyh9upyqD1fFw+i5gNBFjv39zREmHQXKsI=; b=Z9Dk8jG9J0XkRkFJUXYidVKgxjsJ+TTnof3DluRSoKoocNXxcpriGdyG5g4HSdg/vM bKHQGz2X2HynVSiSUjjoC3Tl1dZ7GdQE2cTk9Tj1Y8IW/1BZi4/++YdNbnCATExWM5v3 q4fmUDClZer7MZPHh4Emg5y2mnszviU1zxjqrRTfDPn3M+9GZEk8Qu5dkdosm1dOPdcT W+VoyFQFVxoMZwXEc0/abDHFFNdXylQQxcEDCThck4nTwjv2mnt41VscoZZa2A4RWeTy E/Y69xm4AAF2ocnZcie28p8srFfTKZPg40ri7wD0ND+la2RtGwpxW4FnyxUkQ4eG9OFi s6eQ== X-Gm-Message-State: AOAM531lphbQfG7uwHVjTzJd8+3kLow237+bioUIiVnB8kmp6pN4ibbe hWvFCCcSsBfSjHy4nyRw1N4mTyVFyQiCDg== X-Received: by 2002:ac8:75da:: with SMTP id z26mr933380qtq.36.1605211632407; Thu, 12 Nov 2020 12:07:12 -0800 (PST) Received: from localhost.localdomain ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id 207sm700295qki.91.2020.11.12.12.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2020 12:07:11 -0800 (PST) From: Nathan Chancellor To: Herbert Xu , "David S. Miller" Cc: Nick Desaulniers , Christian Lamparter , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH] crypto: crypto4xx - Replace bitwise OR with logical OR in crypto4xx_build_pd Date: Thu, 12 Nov 2020 13:07:02 -0700 Message-Id: <20201112200702.1664905-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Clang warns: drivers/crypto/amcc/crypto4xx_core.c:921:60: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses] (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ drivers/crypto/amcc/crypto4xx_core.c:921:60: note: place parentheses around the '|' expression to silence this warning (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ? ^ ) drivers/crypto/amcc/crypto4xx_core.c:921:60: note: place parentheses around the '?:' expression to evaluate it first (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ? ^ ( 1 warning generated. It looks like this should have been a logical OR so that PD_CTL_HASH_FINAL gets added to the w bitmask if crypto_tfm_alg_type is either CRYPTO_ALG_TYPE_AHASH or CRYPTO_ALG_TYPE_AEAD. Change the operator so that everything works properly. Fixes: 4b5b79998af6 ("crypto: crypto4xx - fix stalls under heavy load") Link: https://github.com/ClangBuiltLinux/linux/issues/1198 Signed-off-by: Nathan Chancellor --- drivers/crypto/amcc/crypto4xx_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index 981de43ea5e2..2e3690f65786 100644 --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c @@ -917,7 +917,7 @@ int crypto4xx_build_pd(struct crypto_async_request *req, } pd->pd_ctl.w = PD_CTL_HOST_READY | - ((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) | + ((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) || (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ? PD_CTL_HASH_FINAL : 0); pd->pd_ctl_len.w = 0x00400000 | (assoclen + datalen); base-commit: f8394f232b1eab649ce2df5c5f15b0e528c92091 -- 2.29.2