lkml.org 
[lkml]   [2012]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] gpio/exynos: Fix compiler warnings when non-exynos machines are selected
From
On 02/05/2012, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Apr 30, 2012 at 8:52 AM, Sachin Kamat <sachin.kamat@linaro.org>
> wrote:
>
>> +#if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5)
>> +#endif
>> -static struct samsung_gpio_chip exynos4_gpios_1[] = {
>> #ifdef CONFIG_ARCH_EXYNOS4
>> +static struct samsung_gpio_chip exynos4_gpios_1[] = {
>> -#endif
>> +#endif
>> -static struct samsung_gpio_chip exynos4_gpios_2[] = {
>> #ifdef CONFIG_ARCH_EXYNOS4
>> +static struct samsung_gpio_chip exynos4_gpios_2[] = {
>> -#endif
>> +#endif
>> -static struct samsung_gpio_chip exynos4_gpios_3[] = {
>> #ifdef CONFIG_ARCH_EXYNOS4
>> +static struct samsung_gpio_chip exynos4_gpios_3[] = {
>> -#endif
>> +#endif
>> #ifdef CONFIG_ARCH_EXYNOS5
>> +#if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250)
>> +#endif
>> +#if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250)
>> +#endif
>
> We really want to get rid of this kind of stuff from all drivers, #ifdefs
> are
> declared ugly already in Documentation/CodingStyle.

Yes, you are right. #Ifdefs should be avoided as far as possible and
more importantly to get a single zImage.

>
> Any chance you could solve this problem by reworking the driver to
> pass some flag in platform data tell which exynos it's for
> and jist adapt at runtime instead of the compile-time quirkiness?

No. I wouldn't be working on this, hence provided this patch to get
rid of the nasty compiler warnings until someone fixes the same
(compile-time to runtime adaptation).

>
> Besides looking better, it helps us to get to a single zImage for the
> exynoses too..

Definitely.



>
> Yours,
> Linus Walleij
>


--
With warm regards,
Sachin


\
 
 \ /
  Last update: 2012-05-02 06:42    [W:0.060 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site