VPU: mediatek: fix simple_open.cocci warnings
Subsystems (2)
PATCH 1/1 VPU: mediatek: fix simple_open.cocci warnings
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
---
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(-)
drivers/media/platform/mtk-vpu/mtk_vpu.c +1 -6
@@ -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 */
Quoted 10 lines · Julia Lawall
Remove an open coded
simple_open()function and replace file operations references to the function withsimple_open()instead.Generated by:
scripts/coccinelle/api/simple_open.cocciCC Andrew-CT Chen <[email protected]>Signed-off-by Fengguang Wu <[email protected]>Signed-off-by Julia Lawall <[email protected]>---
Quoted 33 lines
I'm just passing this along.
Simple_openadditionally has a check thatinode->i_privateis not NULL, before doing the assignment. I don't know if that difference is important in this case.base:
git://linuxtv.org/media_tree.gitmastermtk_vpu.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)drivers/media/platform/mtk-vpu/mtk_vpu.c +1
-6@@ -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 */