Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Wang Yugui <wangyugui@e16-tech.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: A sparse(make C=1) warning in btrfs about the 'blk_opf_t'
Date: Sun, 14 Aug 2022 00:03:01 +0800	[thread overview]
Message-ID: <20220814000301.7CAD.409509F4@e16-tech.com> (raw)
In-Reply-To: <e129b7aa-9589-242e-b259-298b73382002@acm.org>

Hi,

> On 8/12/22 21:53, Wang Yugui wrote:
> > both '__field(enum req_op,opf)' and '__field(blk_opf_t,opf)' failed to work.
> >
> > ./include/trace/events/btrfs.h:2327:1: warning: incorrect type in assignment (different base types)
> > ./include/trace/events/btrfs.h:2327:1:    expected unsigned int [usertype] opf
> > ./include/trace/events/btrfs.h:2327:1:    got restricted blk_opf_t enum req_op
> >
> > /ssd/git/os/linux-5.19/fs/btrfs/super.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/btrfs.h):
> > ./include/trace/events/btrfs.h:2327:1: warning: cast to restricted blk_opf_t
> > ./include/trace/events/btrfs.h:2327:1: warning: cast to restricted blk_opf_t
> > ./include/trace/events/btrfs.h:2327:1: warning: restricted blk_opf_t degrades to integer
> > ./include/trace/events/btrfs.h:2327:1: warning: restricted blk_opf_t degrades to integer
> 
>  From https://en.wikipedia.org/wiki/Posting_style:
> 
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?

Thanks for the comment.


> Regarding the warnings reported above: please apply patch "[PATCH] tracing: Suppress sparse warnings triggered by is_signed_type()" before testing my patch.
> 
> Thanks,
> 
> Bart.

After applied patch "[PATCH] tracing: Suppress sparse warnings triggered
by is_signed_type()",  both '__field(enum req_op,opf)' and 
'__field(blk_opf_t,opf)' work well without sparse warning(make C=1).

Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2022/08/13



      reply	other threads:[~2022-08-13 16:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-13  0:00 A sparse(make C=1) warning in btrfs about the 'blk_opf_t' Wang Yugui
2022-08-13  0:22 ` Bart Van Assche
2022-08-13  1:13   ` Wang Yugui
2022-08-13  3:02     ` Bart Van Assche
2022-08-13  4:53       ` Wang Yugui
2022-08-13 15:25         ` Bart Van Assche
2022-08-13 16:03           ` Wang Yugui [this message]

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=20220814000301.7CAD.409509F4@e16-tech.com \
    --to=wangyugui@e16-tech.com \
    --cc=bvanassche@acm.org \
    --cc=linux-btrfs@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