public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Christoph Hellwig <hch@lst.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [git pull] vfs.git part 3
Date: Fri, 7 Jul 2017 00:27:49 +0100	[thread overview]
Message-ID: <20170706232749.GB10672@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20170706214449.GA9485@lst.de>

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.

  reply	other threads:[~2017-07-06 23:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05  7:14 [git pull] vfs.git part 3 Al Viro
2017-07-05 21:51 ` Linus Torvalds
2017-07-05 22:38   ` Al Viro
2017-07-05 22:52     ` Christoph Hellwig
2017-07-05 23:29       ` Al Viro
2017-07-06 14:48         ` Christoph Hellwig
2017-07-06 15:03           ` Al Viro
2017-07-06 15:06             ` Christoph Hellwig
2017-07-06 15:10             ` Christoph Hellwig
2017-07-06 15:46               ` Al Viro
2017-07-06 15:51                 ` Al Viro
2017-07-06 16:58                   ` Christoph Hellwig
2017-07-06 19:11                     ` Al Viro
2017-07-06 21:44                       ` Christoph Hellwig
2017-07-06 23:27                         ` Al Viro [this message]
2017-07-07 14:00                           ` Christoph Hellwig
2017-07-07 15:48                             ` Linus Torvalds
2017-07-07 19:42                               ` Christopher Li
2017-07-08 16:24                             ` Al Viro
2017-07-18  1:36     ` [RFC] ->poll() sparse annotations Al Viro
  -- strict thread matches above, loose matches on Subject: below --
2013-07-08 10:07 [git pull] vfs.git, part 3 Al Viro

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=20170706232749.GB10672@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox