diff mbox

Kbuild: enable -Wunused-macros warning for "make W=1"

Message ID 20170803100924.8791-1-jthumshirn@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Johannes Thumshirn Aug. 3, 2017, 10:09 a.m. UTC
We have lots of dead defines and macros in drivers, lets offer users a way
to detect and eventually remove them.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 scripts/Makefile.extrawarn | 1 +
 1 file changed, 1 insertion(+)

Comments

Masahiro Yamada Aug. 24, 2017, 4:19 p.m. UTC | #1
Hi Johannes,

2017-08-03 19:09 GMT+09:00 Johannes Thumshirn <jthumshirn@suse.de>:
> We have lots of dead defines and macros in drivers, lets offer users a way
> to detect and eventually remove them.
>
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  scripts/Makefile.extrawarn | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index fb3522fd8702..8ab8bc91da55 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -25,6 +25,7 @@ warning-1 += -Wold-style-definition
>  warning-1 += $(call cc-option, -Wmissing-include-dirs)
>  warning-1 += $(call cc-option, -Wunused-but-set-variable)
>  warning-1 += $(call cc-option, -Wunused-const-variable)
> +warning-1 += $(call cc-option, -Wunused-macros)
>  warning-1 += $(call cc-disable-warning, missing-field-initializers)
>  warning-1 += $(call cc-disable-warning, sign-compare)


This makes W=1 too noisy.

For example, drivers often define unused register macros
for completeness.  I do not think it is too bad in my opinion.

Perhaps, should it be moved to warning-2 ?
Johannes Thumshirn Aug. 28, 2017, 6:53 a.m. UTC | #2
On Fri, Aug 25, 2017 at 01:19:39AM +0900, Masahiro Yamada wrote:
> This makes W=1 too noisy.
> 
> For example, drivers often define unused register macros
> for completeness.  I do not think it is too bad in my opinion.
> 
> Perhaps, should it be moved to warning-2 ?
> 

Sure, I'll send a v2 in a few days.

Thanks,
	Johannes
diff mbox

Patch

diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index fb3522fd8702..8ab8bc91da55 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -25,6 +25,7 @@  warning-1 += -Wold-style-definition
 warning-1 += $(call cc-option, -Wmissing-include-dirs)
 warning-1 += $(call cc-option, -Wunused-but-set-variable)
 warning-1 += $(call cc-option, -Wunused-const-variable)
+warning-1 += $(call cc-option, -Wunused-macros)
 warning-1 += $(call cc-disable-warning, missing-field-initializers)
 warning-1 += $(call cc-disable-warning, sign-compare)