提交 6efb9233 编写于 作者: M Mingqiang Ling 提交者: Xie XiuQi

arm64: HPRE CI warning clean and bugfix

driver inclusion
category: bugfix
bugzilla: 13683
CVE: NA

-------------------------------------------------

CI warning clean and some real bugs were fixed

Feature or Bugfix:Bugfix
Signed-off-by: Nxuzaibo <xuzaibo@huawei.com>
Reviewed-by: Nfanghao <fanghao11@huawei.com>
Reviewed-by: Nwangzhou <wangzhou1@hisilicon.com>
Signed-off-by: NMingqiang Ling <lingmingqiang@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 6d9cf6f4
...@@ -372,6 +372,7 @@ static int hpre_msg_comm_set(struct hpre_ctx *ctx, void *req, int is_rsa) ...@@ -372,6 +372,7 @@ static int hpre_msg_comm_set(struct hpre_ctx *ctx, void *req, int is_rsa)
struct kpp_request *kreq = req; struct kpp_request *kreq = req;
struct akcipher_request *akreq = req; struct akcipher_request *akreq = req;
int req_id; int req_id;
void *tmp;
if (!req || !ctx) if (!req || !ctx)
return -EINVAL; return -EINVAL;
...@@ -380,7 +381,8 @@ static int hpre_msg_comm_set(struct hpre_ctx *ctx, void *req, int is_rsa) ...@@ -380,7 +381,8 @@ static int hpre_msg_comm_set(struct hpre_ctx *ctx, void *req, int is_rsa)
akreq->dst_len = ctx->key_sz; akreq->dst_len = ctx->key_sz;
return -EOVERFLOW; return -EOVERFLOW;
} }
h_req = PTR_ALIGN(akcipher_request_ctx(akreq), HPRE_ALIGN_SZ); tmp = akcipher_request_ctx(akreq);
h_req = PTR_ALIGN(tmp, HPRE_ALIGN_SZ);
h_req->cb = _rsa_cb; h_req->cb = _rsa_cb;
h_req->areq.rsa = akreq; h_req->areq.rsa = akreq;
msg = &h_req->req; msg = &h_req->req;
...@@ -390,7 +392,8 @@ static int hpre_msg_comm_set(struct hpre_ctx *ctx, void *req, int is_rsa) ...@@ -390,7 +392,8 @@ static int hpre_msg_comm_set(struct hpre_ctx *ctx, void *req, int is_rsa)
kreq->dst_len = ctx->key_sz; kreq->dst_len = ctx->key_sz;
return -EOVERFLOW; return -EOVERFLOW;
} }
h_req = PTR_ALIGN(kpp_request_ctx(kreq), HPRE_ALIGN_SZ); tmp = kpp_request_ctx(kreq);
h_req = PTR_ALIGN(tmp, HPRE_ALIGN_SZ);
h_req->cb = _dh_cb; h_req->cb = _dh_cb;
h_req->areq.dh = kreq; h_req->areq.dh = kreq;
msg = &h_req->req; msg = &h_req->req;
...@@ -413,8 +416,8 @@ static int hpre_dh_compute_value(struct kpp_request *req) ...@@ -413,8 +416,8 @@ static int hpre_dh_compute_value(struct kpp_request *req)
{ {
struct crypto_kpp *tfm = crypto_kpp_reqtfm(req); struct crypto_kpp *tfm = crypto_kpp_reqtfm(req);
struct hpre_ctx *ctx = kpp_tfm_ctx(tfm); struct hpre_ctx *ctx = kpp_tfm_ctx(tfm);
struct hpre_asym_request *hpre_req = void *tmp = kpp_request_ctx(req);
PTR_ALIGN(kpp_request_ctx(req), HPRE_ALIGN_SZ); struct hpre_asym_request *hpre_req = PTR_ALIGN(tmp, HPRE_ALIGN_SZ);
struct hpre_sqe *msg = &hpre_req->req; struct hpre_sqe *msg = &hpre_req->req;
int ret; int ret;
int ctr = 0; int ctr = 0;
...@@ -606,8 +609,8 @@ static int hpre_rsa_enc(struct akcipher_request *req) ...@@ -606,8 +609,8 @@ static int hpre_rsa_enc(struct akcipher_request *req)
{ {
struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
struct hpre_ctx *ctx = akcipher_tfm_ctx(tfm); struct hpre_ctx *ctx = akcipher_tfm_ctx(tfm);
struct hpre_asym_request *hpre_req = void *tmp = akcipher_request_ctx(req);
PTR_ALIGN(akcipher_request_ctx(req), HPRE_ALIGN_SZ); struct hpre_asym_request *hpre_req = PTR_ALIGN(tmp, HPRE_ALIGN_SZ);
struct hpre_sqe *msg = &hpre_req->req; struct hpre_sqe *msg = &hpre_req->req;
int ret; int ret;
int ctr = 0; int ctr = 0;
...@@ -649,8 +652,8 @@ static int hpre_rsa_dec(struct akcipher_request *req) ...@@ -649,8 +652,8 @@ static int hpre_rsa_dec(struct akcipher_request *req)
{ {
struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req);
struct hpre_ctx *ctx = akcipher_tfm_ctx(tfm); struct hpre_ctx *ctx = akcipher_tfm_ctx(tfm);
struct hpre_asym_request *hpre_req = void *tmp = akcipher_request_ctx(req);
PTR_ALIGN(akcipher_request_ctx(req), HPRE_ALIGN_SZ); struct hpre_asym_request *hpre_req = PTR_ALIGN(tmp, HPRE_ALIGN_SZ);
struct hpre_sqe *msg = &hpre_req->req; struct hpre_sqe *msg = &hpre_req->req;
int ret; int ret;
int ctr = 0; int ctr = 0;
......
...@@ -331,8 +331,8 @@ static struct uacce_qfile_region *uacce_create_region(struct uacce_queue *q, ...@@ -331,8 +331,8 @@ static struct uacce_qfile_region *uacce_create_region(struct uacce_queue *q,
qfr->nr_pages << PAGE_SHIFT, qfr->nr_pages << PAGE_SHIFT,
&qfr->dma, GFP_KERNEL); &qfr->dma, GFP_KERNEL);
if (!qfr->kaddr) { if (!qfr->kaddr) {
goto err_with_qfr;
ret = -ENOMEM; ret = -ENOMEM;
goto err_with_qfr;
} }
} else { } else {
dev_dbg(uacce->pdev, "allocate %d pages\n", qfr->nr_pages); dev_dbg(uacce->pdev, "allocate %d pages\n", qfr->nr_pages);
...@@ -996,7 +996,7 @@ uacce_dev_show_algorithms(struct device *dev, ...@@ -996,7 +996,7 @@ uacce_dev_show_algorithms(struct device *dev,
{ {
struct uacce *uacce = UACCE_FROM_CDEV_ATTR(dev); struct uacce *uacce = UACCE_FROM_CDEV_ATTR(dev);
return sprintf(buf, uacce->algs); return sprintf(buf, "%s", uacce->algs);
} }
static DEVICE_ATTR(algorithms, S_IRUGO, uacce_dev_show_algorithms, NULL); static DEVICE_ATTR(algorithms, S_IRUGO, uacce_dev_show_algorithms, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册