IO-Uring Archive on lore.kernel.org
 help / color / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Randy Dunlap <rdunlap@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	io-uring@vger.kernel.org
Subject: Re: [PATCH] io_uring: fix 1-bit bitfields to be unsigned
Date: Thu, 6 Feb 2020 13:42:17 -0700
Message-ID: <ed4cfaad-d6b3-3add-a329-0b574b8fe380@kernel.dk> (raw)
In-Reply-To: <3917704d-2149-881c-f9e5-2a7764dccd3f@infradead.org>

On 2/5/20 9:57 PM, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Make bitfields of size 1 bit be unsigned (since there is no room
> for the sign bit).
> This clears up the sparse warnings:
> 
>   CHECK   ../fs/io_uring.c
> ../fs/io_uring.c:207:50: error: dubious one-bit signed bitfield
> ../fs/io_uring.c:208:55: error: dubious one-bit signed bitfield
> ../fs/io_uring.c:209:63: error: dubious one-bit signed bitfield
> ../fs/io_uring.c:210:54: error: dubious one-bit signed bitfield
> ../fs/io_uring.c:211:57: error: dubious one-bit signed bitfield
> 
> Found by sight and then verified with sparse.

Always thought those were pretty silly, it's not like this change is
suddenly going to make:

if (ctx->compat < 0)

be anymore valid (or invalid) than they already are. We also have
cases of:

bool foo:1;

does sparse warn about those?

-- 
Jens Axboe


      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06  4:57 Randy Dunlap
2020-02-06 20:42 ` Jens Axboe [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=ed4cfaad-d6b3-3add-a329-0b574b8fe380@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.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

IO-Uring Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/io-uring/0 io-uring/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 io-uring io-uring/ https://lore.kernel.org/io-uring \
		io-uring@vger.kernel.org
	public-inbox-index io-uring

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.io-uring


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git