Skip to content

Commit 16ac51a

Browse files
isilenceaxboe
authored andcommitted
io_uring: dont ifdef io_alloc_cache_kasan()
Use IS_ENABLED in io_alloc_cache_kasan() so at least it gets compile tested without KASAN. Signed-off-by: Pavel Begunkov <[email protected]> Reviewed-by: Gabriel Krisman Bertazi <[email protected]> Link: https://lore.kernel.org/r/35e53e83f6e16478dca0028a64a6cc905dc764d3.1738087204.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 2992765 commit 16ac51a

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

io_uring/alloc_cache.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,14 @@
88
*/
99
#define IO_ALLOC_CACHE_MAX 128
1010

11-
#if defined(CONFIG_KASAN)
12-
static inline void io_alloc_cache_kasan(struct iovec **iov, int *nr)
13-
{
14-
kfree(*iov);
15-
*iov = NULL;
16-
*nr = 0;
17-
}
18-
#else
1911
static inline void io_alloc_cache_kasan(struct iovec **iov, int *nr)
2012
{
13+
if (IS_ENABLED(CONFIG_KASAN)) {
14+
kfree(*iov);
15+
*iov = NULL;
16+
*nr = 0;
17+
}
2118
}
22-
#endif
2319

2420
static inline bool io_alloc_cache_put(struct io_alloc_cache *cache,
2521
void *entry)

0 commit comments

Comments
 (0)