Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1422714ybz; Wed, 29 Apr 2020 22:12:40 -0700 (PDT) X-Google-Smtp-Source: APiQypKDLgKKi7OYLLc9rX8mpfnRxstJUgj3jNv/OcO7ffuF3cwoPmsMLJ1q2vqPNnxyMVh/Pytp X-Received: by 2002:a17:907:2107:: with SMTP id qn7mr1103654ejb.316.1588223560588; Wed, 29 Apr 2020 22:12:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588223560; cv=none; d=google.com; s=arc-20160816; b=I10YNNJg3u1ElbswiD8Xi6RFf2SjB1Q4ecaRx6bpC/IgOegAtJs6b4mOJnN1XtkJiZ e/1NRkfuu4OpOnuQii79npHYIqFqE6/xL/1boNtPNRomdR+Z5zg/e+ORHK1J0MmoL7b/ 4eiUYQov0MX5JcDiWNwtoAo4xMSj1fIXUlFYwCICuBI0N5PtCEgMk+kQoo0RO5e0jc+r 9Fg484sjhd9TG/OUk2ljlXUZb3m4f4nqv1EUjgfxr6Q3rtCsWoia2ZaVP+94Yjziq62q qeqtVSiPZbMZTOG7ZyInde+hl8zogfntgwUtOxUEgBwlouk6slq2ngvwbdU1DsHL9KF+ +BXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=bKeb6FmDjkiGEWDPzeRmeChBRfkyDvUBSI1e8t0UGNA=; b=brfanqjDqJb45kNBs147IptacBl/lpqxZVfXMaRZcuJjXZlFr1Gi6mtaLCmG2s75DU PvFflcLJMaeSGxPqimYEb9Wma0+vzECvHUnYVHlsJclTsHqPCX5Co/CrVeQN8st81N0t aT6TFlG7fxAbwFuYJrxvPeAaYwMSgE/NGVwD6ORrKAZYYRrRObT1bkU3mj85+UGZ+wLH 0fzzbj12PkxdKbfOuhWMwbDIDc1jZBUXESZ/16ma0hDJjF/8rYDDAFlYkGDMyD3I4SML 7feAcmTX7B+UOTeuCzv1QQy2LDnW5Fx2rh62JOAM4wSyyfC5LnWrFWZMPWKVyfdUrG6l BFyA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si2065617ejd.88.2020.04.29.22.12.06; Wed, 29 Apr 2020 22:12:40 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726180AbgD3FLB (ORCPT + 99 others); Thu, 30 Apr 2020 01:11:01 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3346 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726040AbgD3FLB (ORCPT ); Thu, 30 Apr 2020 01:11:01 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id AA2E48E90DCB2FABEFC0; Thu, 30 Apr 2020 13:10:59 +0800 (CST) Received: from SWX921481.china.huawei.com (10.126.201.159) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Thu, 30 Apr 2020 13:10:50 +0800 From: Barry Song To: , CC: , , Barry Song Subject: [PATCH v2] crypto: acomp - search acomp with scomp backend in crypto_has_acomp Date: Thu, 30 Apr 2020 17:10:18 +1200 Message-ID: <20200430051018.24220-1-song.bao.hua@hisilicon.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.126.201.159] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org users may call crypto_has_acomp to confirm the existence of acomp before using crypto_acomp APIs. Right now, many acomp have scomp backend, for example, lz4, lzo, deflate etc. crypto_has_acomp will return false for them even though they support acomp APIs. Signed-off-by: Barry Song --- -v2: fixed the mask according to herbert's feedback include/crypto/acompress.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/crypto/acompress.h b/include/crypto/acompress.h index d873f999b334..2b4d2b06ccbd 100644 --- a/include/crypto/acompress.h +++ b/include/crypto/acompress.h @@ -157,7 +157,7 @@ static inline int crypto_has_acomp(const char *alg_name, u32 type, u32 mask) { type &= ~CRYPTO_ALG_TYPE_MASK; type |= CRYPTO_ALG_TYPE_ACOMPRESS; - mask |= CRYPTO_ALG_TYPE_MASK; + mask |= CRYPTO_ALG_TYPE_ACOMPRESS_MASK; return crypto_has_alg(alg_name, type, mask); } -- 2.23.0