Re: [git pull] vfs.git part 3
From: Al Viro
Date: Thu Jul 06 2017 - 15:11:52 EST
On Thu, Jul 06, 2017 at 06:58:37PM +0200, Christoph Hellwig wrote:
> On Thu, Jul 06, 2017 at 04:51:13PM +0100, Al Viro wrote:
> > On Thu, Jul 06, 2017 at 04:46:02PM +0100, Al Viro wrote:
> >
> > > That - on #work.read_write, as in vfs.git at the moment...
> >
> > ... and for COMPAT_SYSCALL you need
> > #define __SC_DELOUSE(t,v) ((__force t)(unsigned long)(v))
> > in linux/compat.h
>
> I'm still getting warnings with both these force casts. This is
> the current stack:
That + Linus' tree as of the end of yesterday =>
CHECK fs/read_write.c
fs/read_write.c:38:29: warning: incorrect type in return expression (different base types)
fs/read_write.c:38:29: expected int
fs/read_write.c:38:29: got restricted fmode_t
fs/read_write.c:38:29: warning: incorrect type in return expression (different base types)
fs/read_write.c:38:29: expected int
fs/read_write.c:38:29: got restricted fmode_t
fs/read_write.c:38:29: warning: incorrect type in return expression (different base types)
fs/read_write.c:38:29: expected int
fs/read_write.c:38:29: got restricted fmode_t
fs/read_write.c:38:29: warning: incorrect type in return expression (different base types)
fs/read_write.c:38:29: expected int
fs/read_write.c:38:29: got restricted fmode_t
All of which are from unsigned_offsets() and that's one case where bool would be better than
int. Switching the return type to bool yields
CHECK fs/read_write.c
CC fs/read_write.o
- no warnings at all.
Which sparse version are you using and what's your .config?