From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [PATCH] OPTIONAL: cpufreq/intel_pstate: fix debugfs_simple_attr.cocci warnings Date: Fri, 30 Mar 2018 11:51:01 +0200 Message-ID: <2337789.pyKKFBg1Bd@aspire.rjw.lan> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Julia Lawall Cc: Francisco Jerez , kbuild-all@01.org, Srinivas Pandruvada , Len Brown , Viresh Kumar , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, 0day robot List-Id: linux-pm@vger.kernel.org Hi Julia, On Thursday, March 29, 2018 9:12:06 PM CEST Julia Lawall wrote: > Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE > for debugfs files. > > Semantic patch information: > Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file() > imposes some significant overhead as compared to > DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe(). > > Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci We've dropped the debugfs bits from intel_pstate entirely, so this change is not applicable any more. Thanks! > Fixes: 9eec7989e762 ("OPTIONAL: cpufreq/intel_pstate: Expose LP controller parameters via debugfs.") > CC: Francisco Jerez > Signed-off-by: Fengguang Wu > Signed-off-by: Julia Lawall > --- > > I don't actually know anything about this issue. The change was suggested > by kbuild. > > intel_pstate.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > --- a/drivers/cpufreq/intel_pstate.c > +++ b/drivers/cpufreq/intel_pstate.c > @@ -885,7 +885,7 @@ static int lp_param_get(void *data, u64 > *val = *(u32 *)data; > return 0; > } > -DEFINE_SIMPLE_ATTRIBUTE(fops_lp_param, lp_param_get, lp_param_set, "%llu\n"); > +DEFINE_DEBUGFS_ATTRIBUTE(fops_lp_param, lp_param_get, lp_param_set, "%llu\n"); > > static struct dentry *debugfs_parent; > > @@ -922,9 +922,10 @@ static void intel_pstate_debug_expose_pa > for (i = 0; lp_files[i].name; i++) { > struct dentry *dentry; > > - dentry = debugfs_create_file(lp_files[i].name, 0660, > - debugfs_parent, lp_files[i].value, > - &fops_lp_param); > + dentry = debugfs_create_file_unsafe(lp_files[i].name, 0660, > + debugfs_parent, > + lp_files[i].value, > + &fops_lp_param); > if (!IS_ERR(dentry)) > lp_files[i].dentry = dentry; > } >