[PATCH 6.12.y] block: make bio_integrity_map_user() static inline

Ruslan Valiyev posted 1 patch 1 week, 3 days ago
include/linux/bio-integrity.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH 6.12.y] block: make bio_integrity_map_user() static inline
Posted by Ruslan Valiyev 1 week, 3 days ago
From: Jens Axboe <axboe@kernel.dk>

If CONFIG_BLK_DEV_INTEGRITY isn't set, then the dummy helper must be
static inline to avoid complaints about the function being unused.

Fixes: fe8f4ca7107e ("block: modify bio_integrity_map_user to accept iov_iter as argument")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202411300229.y7h60mDg-lkp@intel.com/
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 546d191427cf5cf3215529744c2ea8558f0279db)

The same build break is now reported on stable-rc/linux-6.12.y by KernelCI.

Verified the upstream cherry-pick applies cleanly on top of 97928cc88900a
(Linux 6.12.92-rc1) and that block/bdev.o + block/fops.o compile cleanly
afterwards with i386_defconfig (which leaves CONFIG_BLK_DEV_INTEGRITY
unset). Without the fix both files trip:

  include/linux/bio-integrity.h:101:12: error: 'bio_integrity_map_user' defined but not used [-Werror=unused-function]

Reported-by: kernelci.org bot <bot@kernelci.org>
Closes: https://lore.kernel.org/all/178000554419.7114.5687032601791586484@330cfa3079ca/
Closes: https://lore.kernel.org/all/178000194591.7095.11275948264529325340@330cfa3079ca/
Signed-off-by: Ruslan Valiyev <linuxoid@gmail.com>
---
 include/linux/bio-integrity.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/bio-integrity.h b/include/linux/bio-integrity.h
index be91479b2c42d..53f6dbd2816e0 100644
--- a/include/linux/bio-integrity.h
+++ b/include/linux/bio-integrity.h
@@ -98,7 +98,7 @@ static inline void bioset_integrity_free(struct bio_set *bs)
 {
 }
 
-static int bio_integrity_map_user(struct bio *bio, struct iov_iter *iter)
+static inline int bio_integrity_map_user(struct bio *bio, struct iov_iter *iter)
 {
 	return -EINVAL;
 }

base-commit: 97928cc88900a9fb07a4dddbd1db19eb0ce55c56
-- 
2.43.0