linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] KVM: s390: selftests: work around macro is_signed_type re-definiton
@ 2025-07-22 15:53 Michael Mueller
  0 siblings, 0 replies; only message in thread
From: Michael Mueller @ 2025-07-22 15:53 UTC (permalink / raw)
  To: kvm
  Cc: Michael Mueller, linux-s390, Christian Borntraeger,
	Christoph Schlameuss, Janosch Frank, Arnaldo Carvalho de Melo

The following commit creates a pre-processor warning during the KVM
selftest build as it leads to a re-definition of macro is_signed_type().

  commit fc92099902fb ("tools headers: Synchronize linux/bits.h with the kernel sources")

  $ make -C tools/testing/selftests TARGETS="kvm" all >/dev/null
  In file included from s390/ucontrol_test.c:11:
  ../kselftest_harness.h:754:9: warning: ‘is_signed_type’ redefined
    754 | #define is_signed_type(var)       (!!(((__typeof__(var))(-1)) < (__typeof__(var))1))
        |         ^~~~~~~~~~~~~~
  In file included from ./linux/tools/testing/selftests/../../../tools/include/linux/bits.h:34,
                   from ./linux/tools/testing/selftests/../../../tools/include/linux/bitops.h:14,
                   from ./linux/tools/testing/selftests/../../../tools/include/linux/hashtable.h:13,
                   from include/kvm_util.h:11,
                   from include/s390/debug_print.h:15,
                   from s390/ucontrol_test.c:10:
  ./linux/tools/testing/selftests/../../../tools/include/linux/overflow.h:31:9: note: this is the location of the previous definition
     31 | #define is_signed_type(type)       (((type)(-1)) < (type)1)
     	|         ^~~~~~~~~~~~~~
  cc1: note: unrecognized command-line option ‘-Wno-gnu-variable-sized-type-not-at-end’ may have been intended to silence earlier diagnostics

A fix resolving this issue outside this kvm selftest would be preferred.

Signed-off-by: Michael Mueller <mimu@linux.ibm.com>
---
 tools/testing/selftests/kvm/s390/ucontrol_test.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/testing/selftests/kvm/s390/ucontrol_test.c b/tools/testing/selftests/kvm/s390/ucontrol_test.c
index d265b34c54be..d1258c1568db 100644
--- a/tools/testing/selftests/kvm/s390/ucontrol_test.c
+++ b/tools/testing/selftests/kvm/s390/ucontrol_test.c
@@ -8,6 +8,16 @@
  *  Christoph Schlameuss <schlameuss@linux.ibm.com>
  */
 #include "debug_print.h"
+
+/*
+ * header debug_print.h leaves macro is_signed_type()
+ * behind which is defined in "linux/overflow.h"
+ * header "kselftest_harness.h" re-defines it.
+ */
+#ifdef is_signed_type
+#undef is_signed_type
+#endif
+
 #include "kselftest_harness.h"
 #include "kvm_util.h"
 #include "processor.h"
-- 
2.50.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-07-22 16:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-22 15:53 [RFC PATCH] KVM: s390: selftests: work around macro is_signed_type re-definiton Michael Mueller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).