Skip to content

Commit b490925

Browse files
JustinStittkees
authored andcommitted
drivers: lkdtm: fix clang -Wformat warning
When building with Clang we encounter the following warning (ARCH=hexagon + CONFIG_FRAME_WARN=0): | ../drivers/misc/lkdtm/bugs.c:107:3: error: format specifies type | 'unsigned long' but the argument has type 'int' [-Werror,-Wformat] | REC_STACK_SIZE, recur_count); | ^~~~~~~~~~~~~~ Cast REC_STACK_SIZE to `unsigned long` to match format specifier `%lu` as well as maintain symmetry with `#define REC_STACK_SIZE (_AC(CONFIG_FRAME_WARN, UL) / 2)`. Link: ClangBuiltLinux#378 Reported-by: Nathan Chancellor <[email protected]> Suggested-by: Nathan Chancellor <[email protected]> Suggested-by: Nick Desaulniers <[email protected]> Signed-off-by: Justin Stitt <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Acked-by: Kees Cook <[email protected]> Fixes: 24cccab ("lkdtm/bugs: Adjust recursion test to avoid elision") Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c09327d commit b490925

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/misc/lkdtm/bugs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct lkdtm_list {
2929
#if defined(CONFIG_FRAME_WARN) && (CONFIG_FRAME_WARN > 0)
3030
#define REC_STACK_SIZE (_AC(CONFIG_FRAME_WARN, UL) / 2)
3131
#else
32-
#define REC_STACK_SIZE (THREAD_SIZE / 8)
32+
#define REC_STACK_SIZE (THREAD_SIZE / 8UL)
3333
#endif
3434
#define REC_NUM_DEFAULT ((THREAD_SIZE / REC_STACK_SIZE) * 2)
3535

0 commit comments

Comments
 (0)