Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752987AbdGFX1y (ORCPT ); Thu, 6 Jul 2017 19:27:54 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:36410 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752879AbdGFX1w (ORCPT ); Thu, 6 Jul 2017 19:27:52 -0400 Date: Fri, 7 Jul 2017 00:27:49 +0100 From: Al Viro To: Christoph Hellwig Cc: Linus Torvalds , Linux Kernel Mailing List , linux-fsdevel Subject: Re: [git pull] vfs.git part 3 Message-ID: <20170706232749.GB10672@ZenIV.linux.org.uk> References: <20170705225235.GA11849@lst.de> <20170705232912.GG10672@ZenIV.linux.org.uk> <20170706144840.GA1400@lst.de> <20170706150330.GQ10672@ZenIV.linux.org.uk> <20170706151033.GA1871@lst.de> <20170706154602.GR10672@ZenIV.linux.org.uk> <20170706155113.GS10672@ZenIV.linux.org.uk> <20170706165837.GA4106@lst.de> <20170706191144.GT10672@ZenIV.linux.org.uk> <20170706214449.GA9485@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170706214449.GA9485@lst.de> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 959 Lines: 22 On Thu, Jul 06, 2017 at 11:44:49PM +0200, Christoph Hellwig wrote: > > Which sparse version are you using and what's your .config? > > sparse is v0.5.0-62-gce18a90, .config is attached. Arrgh... OK, I see what's going on. sparse commit affecting that is "Allow casting to a restricted type if !restricted_value"; it allows the things like (__le32)0. It's present in sparse.git, but not in chrisl/sparse.git, which is what you are using. Anyway, the thing I'd missed kernel-side is this: #define __TYPE_IS_L(t) (__same_type((t)0, 0L)) #define __TYPE_IS_UL(t) (__same_type((t)0, 0UL)) #define __TYPE_IS_LL(t) (__same_type((t)0, 0LL) || __same_type((t)0, 0ULL)) Let's turn them into #define __TYPE_AS(t, v) __same_type((__force t)0, v) #define __TYPE_IS_L(t) (__TYPE_AS(t, 0L)) #define __TYPE_IS_UL(t) (__TYPE_AS(t, 0UL)) #define __TYPE_IS_LL(t) (__TYPE_AS(t, 0LL) || __TYPE_AS(t, 0ULL)) That should do it both for old and for new versions of sparse.