Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1941389ybv; Thu, 6 Feb 2020 12:43:28 -0800 (PST) X-Google-Smtp-Source: APXvYqxLqTYMKes2SAhqc+KUYp/HqNF984+kAdl2wSHuv07AUEvjq0YEyCvFRhx0cLaU5tctFwpz X-Received: by 2002:a9d:7315:: with SMTP id e21mr33637567otk.255.1581021808451; Thu, 06 Feb 2020 12:43:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581021808; cv=none; d=google.com; s=arc-20160816; b=l02X2AaG8h1F6DSrHLoLIkeVv1VlalxtDR+BqHS2UYVNSf0eIeZiitylSKn62dAwq9 Rk+Km6YfBFcM0OLgs2te5xjjBzdCjqFBp19h0KRPZjR3Q2urLjOFVfkvN1mKZoICNlrl SkvPWEhn6ZSaYyiA4Gmml6ovKgb9UjP8REnLTeJb+JlKe5RNahe1pgyeYmbVReP7XCrY T/2SlZGAFNLP3hns2w6azxHNRtVpMsdCvnjuhgubDPf0GDkhQ1EOUumrm4O5QB4FMWDr FA5hbgkPfh/1Eq9IEIBA8WTzrckGQ5tVVAMXW2EL3UCv2XBnAZgIMqwlXHXeDvRPED0D 4jhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=hSKAPXuw/qdxw9inxEswmgHt8h2yXurDtN2Z4Xr63Z0=; b=FsXRK2CQTi3Z9ug8GchDaQ/VQdF904ALR3amMe6/4zt5XCEBZRGfI+7eOhPlRiuGPa Ma0jF4miCNSWpcok+qJZPlBpdsq0kWnpRTQd/1VI24KiP/Ec269T6YVGh/btrVTADutu xxuySfTAFh8RVbVv8ujBLx837ZmDwf87SZoOQqcmXHPuZ6bN17wDpfdHiZXLix/br/XR wHhdZqwI4c44EcxARFxczCwwbG82Arz2zcvn3xSQ28oT7EFmc+oyCgB09yPU90HV565Y fm64lxSqF+37ukpvh7hFaJCiE0slfuQlEtsg4wu2jdVjuP5Z0+exoCl7Iu3HH2E/hZHv 57Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=vrehnZkf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p16si403468oto.287.2020.02.06.12.43.15; Thu, 06 Feb 2020 12:43:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=vrehnZkf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727851AbgBFUmT (ORCPT + 99 others); Thu, 6 Feb 2020 15:42:19 -0500 Received: from mail-il1-f194.google.com ([209.85.166.194]:45931 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727526AbgBFUmT (ORCPT ); Thu, 6 Feb 2020 15:42:19 -0500 Received: by mail-il1-f194.google.com with SMTP id p8so6358065iln.12 for ; Thu, 06 Feb 2020 12:42:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=hSKAPXuw/qdxw9inxEswmgHt8h2yXurDtN2Z4Xr63Z0=; b=vrehnZkfqdhinR2vRNC3Cj7Yx65Lc6yH5V7n3a268mzPSpu0KywkM/5TyaQu3C9Hrk Kk3c8M67vgErRSUXFhgzJ7YFH9GcPj2xQ7Hfjd5Gr0SsDpTw/AOOIEDSUBbpoMeJhfTZ YIX/zm6EoV6aVw/2C9ETCyq2HOsUmMfOBDg4ivf0VLUKojXXKX8U7J7fl7vY1yDrwh/5 YjGFywENwJ82kNXN2utfVKGhFF2BXVxQDocn4szgvA9zSm3wdTMJb4GrE7KcyN8+7Ym0 IiRY2AFpJqDJra4Kc7qqXJoGlssEFa3dbnxiVYeau70ZJufKogA5XV/L1F48fh8xJSeJ JN8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hSKAPXuw/qdxw9inxEswmgHt8h2yXurDtN2Z4Xr63Z0=; b=q6GbOymMBmqtvHfSPeApWfPKgJdad/gyTTT4t/g8uSgS9I/5a0dxK2kS7b+RQpRjXf VXA2HMUmu5T6JvGqvy7VpIW7p9oBKYfdmBpfqagOSEHLmLgvDndCEw82/y8AQoPqgIsv UWU9Eh+wHGNUEKYYZBMFyY/9ZZo2Qk6zOIf8dB4XUGq8jp8bOErSOneWl/Yg6B49xplV RXH2YllW6v3DOvz/C2dBUPtCvejks6ReDjj9O6/A3k/tcuwznCbxPShE3QKQxUKWaQtB qDlcjshzsIdjzjBIjJF1ERQwYy3bFLX0ts1oazgScsk8untqPN+Br9UAFr/sQSWIuTsj Dluw== X-Gm-Message-State: APjAAAVm1Yq59xz7vmYDQae0UrSGEw+tHk7SWGDihz8iN2RwJ1spLorN M1zCkoZ0pGur+roadU91kXcgLQ== X-Received: by 2002:a05:6e02:e06:: with SMTP id a6mr5715310ilk.88.1581021738435; Thu, 06 Feb 2020 12:42:18 -0800 (PST) Received: from [192.168.1.159] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id k129sm190195iof.82.2020.02.06.12.42.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Feb 2020 12:42:18 -0800 (PST) Subject: Re: [PATCH] io_uring: fix 1-bit bitfields to be unsigned To: Randy Dunlap , LKML , io-uring@vger.kernel.org References: <3917704d-2149-881c-f9e5-2a7764dccd3f@infradead.org> From: Jens Axboe Message-ID: Date: Thu, 6 Feb 2020 13:42:17 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <3917704d-2149-881c-f9e5-2a7764dccd3f@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/5/20 9:57 PM, Randy Dunlap wrote: > From: Randy Dunlap > > 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