All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uacce: fix some coding styles
@ 2020-09-14  2:29 Kai Ye
  2020-09-14  7:59 ` Jonathan Cameron
  0 siblings, 1 reply; 9+ messages in thread
From: Kai Ye @ 2020-09-14  2:29 UTC (permalink / raw)
  To: linux-accelerators, linux-kernel, linuxarm, zhangfei.gao; +Cc: Kai Ye

1. delete some redundant code.
2. modify the module author information.

Signed-off-by: Kai Ye <yekai13@huawei.com>
Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
---
Changes in V2:
	deleted extra NULL pointer check in uacce_fops.

 drivers/misc/uacce/uacce.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c
index 107028e..1d09707 100644
--- a/drivers/misc/uacce/uacce.c
+++ b/drivers/misc/uacce/uacce.c
@@ -239,17 +239,6 @@ static int uacce_fops_mmap(struct file *filep, struct vm_area_struct *vma)
 
 	switch (type) {
 	case UACCE_QFRT_MMIO:
-		if (!uacce->ops->mmap) {
-			ret = -EINVAL;
-			goto out_with_lock;
-		}
-
-		ret = uacce->ops->mmap(q, vma, qfr);
-		if (ret)
-			goto out_with_lock;
-
-		break;
-
 	case UACCE_QFRT_DUS:
 		if (!uacce->ops->mmap) {
 			ret = -EINVAL;
@@ -541,5 +530,5 @@ subsys_initcall(uacce_init);
 module_exit(uacce_exit);
 
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Hisilicon Tech. Co., Ltd.");
+MODULE_AUTHOR("HiSilicon Tech. Co., Ltd.");
 MODULE_DESCRIPTION("Accelerator interface for Userland applications");
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] uacce: fix some coding styles
@ 2020-07-30  6:13 Kai Ye
  2020-07-31  2:40 ` Zhou Wang
  2020-07-31  3:09 ` Zhangfei Gao
  0 siblings, 2 replies; 9+ messages in thread
From: Kai Ye @ 2020-07-30  6:13 UTC (permalink / raw)
  To: linux-accelerators, linux-kernel, linuxarm, zhangfei.gao; +Cc: Kai Ye

1. delete some redundant code.
2. modify the module author information.

Signed-off-by: Kai Ye <yekai13@huawei.com>
---
Changes in V2:
	deleted extra NULL pointer check in uacce_fops.

 drivers/misc/uacce/uacce.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c
index 107028e..1d09707 100644
--- a/drivers/misc/uacce/uacce.c
+++ b/drivers/misc/uacce/uacce.c
@@ -239,17 +239,6 @@ static int uacce_fops_mmap(struct file *filep, struct vm_area_struct *vma)
 
 	switch (type) {
 	case UACCE_QFRT_MMIO:
-		if (!uacce->ops->mmap) {
-			ret = -EINVAL;
-			goto out_with_lock;
-		}
-
-		ret = uacce->ops->mmap(q, vma, qfr);
-		if (ret)
-			goto out_with_lock;
-
-		break;
-
 	case UACCE_QFRT_DUS:
 		if (!uacce->ops->mmap) {
 			ret = -EINVAL;
@@ -541,5 +530,5 @@ subsys_initcall(uacce_init);
 module_exit(uacce_exit);
 
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Hisilicon Tech. Co., Ltd.");
+MODULE_AUTHOR("HiSilicon Tech. Co., Ltd.");
 MODULE_DESCRIPTION("Accelerator interface for Userland applications");
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] uacce: fix some coding styles
@ 2020-07-20  7:18 Kai Ye
  2020-07-21  6:57 ` Zhangfei Gao
  0 siblings, 1 reply; 9+ messages in thread
From: Kai Ye @ 2020-07-20  7:18 UTC (permalink / raw)
  To: linux-accelerators, linux-kernel, linuxarm, zhangfei.gao; +Cc: Kai Ye

1. add some parameter check.
2. delete some redundant code.
3. modify the module author information.

Signed-off-by: Kai Ye <yekai13@huawei.com>
Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com>
---
 drivers/misc/uacce/uacce.c | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c
index 107028e..2e1af58 100644
--- a/drivers/misc/uacce/uacce.c
+++ b/drivers/misc/uacce/uacce.c
@@ -63,8 +63,12 @@ static long uacce_fops_unl_ioctl(struct file *filep,
 				 unsigned int cmd, unsigned long arg)
 {
 	struct uacce_queue *q = filep->private_data;
-	struct uacce_device *uacce = q->uacce;
+	struct uacce_device *uacce;
+
+	if (WARN_ON(!q))
+		return -EINVAL;
 
+	uacce = q->uacce;
 	switch (cmd) {
 	case UACCE_CMD_START_Q:
 		return uacce_start_queue(q);
@@ -206,11 +210,16 @@ static const struct vm_operations_struct uacce_vm_ops = {
 static int uacce_fops_mmap(struct file *filep, struct vm_area_struct *vma)
 {
 	struct uacce_queue *q = filep->private_data;
-	struct uacce_device *uacce = q->uacce;
-	struct uacce_qfile_region *qfr;
 	enum uacce_qfrt type = UACCE_MAX_REGION;
+	struct uacce_qfile_region *qfr;
+	struct uacce_device *uacce;
 	int ret = 0;
 
+	if (WARN_ON(!q))
+		return -EINVAL;
+
+	uacce = q->uacce;
+
 	if (vma->vm_pgoff < UACCE_MAX_REGION)
 		type = vma->vm_pgoff;
 	else
@@ -239,17 +248,6 @@ static int uacce_fops_mmap(struct file *filep, struct vm_area_struct *vma)
 
 	switch (type) {
 	case UACCE_QFRT_MMIO:
-		if (!uacce->ops->mmap) {
-			ret = -EINVAL;
-			goto out_with_lock;
-		}
-
-		ret = uacce->ops->mmap(q, vma, qfr);
-		if (ret)
-			goto out_with_lock;
-
-		break;
-
 	case UACCE_QFRT_DUS:
 		if (!uacce->ops->mmap) {
 			ret = -EINVAL;
@@ -541,5 +539,5 @@ subsys_initcall(uacce_init);
 module_exit(uacce_exit);
 
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Hisilicon Tech. Co., Ltd.");
+MODULE_AUTHOR("HiSilicon Tech. Co., Ltd.");
 MODULE_DESCRIPTION("Accelerator interface for Userland applications");
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-09-14  8:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14  2:29 [PATCH] uacce: fix some coding styles Kai Ye
2020-09-14  7:59 ` Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2020-07-30  6:13 Kai Ye
2020-07-31  2:40 ` Zhou Wang
2020-07-31  3:09 ` Zhangfei Gao
2020-09-11  7:37   ` yekai(A)
2020-09-11  7:41     ` Greg KH
2020-07-20  7:18 Kai Ye
2020-07-21  6:57 ` Zhangfei Gao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.