提交 33cef3a3 编写于 作者: M Mingqiang Ling 提交者: Xie XiuQi

arm64: CI Code scanning warning clean

driver inclusion
category: bugfix
bugzilla: 13683
CVE: NA

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

CI Code scanning warning clean

Feature or Bugfix:Bugfix
Signed-off-by: Nxuzaibo <xuzaibo@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>
上级 ac6bd719
......@@ -579,7 +579,7 @@ static void _rsa_cb(struct hpre_ctx *ctx, void *resp)
akcipher_request_complete(areq, ret);
}
static unsigned long hpre_rsa_key_size_check(unsigned int len)
static int hpre_rsa_key_size_check(unsigned int len)
{
unsigned int bitslen = len << HPRE_BITS_2_BYTES_SHIFT;
......@@ -599,7 +599,7 @@ static unsigned long hpre_rsa_key_size_check(unsigned int len)
return 0;
default:
return -1;
};
}
}
static int hpre_rsa_enc(struct akcipher_request *req)
......
......@@ -566,7 +566,7 @@ static int hpre_create_debugfs_file(struct hpre_ctrl *ctrl, struct dentry *dir,
else
file_dir = ctrl->debug_root;
if (type > HPRE_DEBUG_FILE_NUM)
if (type >= HPRE_DEBUG_FILE_NUM)
return -EINVAL;
spin_lock_init(&ctrl->files[indx].lock);
......
......@@ -277,7 +277,7 @@ uacce_queue_mmap_qfr(struct uacce_queue *q,
page_ref_count(qfr->pages[0]));
for (i = 0; i < qfr->nr_pages; i++) {
get_page(qfr->pages[i]);
ret = remap_pfn_range(vma, vma->vm_start + (i << PAGE_SHIFT),
ret = remap_pfn_range(vma, vma->vm_start + i * PAGE_SIZE,
page_to_pfn(qfr->pages[i]), PAGE_SIZE,
vma->vm_page_prot);
if (ret)
......@@ -294,8 +294,7 @@ uacce_queue_mmap_qfr(struct uacce_queue *q,
static struct uacce_qfile_region *uacce_create_region(struct uacce_queue *q,
struct vm_area_struct *vma,
enum uacce_qfrt type,
int flags)
enum uacce_qfrt type, u32 flags)
{
struct uacce_qfile_region *qfr;
struct uacce *uacce = q->uacce;
......@@ -491,7 +490,7 @@ static int uacce_start_queue(struct uacce_queue *q)
err_with_vmap:
for (j = i; j >= 0; j--) {
qfr = q->qfrs[i];
qfr = q->qfrs[j];
if (qfr && qfr->kaddr) {
vunmap(qfr->kaddr);
qfr->kaddr = NULL;
......@@ -801,7 +800,8 @@ static int uacce_fops_mmap(struct file *filep, struct vm_area_struct *vma)
struct uacce *uacce = q->uacce;
enum uacce_qfrt type;
struct uacce_qfile_region *qfr;
int flags = 0, ret;
unsigned int flags = 0;
int ret;
type = uacce_get_region_type(uacce, vma);
if (type == UACCE_QFRT_INVALID)
......
......@@ -23,8 +23,8 @@ struct uacce_qfile_region {
unsigned long iova; /* iova share between user and device space */
struct page **pages;
unsigned int nr_pages;
unsigned long prot;
int flags;
int prot;
unsigned int flags;
struct list_head qs; /* qs sharing the same region, for ss */
void *kaddr; /* kernel addr, for dko */
dma_addr_t dma; /* dma address, if created by dma api */
......@@ -87,7 +87,7 @@ struct uacce {
const char *drv_name;
const char *algs;
const char *api_ver;
int flags;
unsigned int flags;
unsigned long qf_pg_start[UACCE_QFRT_MAX];
int status;
struct uacce_ops *ops;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册