Skip to content

Commit

Permalink
Linux: Suppress -Wordered-compare-function-pointers in tracepoint code
Browse files Browse the repository at this point in the history
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 <behlendorf1@llnl.gov>
Reviewed-by: Youzhong Yang <yyang@mathworks.com>
Signed-off-by: Richard Yao <richard.yao@klarasystems.com>
Closes #14738
  • Loading branch information
Richard Yao authored and behlendorf committed Apr 20, 2023
1 parent ab71b24 commit 135d9a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/os/linux/zfs/sys/trace_zil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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, \
Expand Down

0 comments on commit 135d9a9

Please sign in to comment.