From: Yang Shen <shenyang39@huawei.com>
To: <herbert@gondor.apana.org.au>, <davem@davemloft.net>
Cc: <linux-kernel@vger.kernel.org>, <linux-crypto@vger.kernel.org>,
<xuzaibo@huawei.com>, <wangzhou1@hisilicon.com>
Subject: [PATCH v2 07/10] crypto: hisilicon/zip - fix static check warning
Date: Mon, 7 Sep 2020 16:21:59 +0800 [thread overview]
Message-ID: <1599466922-10323-8-git-send-email-shenyang39@huawei.com> (raw)
In-Reply-To: <1599466922-10323-1-git-send-email-shenyang39@huawei.com>
Fix some code for PClint warning:
Warning - Suspicious Cast
Signed-off-by: Yang Shen <shenyang39@huawei.com>
Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com>
---
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
next prev parent reply other threads:[~2020-09-07 8:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-07 8:21 [PATCH v2 00/10] crypto: hisilicon/zip - misc clean up Yang Shen
2020-09-07 8:21 ` [PATCH v2 01/10] crypto: hisilicon/zip - remove some useless parameters Yang Shen
2020-09-07 8:21 ` [PATCH v2 02/10] crypto: hisilicon/zip - unify naming style for functions and macros Yang Shen
2020-09-07 8:21 ` [PATCH v2 03/10] crypto: hisilicon/zip - modify debugfs interface parameters Yang Shen
2020-09-07 8:21 ` [PATCH v2 04/10] crypto: hisilicon/zip - replace 'sprintf' with 'scnprintf' Yang Shen
2020-09-07 8:21 ` [PATCH v2 05/10] crypto: hisilicon/zip - use a enum parameter instead of some macros Yang Shen
2020-09-07 8:21 ` [PATCH v2 06/10] crypto: hisilicon/zip - add print for error branch Yang Shen
2020-09-07 8:21 ` Yang Shen [this message]
2020-09-07 8:22 ` [PATCH v2 08/10] crypto: hisilicon/zip - move some private macros from 'zip.h' to 'zip_crypto.c' Yang Shen
2020-09-07 8:22 ` [PATCH v2 09/10] crypto: hisilicon/zip - supplement some comments Yang Shen
2020-09-07 8:22 ` [PATCH v2 10/10] crypto: hisilicon/zip - fix some coding styles Yang Shen
2020-09-18 7:28 ` [PATCH v2 00/10] crypto: hisilicon/zip - misc clean up Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1599466922-10323-8-git-send-email-shenyang39@huawei.com \
--to=shenyang39@huawei.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wangzhou1@hisilicon.com \
--cc=xuzaibo@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®