Laurent Pinchart bed4ed3057 scripts/kernel-doc: Override -Werror from KCFLAGS with KDOC_WERROR
Since commit 2c12c8103d8f ("scripts/kernel-doc: optionally treat
warnings as errors"), the kernel-doc script will treat warnings as
errors when one of the following conditions is true:

- The KDOC_WERROR environment variable is non-zero
- The KCFLAGS environment variable contains -Werror
- The -Werror parameter is passed to kernel-doc

Checking KCFLAGS for -Werror allows piggy-backing on the C compiler
error handling. However, unlike the C compiler, kernel-doc has no
provision for -Wno-error. This makes compiling the kernel with -Werror
(to catch regressions) and W=1 (to enable more checks) always fail,
without the same possibility as offered by the C compiler to treating
some selected warnings as warnings despite the global -Werror setting.

To fix this, evaluate KDOC_WERROR after KCFLAGS, which allows disabling
the warnings-as-errors behaviour of kernel-doc selectively by setting
KDOC_WERROR=0.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20210730225401.4401-1-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2021-08-12 08:58:13 -06:00
..
2021-07-10 11:01:38 -07:00
2017-03-28 16:16:52 +02:00
2020-12-08 23:30:04 +09:00
2021-07-10 11:01:38 -07:00
2021-04-26 08:38:10 -07:00
2021-07-10 11:01:38 -07:00
2020-10-22 13:13:57 -07:00
2021-07-10 11:01:38 -07:00
2021-02-26 09:41:05 -08:00
2021-05-02 00:43:35 +09:00
2021-05-08 10:00:11 -07:00
2020-12-08 23:30:04 +09:00
2020-12-08 23:30:04 +09:00
2021-07-09 04:01:14 +09:00
2021-05-02 00:43:35 +09:00
2021-05-03 17:23:06 -06:00