lkml.org 
[lkml]   [2020]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] io_uring: fix 1-bit bitfields to be unsigned
From
Date
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

\
 
 \ /
  Last update: 2020-02-06 21:43    [W:0.175 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site