From patchwork Fri Apr 22 13:12:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 8911891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 06B02BF29F for ; Fri, 22 Apr 2016 13:14:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F63520120 for ; Fri, 22 Apr 2016 13:14:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FF6B20121 for ; Fri, 22 Apr 2016 13:14:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1atatH-0008FV-NO; Fri, 22 Apr 2016 13:12:59 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1atatD-0007vK-2e; Fri, 22 Apr 2016 13:12:56 +0000 X-IronPort-AV: E=Sophos;i="5.24,517,1454972400"; d="scan'208";a="175443399" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Apr 2016 15:12:30 +0200 Date: Fri, 22 Apr 2016 15:12:19 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Tiffany Lin Subject: [PATCH] VPU: mediatek: fix simple_open.cocci warnings Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160422_061255_553363_A2920A92 X-CRM114-Status: GOOD ( 12.60 ) X-Spam-Score: -6.1 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, daniel.thompson@linaro.org, Mauro Carvalho Chehab , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Daniel Kurtz , kbuild-all@01.org, PoChun.Lin@mediatek.com, Rob Herring , Hans Verkuil , linux-arm-kernel@lists.infradead.org, Andrew-CT Chen , Matthias Brugger , Yingjoe Chen , Eddie Huang , Pawel Osciak , linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall Acked-by: Andrew-CT Chen --- 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 */