Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1682808

Re: [git pull] vfs.git part 3

From Al Viro <viro@ZenIV.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [git pull] vfs.git part 3
Date 2017-07-07 01:30 +0200
Message-ID <u0onD-3Tn-3@gated-at.bofh.it> (permalink)
References (5 earlier) <u0hct-7dv-17@gated-at.bofh.it> <u0hm9-7mU-15@gated-at.bofh.it> <u0iid-87X-5@gated-at.bofh.it> <u0ktH-1dP-1@gated-at.bofh.it> <u0mOS-2P4-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-05 09:20 +0200
  Re: [git pull] vfs.git part 3 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-06 00:00 +0200
    Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 00:40 +0200
      Re: [git pull] vfs.git part 3 Christoph Hellwig <hch@lst.de> - 2017-07-06 01:00 +0200
        Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 01:30 +0200
          Re: [git pull] vfs.git part 3 Christoph Hellwig <hch@lst.de> - 2017-07-06 16:50 +0200
            Re: [git pull] vfs.git part 3 Christoph Hellwig <hch@lst.de> - 2017-07-06 17:10 +0200
            Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 17:10 +0200
              Re: [git pull] vfs.git part 3 Christoph Hellwig <hch@lst.de> - 2017-07-06 17:20 +0200
                Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 17:50 +0200
                Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 18:00 +0200
                Re: [git pull] vfs.git part 3 Christoph Hellwig <hch@lst.de> - 2017-07-06 19:00 +0200
                Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 21:20 +0200
                Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-07 01:30 +0200
                Re: [git pull] vfs.git part 3 Christoph Hellwig <hch@lst.de> - 2017-07-07 16:10 +0200
                Re: [git pull] vfs.git part 3 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-07 17:50 +0200
                Re: [git pull] vfs.git part 3 Christopher Li <sparse@chrisli.org> - 2017-07-07 21:50 +0200
                Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-08 18:30 +0200
      [RFC] ->poll() sparse annotations Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-18 03:40 +0200

csiph-web