From 135d9a9048e3716c755373182720d0eba170285f Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Tue, 11 Apr 2023 17:56:16 +0000 Subject: [PATCH] Linux: Suppress -Wordered-compare-function-pointers in tracepoint code Clang points out that there is a comparison against -1, but we cannot fix it because that is from the kernel headers, which we must support. We can workaround this by using a pragma. Sponsored-By: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf Reviewed-by: Youzhong Yang Signed-off-by: Richard Yao Closes #14738 --- include/os/linux/zfs/sys/trace_zil.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/os/linux/zfs/sys/trace_zil.h b/include/os/linux/zfs/sys/trace_zil.h index 6dd18c5974b9..fb03d3149f8f 100644 --- a/include/os/linux/zfs/sys/trace_zil.h +++ b/include/os/linux/zfs/sys/trace_zil.h @@ -152,6 +152,9 @@ * zilog_t *, ..., * itx_t *, ...); */ + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wordered-compare-function-pointers" /* BEGIN CSTYLED */ DECLARE_EVENT_CLASS(zfs_zil_process_itx_class, TP_PROTO(zilog_t *zilog, itx_t *itx), @@ -169,6 +172,7 @@ DECLARE_EVENT_CLASS(zfs_zil_process_itx_class, ZILOG_TP_PRINTK_ARGS, ITX_TP_PRINTK_ARGS) ); /* END CSTYLED */ +#pragma clang diagnostic pop #define DEFINE_ZIL_PROCESS_ITX_EVENT(name) \ DEFINE_EVENT(zfs_zil_process_itx_class, name, \