Re: [PATCH 2/2] touchscreen: goodix: define GPIO mapping for GPD P2 Max

From
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date
2019-08-30 18:17:05
Also in
linux-acpi, linux-gpio, lkml
On Fri, Aug 30, 2019 at 11:15:27PM +0800, Peter Cai wrote:
On Fri, Aug 30, 2019, 7:55 PM Andy Shevchenko <
andriy.shevchenko@linux.intel.com> wrote:
quoted
I guess most of these #ifdef:s makes code less readable for exchange of
saving
few bytes in the module footprint.

Well since they can only be used when ACPI is supported
(devm_acpi_dev_add_driver_gpios does not exist without ACPI defined, thus
the last guard must exist),
This is not correct.
if they were not guarded then we would be left
with a bunch of unused variables warnings when building without ACPI which
doesn't seem good.
Good / no-good is only matter of few dozens of bytes here and there to be saved.
Should we use __maybe_unused here instead of #ifdef guards?
No, it won't make sense, because the structures will be part of
_add_driver_gpio() call, due to which compiler likely can't recognize unused
structures. However, you may try with warnings enabled `make W=1`.
quoted
Comma at the end?
I was trying to follow the style of this driver but it doesn't seem to be
really consistent within itself. Another dmi_system_id definition in the
same file mixed both styles so I was kind of confused.
I see. So, this is for Dmitry's preferences.

-- 
With Best Regards,
Andy Shevchenko
Thread (1 message) 1 message, 1 author, last reply 2019-08-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help