Re: Fixing fmode_t warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2008-11-18 at 12:03 -0500, Jeff Layton wrote:
> On Tue, 18 Nov 2008 10:41:17 -0600
> "Steve French" <smfrench@xxxxxxxxx> wrote:
> 
> > Do you think it is worthwhile fixing this "sparse" warning ?  oflags
> > is an int since the lookup intent open.flags is an int ...
> > 
> > CHECK   fs/cifs/dir.c
> > fs/cifs/dir.c:169:16: warning: restricted fmode_t degrades to integer
> > fs/cifs/dir.c:171:16: warning: restricted fmode_t degrades to integer
> > 
> >                 int oflags = nd->intent.open.flags;
> >                 desiredAccess = 0;
> > (line 169) if (oflags & FMODE_READ)
> >                         desiredAccess |= GENERIC_READ;
> > (line 171) if (oflags & FMODE_WRITE) {
> > 
> > 
> 
> In general, I'm for fixing most warnings unless there is a good reason
> not to. When things compile and checkers run cleanly it can really help
> you to detect bugs...
> 
> My suggestion would be to go ahead and make oflags a fmode_t and just
> cast the intent.open.flags to fmode_t.

I agree with Al that mixing O_* flags and FMODE_* flags in the same
field is broken.  I'd just as well leave the warning until a real
cleanup can separate the two.  There are other places that simply
changing the type isn't going to work.
-- 
David Kleikamp
IBM Linux Technology Center

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux