]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
io_uring: dont ifdef io_alloc_cache_kasan()
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 28 Jan 2025 20:56:10 +0000 (20:56 +0000)
committerJens Axboe <axboe@kernel.dk>
Tue, 28 Jan 2025 22:10:40 +0000 (15:10 -0700)
Use IS_ENABLED in io_alloc_cache_kasan() so at least it gets compile
tested without KASAN.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Link: https://lore.kernel.org/r/35e53e83f6e16478dca0028a64a6cc905dc764d3.1738087204.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/alloc_cache.h

index 28436f413bd2cc61116ded527c7ab435152a4558..9eb374ad7490cc99c5e9c7981a70848ebbebea39 100644 (file)
@@ -8,18 +8,14 @@
  */
 #define IO_ALLOC_CACHE_MAX     128
 
-#if defined(CONFIG_KASAN)
-static inline void io_alloc_cache_kasan(struct iovec **iov, int *nr)
-{
-       kfree(*iov);
-       *iov = NULL;
-       *nr = 0;
-}
-#else
 static inline void io_alloc_cache_kasan(struct iovec **iov, int *nr)
 {
+       if (IS_ENABLED(CONFIG_KASAN)) {
+               kfree(*iov);
+               *iov = NULL;
+               *nr = 0;
+       }
 }
-#endif
 
 static inline bool io_alloc_cache_put(struct io_alloc_cache *cache,
                                      void *entry)