[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250428-ublk_selftests-v1-1-5795f7b00cda@purestorage.com>
Date: Mon, 28 Apr 2025 17:10:20 -0600
From: Uday Shankar <ushankar@...estorage.com>
To: Ming Lei <ming.lei@...hat.com>, Shuah Khan <shuah@...nel.org>
Cc: linux-block@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org, Uday Shankar <ushankar@...estorage.com>
Subject: [PATCH 1/3] selftests: ublk: kublk: build with -Werror iff
CONFIG_WERROR=y
Compiler warnings can catch bugs at compile time. They can also produce
annoying false positives. Due to this duality, the kernel provides
CONFIG_WERROR so that the developer can choose whether or not they want
compiler warnings to fail the build. Use this same config options to
control whether or not warnings in building kublk fail its build.
Signed-off-by: Uday Shankar <ushankar@...estorage.com>
---
tools/testing/selftests/ublk/Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ublk/Makefile b/tools/testing/selftests/ublk/Makefile
index ec4624a283bce2ebeed80509be6573c1b7a3623d..86474cfe8d03b2df3f8c9bc1a5902701a0f72f58 100644
--- a/tools/testing/selftests/ublk/Makefile
+++ b/tools/testing/selftests/ublk/Makefile
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
-CFLAGS += -O3 -Wl,-no-as-needed -Wall -I $(top_srcdir)
+CONFIG = $(top_srcdir)/include/config/auto.conf
+WERROR = $(if $(shell grep CONFIG_WERROR=y ${CONFIG}),-Werror,)
+CFLAGS += -O3 -Wl,-no-as-needed -Wall ${WERROR} -I $(top_srcdir)
LDLIBS += -lpthread -lm -luring
TEST_PROGS := test_generic_01.sh
--
2.34.1
Powered by blists - more mailing lists