From 009faf132dc47dcfb604b95c93211da7d2c644e2 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Wed, 9 Nov 2022 07:33:40 -0600 Subject: [PATCH] LU-16116 build: Configure tests for rhltable, bitmap_alloc... MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit rhel8.6 with kernel 5.18 breaks a couple of compile tests struct rhltable test fails with: ... error: ‘hlt’ is used uninitialized in this function [-Werror=uninitialized] rdma_wr() test failes with: ... error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] wr = rdma_wr(NULL); nla_strdup() test fails due to unused variable 'tmp' Test-Parameters: trivial HPE-bug-id: LUS-11191 Signed-off-by: Shaun Tancheff Change-Id: Ib2b1d223ac809cea157158fe35fd2535b04367df Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48361 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu Reviewed-by: Petros Koutoupis --- libcfs/autoconf/lustre-libcfs.m4 | 3 ++- lnet/autoconf/lustre-lnet.m4 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4 index 7a533ad..badfcf5 100644 --- a/libcfs/autoconf/lustre-libcfs.m4 +++ b/libcfs/autoconf/lustre-libcfs.m4 @@ -784,7 +784,7 @@ LB_CHECK_COMPILE([does 'struct rhltable' exist], rhtable, [ #include ],[ - struct rhltable *hlt; + struct rhltable *hlt = NULL; rhltable_destroy(hlt); ],[ @@ -1091,6 +1091,7 @@ nla_strdup, [ #include ],[ char *tmp = nla_strdup(NULL, GFP_KERNEL); + (void)tmp; ],[ AC_DEFINE(HAVE_NLA_STRDUP, 1, ['nla_strdup' is available]) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 773b10f..7e89069 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -410,7 +410,7 @@ AS_IF([test $ENABLEO2IB != "no"], [ #endif #include ],[ - struct ib_rdma_wr *wr __attribute__ ((unused)); + const struct ib_rdma_wr *wr __attribute__ ((unused)); wr = rdma_wr(NULL); ],[ -- 1.8.3.1