diff mbox series

[05/10] misc: lkdtm: Always provide prototype for lkdtm_DOUBLE_FAULT()

Message ID 20200626130525.389469-6-lee.jones@linaro.org (mailing list archive)
State New, archived
Headers show
Series Fix a bunch of W=1 warnings in Misc | expand

Commit Message

Lee Jones June 26, 2020, 1:05 p.m. UTC
lkdtm_DOUBLE_FAULT() already has internal logic to handle
!CONFIG_X86_32.  Compiling out the prototype actually prevents
that logic from being useful.

Fixes the following W=1 warning:

 drivers/misc/lkdtm/bugs.c: At top level:
 drivers/misc/lkdtm/bugs.c:420:6: warning: no previous prototype for ‘lkdtm_DOUBLE_FAULT’ [-Wmissing-prototypes]
 420 | void lkdtm_DOUBLE_FAULT(void)
 | ^~~~~~~~~~~~~~~~~~

Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/misc/lkdtm/lkdtm.h | 2 --
 1 file changed, 2 deletions(-)

Comments

Arnd Bergmann June 26, 2020, 2:37 p.m. UTC | #1
On Fri, Jun 26, 2020 at 3:05 PM Lee Jones <lee.jones@linaro.org> wrote:
>
> lkdtm_DOUBLE_FAULT() already has internal logic to handle
> !CONFIG_X86_32.  Compiling out the prototype actually prevents
> that logic from being useful.
>
> Fixes the following W=1 warning:
>
>  drivers/misc/lkdtm/bugs.c: At top level:
>  drivers/misc/lkdtm/bugs.c:420:6: warning: no previous prototype for ‘lkdtm_DOUBLE_FAULT’ [-Wmissing-prototypes]
>  420 | void lkdtm_DOUBLE_FAULT(void)
>  | ^~~~~~~~~~~~~~~~~~
>
> Cc: Kees Cook <keescook@chromium.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>
Kees Cook June 26, 2020, 3:23 p.m. UTC | #2
On Fri, Jun 26, 2020 at 02:05:20PM +0100, Lee Jones wrote:
> lkdtm_DOUBLE_FAULT() already has internal logic to handle
> !CONFIG_X86_32.  Compiling out the prototype actually prevents
> that logic from being useful.
> 
> Fixes the following W=1 warning:
> 
>  drivers/misc/lkdtm/bugs.c: At top level:
>  drivers/misc/lkdtm/bugs.c:420:6: warning: no previous prototype for ‘lkdtm_DOUBLE_FAULT’ [-Wmissing-prototypes]
>  420 | void lkdtm_DOUBLE_FAULT(void)
>  | ^~~~~~~~~~~~~~~~~~
> 
> Cc: Kees Cook <keescook@chromium.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Thanks! This change is actually already part of another
patch and is waiting for Greg to pick up:
https://lore.kernel.org/lkml/20200529200347.2464284-5-keescook@chromium.org/
diff mbox series

Patch

diff --git a/drivers/misc/lkdtm/lkdtm.h b/drivers/misc/lkdtm/lkdtm.h
index 601a2156a0d48..8878538b2c132 100644
--- a/drivers/misc/lkdtm/lkdtm.h
+++ b/drivers/misc/lkdtm/lkdtm.h
@@ -31,9 +31,7 @@  void lkdtm_CORRUPT_USER_DS(void);
 void lkdtm_STACK_GUARD_PAGE_LEADING(void);
 void lkdtm_STACK_GUARD_PAGE_TRAILING(void);
 void lkdtm_UNSET_SMEP(void);
-#ifdef CONFIG_X86_32
 void lkdtm_DOUBLE_FAULT(void);
-#endif
 void lkdtm_CORRUPT_PAC(void);
 
 /* lkdtm_heap.c */