Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9124391pxu; Mon, 28 Dec 2020 07:13:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeAHWM9L9RaWrLe9/y3bYrwWYxX+ucu/iDknV/iDAhXSD2V/RzhOUOlvSzYjKWfYA5nPcE X-Received: by 2002:a17:906:c045:: with SMTP id bm5mr35743075ejb.190.1609168396087; Mon, 28 Dec 2020 07:13:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168396; cv=none; d=google.com; s=arc-20160816; b=UcOhLC0qdlF/FYzAaOWhJEqdBqwW4ZIhpS7xLO9I6k3AUZreVgzRI3ziU+fQrGiK1J lGhl/XAuDA+zWQeTr4VGU4BPfDPgdnPkOfRdIalq6EyqIP67IyaEpKp01U6tUxFzPFua DBU9spkzb4kyyCjrMB5FPst3OyESgLQNc4IJshZrkqLrNrWQhbiWu/vUxTuVB86yO7dA wKaFUctiGHYFxo/oEZVftF0sQ2984M1+SOm9aVwTqlAQHM4F9vxSuZeXqMcjMW1T55NI pNrkFaivAkNmeWCMHLgVQyWWBnXvXyA48BHpStoYyyLtD7RzG1WW3Mbsy2wtlsdEuuTt T1rw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BdOwXpdwy+ZCAgOssNbBGuqPBOAycH+EYml1C55IoHA=; b=PUwPvTKUrB5eVmdhb0sqPiYVIxNQhlYYWNa7ADsHWqPb9ljlXYVIg36ALlbUuhH3aR egzCWBcFUJ6bfTjNqmQfAWomPZGvvFL8mwtCnup/AVsZ3WBnFr4Rr+Slk8vzPpbBX/YZ 5r1CMd8DUU3ldBY7T5UoL0SCDCJb4LhR/fq7lSD8EOm+auFDITmgHi8I2td5qlZTSQnW DW1Ei0uHgLtiw/ZC3MUuEaVM8E5N5QzEEVKYefi5GWwgAg5HqKp3OFh1PJr1ehXBhYNl 47C8mdvxLxW3udZbsgl7RrILynfnPGc1mLVuKjD1iFycdoBsaedC4kpoZfnQ80t50qfK Z/Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bL1y8jni; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si18564170eja.53.2020.12.28.07.12.51; Mon, 28 Dec 2020 07:13:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=bL1y8jni; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438069AbgL1OH1 (ORCPT + 99 others); Mon, 28 Dec 2020 09:07:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:40542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438303AbgL1OHF (ORCPT ); Mon, 28 Dec 2020 09:07:05 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3711420731; Mon, 28 Dec 2020 14:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164409; bh=Av0ZvDdXrYRO7Vxeh2s11XeTZ2iC8pXcflEjAgmHgKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bL1y8jniVfFuXI6KZ8XsMXmfCEQBOxHljcm7u+tJHGp5uOfBdj79/MnjZS+iIJBa1 Yjo9OtFs//D0dG3vYzRZrEVHY3fV++eTMfvanL74w0qoUU7J0N3HQPsrEOkTrlhZzG vdAvn5bcKfsRdhXz/5CyqaCidm4nR0gU3KqzDhKo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Christian Lamparter , Herbert Xu , Sasha Levin Subject: [PATCH 5.10 170/717] crypto: crypto4xx - Replace bitwise OR with logical OR in crypto4xx_build_pd Date: Mon, 28 Dec 2020 13:42:48 +0100 Message-Id: <20201228125029.103657776@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit 5bdad829c31a09069fd508534f03c2ea1576ac75 ] 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 Reviewed-by: Christian Lamparter Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- 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 981de43ea5e24..2e3690f65786d 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); -- 2.27.0