From f52a42c2e1146292f6f5b2e28fedaf762839e3c6 Mon Sep 17 00:00:00 2001 From: lingmingqiang Date: Thu, 11 Jul 2019 14:41:46 +0800 Subject: [PATCH] ACC: fixup hpre devil digital used driver inclusion category: bugfix bugzilla: NA CVE: NA 1.Devil digital used 2.function arguments exceed 3.Macro usage irregular Signed-off-by: tanghui20 Reviewed-by: xuzaibo Signed-off-by: lingmingqiang Signed-off-by: Yang Yingliang --- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 6 +++--- drivers/crypto/hisilicon/hpre/hpre_main.c | 2 +- drivers/uacce/uacce.c | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c index 68a1d5e9567f..8285bc4f660e 100644 --- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c +++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c @@ -24,7 +24,7 @@ struct hpre_ctx; #define _CRT_INV 4 #define _DH_G_FLAG 0x02 #define HPRE_TRY_SEND_TIMES 100 -#define HPRE_INVLD_REQ_ID -1 +#define HPRE_INVLD_REQ_ID (-1) #define GET_DEV(ctx) ((ctx)->qp->qm->pdev->dev) #define BITS64_MERGE(low_32, high_32) (((u64)(low_32)) | \ @@ -198,7 +198,7 @@ static int _get_data_dma_addr(struct hpre_asym_request *hpre_req, static int _cp_data_to_dma_buf(struct hpre_asym_request *hpre_req, struct scatterlist *data, unsigned int len, - int is_src, int is_dh, dma_addr_t *tmp) + int is_src, dma_addr_t *tmp) { struct hpre_ctx *ctx = hpre_req->ctx; struct device *dev = &GET_DEV(ctx); @@ -241,7 +241,7 @@ static int _hw_data_init(struct hpre_asym_request *hpre_req, return ret; } else { ret = _cp_data_to_dma_buf(hpre_req, data, len, - is_src, is_dh, &tmp); + is_src, &tmp); if (ret) return ret; } diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/drivers/crypto/hisilicon/hpre/hpre_main.c index 8e01097afb40..e52afb20207d 100644 --- a/drivers/crypto/hisilicon/hpre/hpre_main.c +++ b/drivers/crypto/hisilicon/hpre/hpre_main.c @@ -242,7 +242,7 @@ static int uacce_mode_set(const char *val, const struct kernel_param *kp) return -EINVAL; ret = kstrtou32(val, _TO_DECIMAL, &n); - if (ret != 0 || n > 2) + if (ret != 0 || n > UACCE_MODE_NOIOMMU) return -EINVAL; return param_set_int(val, kp); diff --git a/drivers/uacce/uacce.c b/drivers/uacce/uacce.c index 9e61cfd64656..2344b2a2a9f2 100644 --- a/drivers/uacce/uacce.c +++ b/drivers/uacce/uacce.c @@ -42,6 +42,8 @@ static DEFINE_RWLOCK(uacce_qs_lock); #define uacce_qs_wunlock() write_unlock_irq(&uacce_qs_lock) #endif +#define UACCE_RESET_DELAY_MS 10 + static const struct file_operations uacce_fops; static int uacce_fops_fasync(int fd, struct file *file, int mode); static int uacce_put_queue(struct file *filep); @@ -95,7 +97,7 @@ void uacce_reset_prepare(struct uacce *uacce) mutex_unlock(&uacce->q_lock); /* make sure above single been handled */ - mdelay(10); + mdelay(UACCE_RESET_DELAY_MS); } EXPORT_SYMBOL_GPL(uacce_reset_prepare); -- GitLab