diff mbox

[OPW,kernel,03/10] staging: lustre: Replace FMODE_EXEC with __FMODE_EXEC

Message ID 8e280908d0a3e91241784f4bb9e5f4e091cf7f19.1383233124.git.dulshani.gunawardhana89@gmail.com
State New, archived
Headers show

Commit Message

Dulshani Gunawardhana Oct. 31, 2013, 3:31 p.m. UTC
Fix the following sparse warning generated by AND-ing FMODE_EXEC with
integer type by defining new macro __FMODE_EXEC.

drivers/staging/lustre/lustre/mdc/mdc_lib.c:196:21: warning: restricted
fmode_t degrades to integer

Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_internal.h | 4 ++++
 drivers/staging/lustre/lustre/mdc/mdc_lib.c          | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

'Greg KH' Oct. 31, 2013, 3:46 p.m. UTC | #1
On Thu, Oct 31, 2013 at 09:01:45PM +0530, Dulshani Gunawardhana wrote:
> Fix the following sparse warning generated by AND-ing FMODE_EXEC with
> integer type by defining new macro __FMODE_EXEC.

Same here, I don't want to create a new macro, it should not be needed.
How does the rest of the kernel deal with this flag?

thanks,

greg k-h
diff mbox

Patch

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index fb7cbb5..2e13ca5 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -51,6 +51,10 @@ 
 #define FMODE_EXEC 0
 #endif
 
+#ifndef __FMODE_EXEC
+#define __FMODE_EXEC ((__force int) FMODE_EXEC)
+#endif
+
 #ifndef VM_FAULT_RETRY
 #define VM_FAULT_RETRY 0
 #endif
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index 29947fd..6d1ed7d4 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -193,7 +193,7 @@  static __u64 mds_pack_open_flags(__u32 flags, __u32 mode)
 	if (flags & O_DIRECTORY)
 		cr_flags |= MDS_OPEN_DIRECTORY;
 #ifdef FMODE_EXEC
-	if (flags & FMODE_EXEC)
+	if (flags & __FMODE_EXEC)
 		cr_flags |= MDS_FMODE_EXEC;
 #endif
 	if (flags & O_LOV_DELAY_CREATE)