Skip to content

Commit 9c6ebe4

Browse files
Richard Yaoandrewc12
authored andcommitted
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 <[email protected]> Reviewed-by: Youzhong Yang <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes openzfs#14738
1 parent fd758cb commit 9c6ebe4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/os/linux/zfs/sys/trace_zil.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@
152152
* zilog_t *, ...,
153153
* itx_t *, ...);
154154
*/
155+
156+
#pragma clang diagnostic push
157+
#pragma clang diagnostic ignored "-Wordered-compare-function-pointers"
155158
/* BEGIN CSTYLED */
156159
DECLARE_EVENT_CLASS(zfs_zil_process_itx_class,
157160
TP_PROTO(zilog_t *zilog, itx_t *itx),
@@ -169,6 +172,7 @@ DECLARE_EVENT_CLASS(zfs_zil_process_itx_class,
169172
ZILOG_TP_PRINTK_ARGS, ITX_TP_PRINTK_ARGS)
170173
);
171174
/* END CSTYLED */
175+
#pragma clang diagnostic pop
172176

173177
#define DEFINE_ZIL_PROCESS_ITX_EVENT(name) \
174178
DEFINE_EVENT(zfs_zil_process_itx_class, name, \

0 commit comments

Comments
 (0)