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: 8911871 Return-Path: X-Original-To: patchwork-linux-media@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 6C39FBF29F for ; Fri, 22 Apr 2016 13:13:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98F9520254 for ; Fri, 22 Apr 2016 13:13:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B95E7201F2 for ; Fri, 22 Apr 2016 13:13:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753422AbcDVNMf (ORCPT ); Fri, 22 Apr 2016 09:12:35 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:24195 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752664AbcDVNMe (ORCPT ); Fri, 22 Apr 2016 09:12:34 -0400 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 cc: Hans Verkuil , daniel.thompson@linaro.org, Rob Herring , Mauro Carvalho Chehab , Matthias Brugger , Daniel Kurtz , Pawel Osciak , Eddie Huang , Yingjoe Chen , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, PoChun.Lin@mediatek.com, Andrew-CT Chen , kbuild-all@01.org 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 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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 */