Skip to content

Commit 7e33123

Browse files
behlendorfptr1337
authored andcommitted
config: Fix LLVM-21 -Wuninitialized-const-pointer warning
LLVM-21 enables -Wuninitialized-const-pointer which results in the following compiler warning and the bdev_file_open_by_path() interface not being detected for 6.9 and newer kernels. The blk_holder_ops are not used by the ZFS code so we can safely use a NULL argument for this check. bdev_file_open_by_path/bdev_file_open_by_path.c:110:54: error: variable 'h' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] Reviewed-by: Rob Norris <robn@despairlabs.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#17682 Closes openzfs#17684
1 parent ab48a48 commit 7e33123

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

config/kernel-blkdev.m4

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH_4ARG], [
2929
const char *path = "path";
3030
fmode_t mode = 0;
3131
void *holder = NULL;
32-
struct blk_holder_ops h;
3332
34-
bdev = blkdev_get_by_path(path, mode, holder, &h);
33+
bdev = blkdev_get_by_path(path, mode, holder, NULL);
3534
])
3635
])
3736

@@ -48,9 +47,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_OPEN_BY_PATH], [
4847
const char *path = "path";
4948
fmode_t mode = 0;
5049
void *holder = NULL;
51-
struct blk_holder_ops h;
5250
53-
bdh = bdev_open_by_path(path, mode, holder, &h);
51+
bdh = bdev_open_by_path(path, mode, holder, NULL);
5452
])
5553
])
5654

@@ -68,9 +66,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BDEV_FILE_OPEN_BY_PATH], [
6866
const char *path = "path";
6967
fmode_t mode = 0;
7068
void *holder = NULL;
71-
struct blk_holder_ops h;
7269
73-
file = bdev_file_open_by_path(path, mode, holder, &h);
70+
file = bdev_file_open_by_path(path, mode, holder, NULL);
7471
])
7572
])
7673

0 commit comments

Comments
 (0)