Re: [PATCH] Input: goodix - Fix compilation when ACPI support is disabled
From: Hans de Goede <hidden>
Date: 2020-03-25 14:06:01
Hi, On 3/25/20 3:02 PM, Bastien Nocera wrote:
On Wed, 2020-03-25 at 14:55 +0100, Hans de Goede wrote:quoted
We could do something like that, but TBH I'm not a fan of that adding extra wrappers makes it harder to see what the code is actually doing. I understand your dislike for the extra braces I added and I'm fine with fixing that by adding __maybe_unused to the variable declarations at the top. I don't really see what the problem with the #ifdef-s is given how clean they are, with the braces thing fixed by using __maybe_unused things would look like e.g. this:It's not only the fact that there's extra #ifdef's, it's that the ifdef's need to be just "that". It's not "#ifdef FOO", it's "#if defined CONFIG_X86 && defined CONFIG_ACPI".
If that is the problem I would prefer adding: /* Our special handling for GPIO accesses through ACPI is x86 specific */ #if defined CONFIG_X86 && defined CONFIG_ACPI #define ACPI_GPIO_SUPPORT #endif And use: #ifdef ACPI_GPIO_SUPPORT Elsewhere. Would that work for you? Regards, Hans