All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org,
	Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	Naohiro Aota <naohiro.aota@wdc.com>,
	Johannes Thumshirn <jth@kernel.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-sparse@vger.kernel.org
Subject: Re: [PATCH 51/51] fs/zonefs: Fix sparse warnings in tracing code
Date: Sun, 26 Jun 2022 18:24:38 +0200	[thread overview]
Message-ID: <20220626162438.3zyjenssj2gxy7b5@mail> (raw)
In-Reply-To: <a206782a-bd90-58cd-1e83-bb5988edb0f9@acm.org>

On Sun, Jun 26, 2022 at 08:42:27AM -0700, Bart Van Assche wrote:
> On 6/26/22 02:58, Luc Van Oostenryck wrote:
> > On Sat, Jun 25, 2022 at 05:44:54PM -0700, Bart Van Assche wrote:
> > > On 6/25/22 02:23, Christoph Hellwig wrote:
> > > > Yeah, that is a bit of a mess.  Rasmus, Steven - any good idea how
> > > > we can make the trace even macros fit for sparse?  Maybe just drop the
> > > > is_signed_type check for __CHECKER__ ?
> > 
> > I would strongly advise against this:
> > -) the macro is sued elsewhere too (for overflow checking)
> > -) sparse wouldn't check anymore the same code as the one seen by the
> >     compiler
> > 
> > What about I would add to sparse something to strip away the bitwise/
> > recover the underlying type? Something like __unbitwiseof() or
> > __underlying_typeof() (some better name is needed)?
> 
> Another question is how to keep the non-sparse build working. Does
> anyone want to comment on the following alternatives or propose another
> alternative?
> 
> (1) sparse implements __strip_bitwise as a macro.
> 
> (in compiler.h)
> 
> #ifndef __strip_bitwise
> #define __strip_bitwise(type) type
> #endif

...

> (1) would work better than (2) for kernel developers who are using a
> version of sparse that does not support __strip_bitwise().

Yes, sure. I was thinking about using (and adding) __has_feature()
but the goal is the same.

[I prefer this because, internally, an operator is needed anyway and
__has_feature() would be more general (but then it would need to be
protected by its own #ifndef __has_feature).]

-- Luc

  reply	other threads:[~2022-06-26 16:24 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 18:04 [PATCH 00/51] Improve static type checking for request flags Bart Van Assche
2022-06-23 18:04 ` [PATCH 01/51] treewide: Rename enum req_opf into enum req_op Bart Van Assche
2022-06-23 18:04 ` [PATCH 02/51] block: Use enum req_op where appropriate Bart Van Assche
2022-06-23 18:04 ` [PATCH 03/51] block: Change the type of the last .rw_page() argument Bart Van Assche
2022-06-23 18:04 ` [PATCH 04/51] block: Change the type of req_op() and bio_op() into enum req_op Bart Van Assche
2022-06-23 18:04 ` [PATCH 05/51] block: Introduce the type blk_opf_t Bart Van Assche
2022-06-23 18:04 ` [PATCH 06/51] block: Use the new blk_opf_t type Bart Van Assche
2022-06-23 18:04 ` [PATCH 07/51] blktrace: " Bart Van Assche
2022-06-23 18:04 ` [PATCH 08/51] blktrace: Trace remap operations correctly Bart Van Assche
2022-06-23 18:04 ` [PATCH 09/51] block/brd: Use the enum req_op type Bart Van Assche
2022-06-23 18:04 ` [PATCH 10/51] block/drbd: Use the enum req_op and blk_opf_t types Bart Van Assche
2022-06-24  5:00   ` Christoph Böhmwalder
2022-06-23 18:04 ` [PATCH 11/51] block/floppy: Fix a sparse warning Bart Van Assche
2022-06-23 18:04 ` [PATCH 12/51] block/null_blk: Fix sparse warnings in tracing code Bart Van Assche
2022-06-23 18:04 ` [PATCH 13/51] um: Use enum req_op where appropriate Bart Van Assche
2022-06-23 18:04 ` [PATCH 14/51] dm/core: Use the enum req_op and blk_opf_t types Bart Van Assche
2022-06-23 18:04 ` [PATCH 15/51] dm/bufio: Change 'int rw' into 'enum req_op op' Bart Van Assche
2022-06-23 18:04 ` [PATCH 16/51] dm/kcopyd: Rename kcopyd_job.rw into kcopyd_job.op Bart Van Assche
2022-06-23 18:04 ` [PATCH 17/51] dm/ebs: Change 'int rw' into 'enum req_op op' Bart Van Assche
2022-06-23 18:04 ` [PATCH 18/51] dm/dm-flakey: Use the new blk_opf_t type Bart Van Assche
2022-06-23 18:04 ` [PATCH 19/51] dm/dm-integrity: Use the enum req_op and blk_opf_t types Bart Van Assche
2022-06-23 18:04 ` [PATCH 20/51] dm/dm-snap: " Bart Van Assche
2022-06-23 18:04 ` [PATCH 21/51] dm/dm-zoned: Use the enum req_op type Bart Van Assche
2022-06-23 22:46   ` Damien Le Moal
2022-06-23 18:04 ` [PATCH 22/51] md/core: Use the enum req_op and blk_opf_t types Bart Van Assche
2022-06-23 18:05 ` [PATCH 23/51] md/bcache: " Bart Van Assche
2022-06-23 18:05 ` [PATCH 24/51] md/raid1: Use the new blk_opf_t type Bart Van Assche
2022-06-23 18:05 ` [PATCH 25/51] md/raid10: " Bart Van Assche
2022-06-23 18:05 ` [PATCH 26/51] md/raid5: Use the enum req_op and blk_opf_t types Bart Van Assche
2022-06-23 18:05 ` [PATCH 27/51] nvme/host: " Bart Van Assche
2022-06-26  9:25   ` Sagi Grimberg
2022-06-23 18:05 ` [PATCH 28/51] nvme/target: Use the new blk_opf_t type Bart Van Assche
2022-06-26  9:25   ` Sagi Grimberg
2022-06-23 18:05 ` [PATCH 29/51] scsi/core: Improve static type checking Bart Van Assche
2022-06-23 18:05 ` [PATCH 30/51] scsi/core: Change the return type of scsi_noretry_cmd() into bool Bart Van Assche
2022-06-23 18:05 ` [PATCH 31/51] scsi/core: Use the new blk_opf_t type Bart Van Assche
2022-06-23 18:05 ` [PATCH 32/51] scsi/device_handlers: " Bart Van Assche
2022-06-23 18:05 ` [PATCH 33/51] scsi/ufs: Rename a 'dir' argument into 'op' Bart Van Assche
2022-06-23 19:09   ` Avri Altman
2022-06-23 18:05 ` [PATCH 34/51] scsi/target: Use the new blk_opf_t type Bart Van Assche
2022-06-23 18:05 ` [PATCH 35/51] mm: " Bart Van Assche
2022-06-23 18:05 ` [PATCH 36/51] fs/buffer: " Bart Van Assche
2022-06-23 18:05 ` [PATCH 37/51] fs/direct-io: Use the enum req_op and blk_opf_t types Bart Van Assche
2022-06-23 18:05 ` [PATCH 38/51] fs/mpage: Use the new blk_opf_t type Bart Van Assche
2022-06-23 18:05 ` [PATCH 39/51] fs/btrfs: Use the enum req_op and blk_opf_t types Bart Van Assche
2022-06-23 18:05 ` [PATCH 40/51] fs/ext4: Use the new blk_opf_t type Bart Van Assche
2022-06-23 18:05 ` [PATCH 41/51] fs/f2fs: Use the enum req_op and blk_opf_t types Bart Van Assche
2022-06-23 18:05 ` [PATCH 42/51] fs/gfs2: " Bart Van Assche
2022-06-23 18:05 ` [PATCH 43/51] fs/hfsplus: " Bart Van Assche
2022-06-23 18:05 ` [PATCH 44/51] fs/iomap: Use the new blk_opf_t type Bart Van Assche
2022-06-23 18:05 ` [PATCH 45/51] fs/jbd2: Fix the documentation of the jbd2_write_superblock() callers Bart Van Assche
2022-06-23 18:05 ` [PATCH 46/51] fs/nilfs: Use the enum req_op and blk_opf_t types Bart Van Assche
2022-06-24  3:43   ` Ryusuke Konishi
2022-06-25  0:02     ` Bart Van Assche
2022-06-25  0:55       ` Ryusuke Konishi
2022-06-23 18:05 ` [PATCH 47/51] fs/ntfs3: Use enum req_op where appropriate Bart Van Assche
2022-06-23 18:05 ` [PATCH 48/51] fs/ocfs2: Use the enum req_op and blk_opf_t types Bart Van Assche
2022-06-24  2:04   ` Joseph Qi
2022-06-23 18:05 ` [PATCH 49/51] PM: " Bart Van Assche
2022-06-27 13:04   ` Rafael J. Wysocki
2022-06-23 18:05 ` [PATCH 50/51] fs/xfs: " Bart Van Assche
2022-06-25  3:23   ` Darrick J. Wong
2022-06-23 18:05 ` [PATCH 51/51] fs/zonefs: Fix sparse warnings in tracing code Bart Van Assche
2022-06-23 22:48   ` Damien Le Moal
2022-06-23 23:19     ` Bart Van Assche
2022-06-24  0:03       ` Damien Le Moal
2022-06-24  4:56   ` Christoph Hellwig
2022-06-24 19:57     ` Bart Van Assche
2022-06-25  9:23       ` Christoph Hellwig
2022-06-26  0:44         ` Bart Van Assche
2022-06-26  9:58           ` Luc Van Oostenryck
2022-06-26 15:42             ` Bart Van Assche
2022-06-26 16:24               ` Luc Van Oostenryck [this message]
2022-06-26 16:33             ` Linus Torvalds
2022-06-26 16:50               ` Linus Torvalds
2022-06-26 20:10                 ` Luc Van Oostenryck
2022-06-26 19:44               ` Luc Van Oostenryck
2022-06-27 19:05               ` [PATCH 0/5] allow -1 and compares in bitwise types Luc Van Oostenryck
2022-06-27 19:05                 ` [PATCH 1/5] bitwise: add testcases Luc Van Oostenryck
2022-06-27 19:05                 ` [PATCH 2/5] bitwise: accept all ones as non-restricted value Luc Van Oostenryck
2022-06-27 23:32                   ` Ramsay Jones
2022-06-27 19:05                 ` [PATCH 3/5] bitwise: allow compares for bitwise types Luc Van Oostenryck
2022-06-27 19:20                   ` Linus Torvalds
2022-06-27 23:34                   ` Ramsay Jones
2022-06-27 19:05                 ` [PATCH 4/5] bitwise: do not remove the signedness of " Luc Van Oostenryck
2022-06-27 19:05                 ` [PATCH 5/5] bitwise: early expansion of simple constants Luc Van Oostenryck
2022-06-27 19:14                 ` [PATCH 0/5] allow -1 and compares in bitwise types Linus Torvalds
2022-06-27 19:15                 ` Bart Van Assche
2022-06-26 19:41         ` [PATCH 51/51] fs/zonefs: Fix sparse warnings in tracing code Steven Rostedt
2022-06-24  5:05 ` [PATCH 00/51] Improve static type checking for request flags Christoph Hellwig
2022-06-24  5:07   ` Christoph Hellwig
2022-06-28 23:10     ` Bart Van Assche
2022-06-28 22:44   ` Bart Van Assche

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=20220626162438.3zyjenssj2gxy7b5@mail \
    --to=luc.vanoostenryck@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=hch@lst.de \
    --cc=jth@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=naohiro.aota@wdc.com \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.