Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1089562ybv; Wed, 5 Feb 2020 20:58:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxkcd3WC66MxIU5L82EffwLsFCKlAbpVBOz9gthJ/MUYn6AVReHcfy4jt8bjgi6W1Mw8BE7 X-Received: by 2002:aca:5486:: with SMTP id i128mr5433781oib.12.1580965098698; Wed, 05 Feb 2020 20:58:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580965098; cv=none; d=google.com; s=arc-20160816; b=wSeCOLNCvp2299nB91Wp8ZyM6bwvvp2EL+vnTqhyhkf+wZP9rA+nRW0D1lYKFHGH2n XlqwfnTZpSjjR99+RXo/umlvlyIpvVnF809X6lgBYukyPc7oASlkcdlRpluD0ZWEtv+z 3Edj3K1itGEUZFynlfo1/ML+IHNitpyS6vcJEV3WLhRibogf2h9vuv6BLPr38iDML48O 1P+gfA7Pu5cnLPAEFw3nw32rLyPVYukX9g5rT47sM43LhZoAYvJYUhzG0qoGt0eTNLtb uzIC5MjDp3MgiO8rNAqHPApGPDp8RaqwZKlibG6e3hPEgYOOLhSb0dgDJQ10uW8UKsNa li1A== 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:mime-version:user-agent:date:message-id:subject :from:to:dkim-signature; bh=qCN7yVOVetZZAawoWe0NROxUZNBW+rfsd8LEb6PrkI4=; b=ZhwjuBtA0TPNKwiQqIaXtuz8XiuhpolzIN7OAisYg717PNoksZdGSUtCQkDC9Gtdfj T3rwhQhYNpq3/jAlxWSKJ0UdxDfHAwxryohWH+tYstikL0sbO9XIUeMCjXCJNg0AYqbo 056ZMM3ZH35Egca2tJfd4AzKSeAzztC6/SVZFaJSt0+Itz8+b9108BDPzGBJObx1T1Zp hMHFP9XVT/faC7q03b7rz5GrZzRJs70WyZh9eVdFCmnjRc7YOY9zRZXAXJudoAU3AktH DiGWGONQci8DWX11zP3OZheD5YyDKhsb5naXIvgwEZdK5Cw+x1gXPElatgKNAGbJquQ+ UceA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=i7DoUdgb; 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 l65si1494969oih.23.2020.02.05.20.58.06; Wed, 05 Feb 2020 20:58:18 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=i7DoUdgb; 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 S1727770AbgBFE5O (ORCPT + 99 others); Wed, 5 Feb 2020 23:57:14 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:58646 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727415AbgBFE5N (ORCPT ); Wed, 5 Feb 2020 23:57:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Date:Message-ID:Subject:From:To:Sender:Reply-To:Cc: Content-ID:Content-Description:In-Reply-To:References; bh=qCN7yVOVetZZAawoWe0NROxUZNBW+rfsd8LEb6PrkI4=; b=i7DoUdgbFBRLxlRX6FMRyrGEfM 9L9flbNNuDLXVKSRXJSodSUdUh4FGXlEZiV9/+sxFigRTwAPYKV3rcuIc8JjDL6I59JSvNVI5llHW L0NSnlZMe4YcSiFoL92HhISTTsI4O+zbySXoHzOAcEUYI+uK0okv/M1Me3KGsqRtLO/vm14jqcBXI xgXMjSCmxF9sUuD3sPnFjA4lAJV1ircwrPm+YpRgYwke40tRFokP1YsPa4RRyZbEyJ+mwaw1eKnpI PQ9o7Bq5dDxcWGcqBXwiGqUFKOndZCiM1YywsBeoLzYr9DQkEryb7b63sljYxgRNOXu1mOotBcxIg +FqDqUag==; Received: from [2601:1c0:6280:3f0::19c2] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1izZDz-0000SW-Q9; Thu, 06 Feb 2020 04:57:11 +0000 To: LKML , axboe , io-uring@vger.kernel.org From: Randy Dunlap Subject: [PATCH] io_uring: fix 1-bit bitfields to be unsigned Message-ID: <3917704d-2149-881c-f9e5-2a7764dccd3f@infradead.org> Date: Wed, 5 Feb 2020 20:57:10 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 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 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. Fixes: 69b3e546139a ("io_uring: change io_ring_ctx bool fields into bit fields") Signed-off-by: Randy Dunlap Cc: Jens Axboe Cc: io-uring@vger.kernel.org --- fs/io_uring.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- linux-next-20200205.orig/fs/io_uring.c +++ linux-next-20200205/fs/io_uring.c @@ -204,11 +204,11 @@ struct io_ring_ctx { struct { unsigned int flags; - int compat: 1; - int account_mem: 1; - int cq_overflow_flushed: 1; - int drain_next: 1; - int eventfd_async: 1; + unsigned int compat: 1; + unsigned int account_mem: 1; + unsigned int cq_overflow_flushed: 1; + unsigned int drain_next: 1; + unsigned int eventfd_async: 1; /* * Ring buffer of indices into array of io_uring_sqe, which is