Skip to content

Commit 667de03

Browse files
andy-shevtytso
authored andcommitted
ext4: mark ctx_*_flags() with __maybe_unused
When ctx_set_flags() is unused, it prevents kernel builds with clang, `make W=1` and CONFIG_WERROR=y: .../ext4/super.c:2120:1: error: unused function 'ctx_set_flags' [-Werror,-Wunused-function] 2120 | EXT4_SET_CTX(flags); /* set only */ | ^~~~~~~~~~~~~~~~~~~ Fix this by marking ctx_*_flags() with __maybe_unused (mark both for the sake of symmetry). See also commit 6863f56 ("kbuild: allow Clang to find unused static inline functions for W=1 build"). Signed-off-by: Andy Shevchenko <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 150c174 commit 667de03

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/ext4/super.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,16 +2096,16 @@ static int ext4_parse_test_dummy_encryption(const struct fs_parameter *param,
20962096
}
20972097

20982098
#define EXT4_SET_CTX(name) \
2099-
static inline void ctx_set_##name(struct ext4_fs_context *ctx, \
2100-
unsigned long flag) \
2099+
static inline __maybe_unused \
2100+
void ctx_set_##name(struct ext4_fs_context *ctx, unsigned long flag) \
21012101
{ \
21022102
ctx->mask_s_##name |= flag; \
21032103
ctx->vals_s_##name |= flag; \
21042104
}
21052105

21062106
#define EXT4_CLEAR_CTX(name) \
2107-
static inline void ctx_clear_##name(struct ext4_fs_context *ctx, \
2108-
unsigned long flag) \
2107+
static inline __maybe_unused \
2108+
void ctx_clear_##name(struct ext4_fs_context *ctx, unsigned long flag) \
21092109
{ \
21102110
ctx->mask_s_##name |= flag; \
21112111
ctx->vals_s_##name &= ~flag; \

0 commit comments

Comments
 (0)