* [PATCH] OMAP: PM: CPUFREQ: Fix conditional compilation
@ 2010-09-24 8:54 Silesh C V
2010-09-24 15:06 ` Kevin Hilman
0 siblings, 1 reply; 7+ messages in thread
From: Silesh C V @ 2010-09-24 8:54 UTC (permalink / raw)
To: linux-omap; +Cc: Silesh C V
Fix conditional compilation.
Signed-off-by: Silesh C V <silesh@ti.com>
---
Applies on top of the latest pm branch.
arch/arm/plat-omap/cpu-omap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
index df08829..02e4865 100644
--- a/arch/arm/plat-omap/cpu-omap.c
+++ b/arch/arm/plat-omap/cpu-omap.c
@@ -41,7 +41,7 @@ static struct cpufreq_frequency_table *freq_table;
#ifdef CONFIG_ARCH_OMAP1
#define MPU_CLK "mpu"
-#elif CONFIG_ARCH_OMAP3
+#elif defined(CONFIG_ARCH_OMAP3)
#define MPU_CLK "arm_fck"
#else
#define MPU_CLK "virt_prcm_set"
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] OMAP: PM: CPUFREQ: Fix conditional compilation
2010-09-24 8:54 [PATCH] OMAP: PM: CPUFREQ: Fix conditional compilation Silesh C V
@ 2010-09-24 15:06 ` Kevin Hilman
2010-09-27 6:19 ` Silesh C V
0 siblings, 1 reply; 7+ messages in thread
From: Kevin Hilman @ 2010-09-24 15:06 UTC (permalink / raw)
To: Silesh C V; +Cc: linux-omap
Silesh C V <silesh@ti.com> writes:
> Fix conditional compilation.
What excatly was the compile error? and with which compiler?
The current pm branch seems to compile fine for me.
Kevin
> Signed-off-by: Silesh C V <silesh@ti.com>
> ---
>
> Applies on top of the latest pm branch.
>
> arch/arm/plat-omap/cpu-omap.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
> index df08829..02e4865 100644
> --- a/arch/arm/plat-omap/cpu-omap.c
> +++ b/arch/arm/plat-omap/cpu-omap.c
> @@ -41,7 +41,7 @@ static struct cpufreq_frequency_table *freq_table;
>
> #ifdef CONFIG_ARCH_OMAP1
> #define MPU_CLK "mpu"
> -#elif CONFIG_ARCH_OMAP3
> +#elif defined(CONFIG_ARCH_OMAP3)
> #define MPU_CLK "arm_fck"
> #else
> #define MPU_CLK "virt_prcm_set"
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] OMAP: PM: CPUFREQ: Fix conditional compilation
2010-09-24 15:06 ` Kevin Hilman
@ 2010-09-27 6:19 ` Silesh C V
2010-09-27 7:30 ` Govindraj
0 siblings, 1 reply; 7+ messages in thread
From: Silesh C V @ 2010-09-27 6:19 UTC (permalink / raw)
To: Kevin Hilman; +Cc: linux-omap
On Fri, Sep 24, 2010 at 8:36 PM, Kevin Hilman
<khilman@deeprootsystems.com> wrote:
> Silesh C V <silesh@ti.com> writes:
>
>> Fix conditional compilation.
>
> What excatly was the compile error? and with which compiler?
There is no compiler error.But what we need after an #elif is a
conditional expression.
The correct usage is #elif defined(CONFIG_XXX) rather than #elif CONFIG_XXX.
Further, if the kernel is configured for a non-omap3 arch (eg.OMAP4),
you get a compiler warning:
arch/arm/plat-omap/cpu-omap.c:47:7: warning: "CONFIG_ARCH_OMAP3" is not defined
which goes away with this patch.
>
> The current pm branch seems to compile fine for me.
>
> Kevin
>
Thanks,
Silesh.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] OMAP: PM: CPUFREQ: Fix conditional compilation
2010-09-27 6:19 ` Silesh C V
@ 2010-09-27 7:30 ` Govindraj
2010-09-27 8:48 ` Silesh C V
0 siblings, 1 reply; 7+ messages in thread
From: Govindraj @ 2010-09-27 7:30 UTC (permalink / raw)
To: Silesh C V; +Cc: Kevin Hilman, linux-omap
On Mon, Sep 27, 2010 at 11:49 AM, Silesh C V <silesh@ti.com> wrote:
> On Fri, Sep 24, 2010 at 8:36 PM, Kevin Hilman
> <khilman@deeprootsystems.com> wrote:
>> Silesh C V <silesh@ti.com> writes:
>>
>>> Fix conditional compilation.
>>
>> What excatly was the compile error? and with which compiler?
>
> There is no compiler error.But what we need after an #elif is a
> conditional expression.
> The correct usage is #elif defined(CONFIG_XXX) rather than #elif CONFIG_XXX.
>
> Further, if the kernel is configured for a non-omap3 arch (eg.OMAP4),
> you get a compiler warning:
> arch/arm/plat-omap/cpu-omap.c:47:7: warning: "CONFIG_ARCH_OMAP3" is not defined
> which goes away with this patch.
>
Silesh,
which defconfig are you using with multi omap-build defconfig(omap3_defconfig)
CONFIG_ARCH_OMAP3 will be enabled. So this compilation error will not occur.
---
Regards,
Govindraj.R
>>
>> The current pm branch seems to compile fine for me.
>>
>> Kevin
>>
>
> Thanks,
> Silesh.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] OMAP: PM: CPUFREQ: Fix conditional compilation
2010-09-27 7:30 ` Govindraj
@ 2010-09-27 8:48 ` Silesh C V
2010-09-28 19:17 ` Kevin Hilman
0 siblings, 1 reply; 7+ messages in thread
From: Silesh C V @ 2010-09-27 8:48 UTC (permalink / raw)
To: Govindraj; +Cc: Kevin Hilman, linux-omap
On Mon, Sep 27, 2010 at 1:00 PM, Govindraj <govindraj.ti@gmail.com> wrote:
> On Mon, Sep 27, 2010 at 11:49 AM, Silesh C V <silesh@ti.com> wrote:
>> On Fri, Sep 24, 2010 at 8:36 PM, Kevin Hilman
>> <khilman@deeprootsystems.com> wrote:
>>> Silesh C V <silesh@ti.com> writes:
>>>
>>>> Fix conditional compilation.
>>>
>>> What excatly was the compile error? and with which compiler?
>>
>> There is no compiler error.But what we need after an #elif is a
>> conditional expression.
>> The correct usage is #elif defined(CONFIG_XXX) rather than #elif CONFIG_XXX.
>>
>> Further, if the kernel is configured for a non-omap3 arch (eg.OMAP4),
>> you get a compiler warning:
>> arch/arm/plat-omap/cpu-omap.c:47:7: warning: "CONFIG_ARCH_OMAP3" is not defined
>> which goes away with this patch.
>>
>
> Silesh,
>
> which defconfig are you using with multi omap-build defconfig(omap3_defconfig)
>
> CONFIG_ARCH_OMAP3 will be enabled. So this compilation error will not occur.
>
> ---
> Regards,
> Govindraj.R
>
>
As I said before there is no compilation error. But what we have to
check for is whether CONFIG_ARCH_OMAP3 is defined or not.
Not for the value of CONFIG_ARCH_OMAP3. We have to check for value of
defined (CONFIG_ARCH_OMAP3). Otherwise compiler searches for the value
of the macro and hence the warning(comes with a omap4 config).See how
#elif + CONFIG_XXX is used elsewhere in kernel.
Thanks,
Silesh.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] OMAP: PM: CPUFREQ: Fix conditional compilation
2010-09-27 8:48 ` Silesh C V
@ 2010-09-28 19:17 ` Kevin Hilman
2010-09-29 5:27 ` Silesh C V
0 siblings, 1 reply; 7+ messages in thread
From: Kevin Hilman @ 2010-09-28 19:17 UTC (permalink / raw)
To: Silesh C V; +Cc: Govindraj, linux-omap
Silesh C V <saileshcv@gmail.com> writes:
> On Mon, Sep 27, 2010 at 1:00 PM, Govindraj <govindraj.ti@gmail.com> wrote:
>> On Mon, Sep 27, 2010 at 11:49 AM, Silesh C V <silesh@ti.com> wrote:
>>> On Fri, Sep 24, 2010 at 8:36 PM, Kevin Hilman
>>> <khilman@deeprootsystems.com> wrote:
>>>> Silesh C V <silesh@ti.com> writes:
>>>>
>>>>> Fix conditional compilation.
>>>>
>>>> What excatly was the compile error? and with which compiler?
>>>
>>> There is no compiler error.But what we need after an #elif is a
>>> conditional expression.
>>> The correct usage is #elif defined(CONFIG_XXX) rather than #elif CONFIG_XXX.
>>>
>>> Further, if the kernel is configured for a non-omap3 arch (eg.OMAP4),
>>> you get a compiler warning:
>>> arch/arm/plat-omap/cpu-omap.c:47:7: warning: "CONFIG_ARCH_OMAP3" is not defined
>>> which goes away with this patch.
>>>
>>
>> Silesh,
>>
>> which defconfig are you using with multi omap-build defconfig(omap3_defconfig)
>>
>> CONFIG_ARCH_OMAP3 will be enabled. So this compilation error will not occur.
>>
>> ---
>> Regards,
>> Govindraj.R
>>
>>
>
> As I said before there is no compilation error. But what we have to
> check for is whether CONFIG_ARCH_OMAP3 is defined or not.
> Not for the value of CONFIG_ARCH_OMAP3. We have to check for value of
> defined (CONFIG_ARCH_OMAP3). Otherwise compiler searches for the value
> of the macro and hence the warning(comes with a omap4 config).See how
> #elif + CONFIG_XXX is used elsewhere in kernel.
I see what you're saying now. The current #elif clause will *always* be
true.
You'll notice that all of this confusion would not have happened if the
original changelog described the problem in detail, showing that that
#elif clause will always be true, and especially not calling it a
compliation fix.
Please re-post with a better changelog and I will incoporate into the
pm-cpufreq sub-branch of the PM branch.
Thanks,
Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] OMAP: PM: CPUFREQ: Fix conditional compilation
2010-09-28 19:17 ` Kevin Hilman
@ 2010-09-29 5:27 ` Silesh C V
0 siblings, 0 replies; 7+ messages in thread
From: Silesh C V @ 2010-09-29 5:27 UTC (permalink / raw)
To: Kevin Hilman; +Cc: Govindraj, linux-omap
On Wed, Sep 29, 2010 at 12:47 AM, Kevin Hilman
<khilman@deeprootsystems.com> wrote:
> I see what you're saying now. The current #elif clause will *always* be
> true.
>
> You'll notice that all of this confusion would not have happened if the
> original changelog described the problem in detail, showing that that
> #elif clause will always be true, and especially not calling it a
> compliation fix.
I did not call it a compilation fix, I called it a _conditional_
compilation fix ;-).
The problem is not that the #elif clause ends up always being true.
The problem is that the preprocessor checks for the value of
CONFIG_ARCH_OMAP3 rather than the value of defined(CONFIG_ARCH_OMAP3).
Hence it emits warnings when CONFIG_ARCH_OMAP3 is not defined making
the #elif clause useless(which is there to check whether the macro is
defined or not).
>
> Please re-post with a better changelog and I will incoporate into the
> pm-cpufreq sub-branch of the PM branch.
Will do.
Thanks,
Silesh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-09-29 5:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-24 8:54 [PATCH] OMAP: PM: CPUFREQ: Fix conditional compilation Silesh C V
2010-09-24 15:06 ` Kevin Hilman
2010-09-27 6:19 ` Silesh C V
2010-09-27 7:30 ` Govindraj
2010-09-27 8:48 ` Silesh C V
2010-09-28 19:17 ` Kevin Hilman
2010-09-29 5:27 ` Silesh C V
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).