From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965168Ab2CMKYN (ORCPT ); Tue, 13 Mar 2012 06:24:13 -0400 Received: from mx3.mail.elte.hu ([157.181.1.138]:48945 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965103Ab2CMKYM (ORCPT ); Tue, 13 Mar 2012 06:24:12 -0400 Date: Tue, 13 Mar 2012 11:23:58 +0100 From: Ingo Molnar To: Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Greg Kroah-Hartman , Al Viro , Julia Lawall , Andrew Morton Subject: Re: [PATCHv2 3/3] simple_open: Automatically convert to simple_open() Message-ID: <20120313102358.GB1516@elte.hu> References: <1331631988-20527-1-git-send-email-sboyd@codeaurora.org> <1331631988-20527-4-git-send-email-sboyd@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1331631988-20527-4-git-send-email-sboyd@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=AWL,BAYES_00 autolearn=no SpamAssassin version=3.3.1 -2.0 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 AWL AWL: From: address is in the auto white-list Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Stephen Boyd wrote: > Many users of debugfs copy the implementation of default_open() > when they want to support a custom read/write function op. This > leads to a proliferation of the default_open() implementation > across the entire tree. Now that the common implementation has > been consolidated into libfs we can replace all the users of this > function with simple_open(). > > This replacement was done with the following semantic patch: > > > @ open @ > identifier open_f != simple_open; > identifier i, f; > @@ > -int open_f(struct inode *i, struct file *f) > -{ > ( > -if (i->i_private) > -f->private_data = i->i_private; > | > -f->private_data = i->i_private; > ) > -return 0; > -} > > @ has_open depends on open @ > identifier fops; > identifier open.open_f; > @@ > struct file_operations fops = { > ... > -.open = open_f, > +.open = simple_open, > ... > }; > > > Signed-off-by: Stephen Boyd > Cc: Greg Kroah-Hartman > Cc: Al Viro > Cc: Julia Lawall > Cc: Andrew Morton > --- > arch/arm/mach-msm/smd_debug.c | 8 +---- > arch/arm/plat-mxc/audmux-v2.c | 8 +---- > arch/x86/kernel/kdebugfs.c | 9 +---- Acked-by: Ingo Molnar Thanks, Ingo