lkml.org 
[lkml]   [2019]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] gpio: remove less important #ifdef around declarations
On Sun, Jul 7, 2019 at 4:31 AM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:

> The whole struct/function declarations in this header are surrounded
> by #ifdef.
>
> As far as I understood, the motivation of doing so is probably to break
> the build earlier if a driver misses to select or depend on correct
> CONFIG options in Kconfig.
>
> Since commit 94bed2a9c4ae ("Add -Werror-implicit-function-declaration")
> no one cannot call functions that have not been declared.
>
> So, I see some benefit in doing this in the cost of uglier headers.
>
> In reality, it would not be so easy to catch missed 'select' or
> 'depends on' because GPIOLIB, GPIOLIB_IRQCHIP etc. are already selected
> by someone else eventually. So, this kind of error, if any, will be
> caught by randconfig bots.
>
> In summary, I am not a big fan of cluttered #ifdef nesting, and this
> does not matter for normal developers. The code readability wins.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Hm I guess you're right.

This patch does not apply cleanly on v5.3-rc1, could you rebase it
and resend?

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2019-07-29 00:35    [W:0.043 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site