From: Ryusuke Konishi <konishi.ryusuke@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Bart Van Assche <bvanassche@acm.org>,
Jens Axboe <axboe@kernel.dk>
Subject: [PATCH -mm 1/2] nilfs2: use integer type instead of enum req_op for event tracing header
Date: Tue, 30 Apr 2024 17:00:18 +0900 [thread overview]
Message-ID: <20240430080019.4242-2-konishi.ryusuke@gmail.com> (raw)
In-Reply-To: <20240430080019.4242-1-konishi.ryusuke@gmail.com>
The sparse check with "make C=1" outputs warnings regarding references
to the header file "include/trace/events/nilfs2.h" for event tracing:
fs/nilfs2/segment.c: note: in included file (through
include/trace/trace_events.h, include/trace/define_trace.h,
include/trace/events/nilfs2.h):
./include/trace/events/nilfs2.h:191:1: warning: cast to restricted
blk_opf_t
./include/trace/events/nilfs2.h:191:1: warning: restricted blk_opf_t
degrades to integer
./include/trace/events/nilfs2.h:191:1: warning: restricted blk_opf_t
degrades to integer
Fix this issue by reverting the type of the parameter related to the
bio operation mode in the event tracing definition from "enum req_op"
to "int".
In order to prevent sparse warnings on the caller side (where
trace_nilfs2_mdt_submit_block() is used), also add a typecast to an
argument passed to the tracepoint.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202401092241.I4mm9OWl-lkp@intel.com/
Fixes: ed4512590bd5 ("fs/nilfs2: Use the enum req_op and blk_opf_t types")
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>
---
fs/nilfs2/mdt.c | 2 +-
include/trace/events/nilfs2.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c
index 4f792a0ad0f0..323eb8442e0a 100644
--- a/fs/nilfs2/mdt.c
+++ b/fs/nilfs2/mdt.c
@@ -152,7 +152,7 @@ nilfs_mdt_submit_block(struct inode *inode, unsigned long blkoff, blk_opf_t opf,
ret = 0;
trace_nilfs2_mdt_submit_block(inode, inode->i_ino, blkoff,
- opf & REQ_OP_MASK);
+ (__force int)(opf & REQ_OP_MASK));
out:
get_bh(bh);
*out_bh = bh;
diff --git a/include/trace/events/nilfs2.h b/include/trace/events/nilfs2.h
index 8efc6236f57c..84ee31fc04cc 100644
--- a/include/trace/events/nilfs2.h
+++ b/include/trace/events/nilfs2.h
@@ -192,7 +192,7 @@ TRACE_EVENT(nilfs2_mdt_submit_block,
TP_PROTO(struct inode *inode,
unsigned long ino,
unsigned long blkoff,
- enum req_op mode),
+ int mode),
TP_ARGS(inode, ino, blkoff, mode),
@@ -200,7 +200,7 @@ TRACE_EVENT(nilfs2_mdt_submit_block,
__field(struct inode *, inode)
__field(unsigned long, ino)
__field(unsigned long, blkoff)
- __field(enum req_op, mode)
+ __field(int, mode)
),
TP_fast_assign(
--
2.34.1
next prev parent reply other threads:[~2024-04-30 8:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 8:00 [PATCH -mm 0/2] nilfs2: reduce build warnings with "make C=1" Ryusuke Konishi
2024-04-30 8:00 ` Ryusuke Konishi [this message]
2024-05-01 14:42 ` [PATCH -mm 1/2] nilfs2: use integer type instead of enum req_op for event tracing header Bart Van Assche
2024-05-01 15:30 ` Ryusuke Konishi
2024-05-02 19:01 ` Ryusuke Konishi
2024-05-05 12:47 ` Bart Van Assche
2024-05-05 19:04 ` Ryusuke Konishi
2024-05-06 17:26 ` Bart Van Assche
2024-05-06 21:17 ` Ryusuke Konishi
2024-04-30 8:00 ` [PATCH -mm 2/2] nilfs2: make superblock data array index computation sparse friendly Ryusuke Konishi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240430080019.4242-2-konishi.ryusuke@gmail.com \
--to=konishi.ryusuke@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nilfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).