Re: [PATCH -mm 1/2] nilfs2: use integer type instead of enum req_op for event tracing header

From: Bart Van Assche
Date: Mon May 06 2024 - 13:26:18 EST


On 5/5/24 12:04 PM, Ryusuke Konishi wrote:
I also tried typecasting on the declaration header side of event
tracing, but so far, the sparse warnings don't go away except for the
patch I first proposed.

How about this patch?

diff --git a/include/trace/events/nilfs2.h b/include/trace/events/nilfs2.h
index 8efc6236f57c..b1a364a33a62 100644
--- a/include/trace/events/nilfs2.h
+++ b/include/trace/events/nilfs2.h
@@ -200,7 +200,11 @@ TRACE_EVENT(nilfs2_mdt_submit_block,
__field(struct inode *, inode)
__field(unsigned long, ino)
__field(unsigned long, blkoff)
- __field(enum req_op, mode)
+ /*
+ * Use field_struct to avoid is_signed_type() on the bitwise
+ * type enum req_op.
+ */
+ __field_struct(enum req_op, mode)
),

TP_fast_assign(

Thanks,

Bart.