Re: [PATCH v2] x86/pmc_atom: Fix warning when CONFIG_DEBUG_FS=n

2014-09-17 Thread Martin Kelly
On 09/17/2014 05:24 AM, Ingo Molnar wrote: > > Just to paint the bike shed a bit, this could be further > simplified to something like: > > ... > > ret = pmc_dbgfs_register(pmc, pdev); > if (ret) > iounmap(pmc->regmap); > > return ret; > > and then your p

Re: [PATCH v2] x86/pmc_atom: Fix warning when CONFIG_DEBUG_FS=n

2014-09-17 Thread Ingo Molnar
* Martin Kelly wrote: > When compiling with CONFIG_DEBUG_FS=n, gcc emits an unused variable > warning for pmc_atom.c because "ret" is used only within the > CONFIG_DEBUG_FS block. This patch adds a dummy #ifdef for > pmc_dbgfs_register when CONFIG_DEBUG_FS=n to simplify the code and > remove the

Re: [PATCH v2] x86/pmc_atom: Fix warning when CONFIG_DEBUG_FS=n

2014-09-16 Thread Martin Kelly
On 09/16/2014 08:44 PM, Li, Aubrey wrote: > > Why do you want to call pmc_dbgfs_register() anyway even if > CONFIG_DEBUG_FS=n? > > Thanks, > -Aubrey > The compiler will optimize away the call when CONFIG_DEBUG_FS=n, as the function body is just "return 0". Since the line following the call is

Re: [PATCH v2] x86/pmc_atom: Fix warning when CONFIG_DEBUG_FS=n

2014-09-16 Thread Li, Aubrey
On 2014/9/17 11:20, Martin Kelly wrote: > On 09/16/2014 07:09 PM, Li, Aubrey wrote: >> >> Thanks to take care of this warning. How about this version? >> >> diff --git a/arch/x86/kernel/pmc_atom.c b/arch/x86/kernel/pmc_atom.c >> index 0c424a6..cd91b57 100644 >> --- a/arch/x86/kernel/pmc_atom.c >> +

Re: [PATCH v2] x86/pmc_atom: Fix warning when CONFIG_DEBUG_FS=n

2014-09-16 Thread Martin Kelly
On 09/16/2014 07:09 PM, Li, Aubrey wrote: > > Thanks to take care of this warning. How about this version? > > diff --git a/arch/x86/kernel/pmc_atom.c b/arch/x86/kernel/pmc_atom.c > index 0c424a6..cd91b57 100644 > --- a/arch/x86/kernel/pmc_atom.c > +++ b/arch/x86/kernel/pmc_atom.c > @@ -240,7 +24

Re: [PATCH v2] x86/pmc_atom: Fix warning when CONFIG_DEBUG_FS=n

2014-09-16 Thread Li, Aubrey
On 2014/9/17 8:49, Martin Kelly wrote: > When compiling with CONFIG_DEBUG_FS=n, gcc emits an unused variable > warning for pmc_atom.c because "ret" is used only within the > CONFIG_DEBUG_FS block. This patch adds a dummy #ifdef for > pmc_dbgfs_register when CONFIG_DEBUG_FS=n to simplify the code an

[PATCH v2] x86/pmc_atom: Fix warning when CONFIG_DEBUG_FS=n

2014-09-16 Thread Martin Kelly
When compiling with CONFIG_DEBUG_FS=n, gcc emits an unused variable warning for pmc_atom.c because "ret" is used only within the CONFIG_DEBUG_FS block. This patch adds a dummy #ifdef for pmc_dbgfs_register when CONFIG_DEBUG_FS=n to simplify the code and remove the warning. Signed-off-by: Martin Ke