Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1385158 > unrolled thread

[PATCH] VPU: mediatek: fix simple_open.cocci warnings

Started byJulia Lawall <julia.lawall@lip6.fr>
First post2016-04-22 15:20 +0200
Last post2016-04-25 14:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] VPU: mediatek: fix simple_open.cocci warnings Julia Lawall <julia.lawall@lip6.fr> - 2016-04-22 15:20 +0200
    Re: [PATCH] VPU: mediatek: fix simple_open.cocci warnings andrew-ct chen <andrew-ct.chen@mediatek.com> - 2016-04-25 14:50 +0200

#1385158 — [PATCH] VPU: mediatek: fix simple_open.cocci warnings

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-04-22 15:20 +0200
Subject[PATCH] VPU: mediatek: fix simple_open.cocci warnings
Message-ID<rqJa2-2uZ-15@gated-at.bofh.it>
Remove an open coded simple_open() function
and replace file operations references to the function
with simple_open() instead.

Generated by: scripts/coccinelle/api/simple_open.cocci

CC: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

I'm just passing this along.  Simple_open additionally has a check that
inode->i_private is not NULL, before doing the assignment.  I don't know
if that difference is important in this case.

base:   git://linuxtv.org/media_tree.git master

 mtk_vpu.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

--- a/drivers/media/platform/mtk-vpu/mtk_vpu.c
+++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c
@@ -599,11 +599,6 @@ static void vpu_init_ipi_handler(void *d
 }

 #ifdef CONFIG_DEBUG_FS
-static int vpu_debug_open(struct inode *inode, struct file *file)
-{
-	file->private_data = inode->i_private;
-	return 0;
-}

 static ssize_t vpu_debug_read(struct file *file, char __user *user_buf,
 			      size_t count, loff_t *ppos)
@@ -646,7 +641,7 @@ static ssize_t vpu_debug_read(struct fil
 }

 static const struct file_operations vpu_debug_fops = {
-	.open = vpu_debug_open,
+	.open = simple_open,
 	.read = vpu_debug_read,
 };
 #endif /* CONFIG_DEBUG_FS */

[toc] | [next] | [standalone]


#1386382

Fromandrew-ct chen <andrew-ct.chen@mediatek.com>
Date2016-04-25 14:50 +0200
Message-ID<rrO7E-5ZS-19@gated-at.bofh.it>
In reply to#1385158
On Fri, 2016-04-22 at 15:12 +0200, Julia Lawall wrote:
> Remove an open coded simple_open() function
> and replace file operations references to the function
> with simple_open() instead.
> 
> Generated by: scripts/coccinelle/api/simple_open.cocci
> 
> CC: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> ---

Acked-by: Andrew-CT Chen <andrew-ct.chen@mediatek.com>

> 
> I'm just passing this along.  Simple_open additionally has a check that
> inode->i_private is not NULL, before doing the assignment.  I don't know
> if that difference is important in this case.
> 
> base:   git://linuxtv.org/media_tree.git master
> 
>  mtk_vpu.c |    7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> --- a/drivers/media/platform/mtk-vpu/mtk_vpu.c
> +++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c
> @@ -599,11 +599,6 @@ static void vpu_init_ipi_handler(void *d
>  }
> 
>  #ifdef CONFIG_DEBUG_FS
> -static int vpu_debug_open(struct inode *inode, struct file *file)
> -{
> -	file->private_data = inode->i_private;
> -	return 0;
> -}
> 
>  static ssize_t vpu_debug_read(struct file *file, char __user *user_buf,
>  			      size_t count, loff_t *ppos)
> @@ -646,7 +641,7 @@ static ssize_t vpu_debug_read(struct fil
>  }
> 
>  static const struct file_operations vpu_debug_fops = {
> -	.open = vpu_debug_open,
> +	.open = simple_open,
>  	.read = vpu_debug_read,
>  };
>  #endif /* CONFIG_DEBUG_FS */

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web