Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3049808pxk; Mon, 7 Sep 2020 01:25:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDJ0OmV2N3oVaVHbVeV0c3EnwzwYU8E7sTaXAaO0SHbStFpyYg2uKJ58C3LmYM421N3F+u X-Received: by 2002:aa7:dcc1:: with SMTP id w1mr19798897edu.360.1599467109707; Mon, 07 Sep 2020 01:25:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599467109; cv=none; d=google.com; s=arc-20160816; b=QOQCpH7RG4GUU5WOqia2YOYUGq/pOoxA4zrPpLvvUN9BLB+UmWXHcLLnW4RwgF2+1v zVNj4mUk5x/mjt5HMlq7dQOOptEQHnyePaq7iGx+We4AWvYoq1U2b36qpe4/v+oHzF35 XJ5Vk4/oumboHDXDbMSyscQl/jFNDwmymNIen7ULX61n376dnOOjMQa5Z5fRdBXc0A+k vxGyYQDW2xGQXdCX/W8CSJ63kyP3R+DwSZUms/rjp2mLNJm921jgEObEi+Dom63qYFVW woMl7/nD1VmMDReQvKWKPvP3lPsFHBlVd/huMSkoiJprtqmHlIb5JOnn/vUzBJ0Weq7k TZXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=owcxV7nqfXae1YIsEh8Ah9Zyiu4IhxrN1eSHXXDEYns=; b=s5OfXTU5nOuxqyv8SkcnZYWNIcilwiShklKgODK4CNEnTVB58/5jQLeie57ZUMjxHR DtX173sVoSrQk+J+2rIt5sdj29EmGVT1zeDQyAY4mrHfRCUiDUqXOOHFrx3Zrlcn3lJe iuG533nzbKthaxL6L5aCeW7LB/JvjXtVinxgLChNyzxzcIkLe9pdUfvT8myph0j9IJjO VYRHBVQDNlSHEm11g8owy/wA8Mx3nXca6RcduB8cx4bkLcDUk9uPtDGHvcQjIl3/nH// 9Bg/ulxgebFWdMSpBS7+O9gIuW5rnJIH0OkeLMqAAL0hJQ371PP+A09+XCgwUv+vg+/1 0oYA== 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 m3si8974770ejk.485.2020.09.07.01.24.44; Mon, 07 Sep 2020 01:25:09 -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 S1727941AbgIGIYk (ORCPT + 99 others); Mon, 7 Sep 2020 04:24:40 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:10777 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727964AbgIGIYj (ORCPT ); Mon, 7 Sep 2020 04:24:39 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D26145277C38C64B3F19; Mon, 7 Sep 2020 16:24:34 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Sep 2020 16:24:25 +0800 From: Yang Shen To: , CC: , , , Subject: [PATCH v2 07/10] crypto: hisilicon/zip - fix static check warning Date: Mon, 7 Sep 2020 16:21:59 +0800 Message-ID: <1599466922-10323-8-git-send-email-shenyang39@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1599466922-10323-1-git-send-email-shenyang39@huawei.com> References: <1599466922-10323-1-git-send-email-shenyang39@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fix some code for PClint warning: Warning - Suspicious Cast Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip_crypto.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/hisilicon/zip/zip_crypto.c b/drivers/crypto/hisilicon/zip/zip_crypto.c index e58baeb..246a43e 100644 --- a/drivers/crypto/hisilicon/zip/zip_crypto.c +++ b/drivers/crypto/hisilicon/zip/zip_crypto.c @@ -16,7 +16,7 @@ #define GZIP_HEAD_FLG_SHIFT 3 #define GZIP_HEAD_FEXTRA_SHIFT 10 -#define GZIP_HEAD_FEXTRA_XLEN 2 +#define GZIP_HEAD_FEXTRA_XLEN 2UL #define GZIP_HEAD_FHCRC_SIZE 2 #define HZIP_GZIP_HEAD_BUF 256 @@ -51,13 +51,13 @@ enum { struct hisi_zip_req { struct acomp_req *req; - int sskip; - int dskip; + u32 sskip; + u32 dskip; struct hisi_acc_hw_sgl *hw_src; struct hisi_acc_hw_sgl *hw_dst; dma_addr_t dma_src; dma_addr_t dma_dst; - int req_id; + u16 req_id; }; struct hisi_zip_req_q { @@ -119,7 +119,7 @@ static void hisi_zip_config_tag(struct hisi_zip_sqe *sqe, u32 tag) static void hisi_zip_fill_sqe(struct hisi_zip_sqe *sqe, u8 req_type, dma_addr_t s_addr, dma_addr_t d_addr, u32 slen, - u32 dlen, int sskip, int dskip) + u32 dlen, u32 sskip, u32 dskip) { memset(sqe, 0, sizeof(struct hisi_zip_sqe)); @@ -573,7 +573,7 @@ static int hisi_zip_acompress(struct acomp_req *acomp_req) return head_size; } - req = hisi_zip_create_req(acomp_req, qp_ctx, (size_t)head_size, true); + req = hisi_zip_create_req(acomp_req, qp_ctx, head_size, true); if (IS_ERR(req)) return PTR_ERR(req); -- 2.7.4