From: Jeff Layton <jlayton@redhat.com>
To: "Steve French" <smfrench@gmail.com>
Cc: "Dave Kleikamp" <shaggy@linux.vnet.ibm.com>,
"Shirish Pargaonkar" <shirishpargaonkar@gmail.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: Fixing fmode_t warnings
Date: Tue, 18 Nov 2008 12:03:02 -0500 [thread overview]
Message-ID: <20081118120302.7b08bacf@tleilax.poochiereds.net> (raw)
In-Reply-To: <524f69650811180841v135a3d15o702766c703b4be22@mail.gmail.com>
On Tue, 18 Nov 2008 10:41:17 -0600
"Steve French" <smfrench@gmail.com> 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.
--
Jeff Layton <jlayton@redhat.com>
next prev parent reply other threads:[~2008-11-18 17:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-18 16:41 Fixing fmode_t warnings Steve French
2008-11-18 16:49 ` Steve French
2008-11-18 17:00 ` Al Viro
2008-11-18 17:03 ` Jeff Layton [this message]
2008-11-18 17:12 ` Dave Kleikamp
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=20081118120302.7b08bacf@tleilax.poochiereds.net \
--to=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=shaggy@linux.vnet.ibm.com \
--cc=shirishpargaonkar@gmail.com \
--cc=smfrench@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.