public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] VPU: mediatek: fix simple_open.cocci warnings
@ 2016-04-22 13:12 Julia Lawall
  2016-04-25 12:42 ` andrew-ct chen
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2016-04-22 13:12 UTC (permalink / raw)
  To: Tiffany Lin
  Cc: Hans Verkuil, daniel.thompson-QSEj5FYQhm4dnm+yROfE0A, Rob Herring,
	Mauro Carvalho Chehab, Matthias Brugger, Daniel Kurtz,
	Pawel Osciak, Eddie Huang, Yingjoe Chen,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-media-u79uwXL29TY76Z2rM5mHXA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	PoChun.Lin-NuS5LvNUpcJWk0Htik3J/w, Andrew-CT Chen,
	kbuild-all-JC7UmRfGjtg

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-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Signed-off-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org>
---

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 */
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-04-25 12:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-22 13:12 [PATCH] VPU: mediatek: fix simple_open.cocci warnings Julia Lawall
2016-04-25 12:42 ` andrew-ct chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox