[PATCH] staging: lustre: mdc: use __FMODE_EXEC macro

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

 



FMODE_EXEC is type fmode_t but is used in operations
with integers which leads to sparse warnings:
drivers/staging/lustre/lustre/mdc/mdc_lib.c:198:21: warning: restricted fmode_t degrades to integer
drivers/staging/lustre/lustre/mdc/mdc_locks.c:300:49: warning: restricted fmode_t degrades to integer

Fix by using __FMODE_EXEC macro defined in fs.h.

Note the same warnings occurs with other fmode flags
here but they don't have a corresponding int macro.

Signed-off-by: Juston Li <juston.h.li@xxxxxxxxx>
---
 drivers/staging/lustre/lustre/mdc/mdc_lib.c   | 4 ++--
 drivers/staging/lustre/lustre/mdc/mdc_locks.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index e8732cc..34c9a86 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -194,8 +194,8 @@ static __u64 mds_pack_open_flags(__u64 flags, __u32 mode)
 		cr_flags |= MDS_OPEN_SYNC;
 	if (flags & O_DIRECTORY)
 		cr_flags |= MDS_OPEN_DIRECTORY;
-#ifdef FMODE_EXEC
-	if (flags & FMODE_EXEC)
+#ifdef __FMODE_EXEC
+	if (flags & __FMODE_EXEC)
 		cr_flags |= MDS_FMODE_EXEC;
 #endif
 	if (cl_is_lov_delay_create(flags))
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index b58147e..c05afa8 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -296,8 +296,8 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp,
 		} else {
 			if (it->it_flags & (FMODE_WRITE|MDS_OPEN_TRUNC))
 				mode = LCK_CW;
-#ifdef FMODE_EXEC
-			else if (it->it_flags & FMODE_EXEC)
+#ifdef __FMODE_EXEC
+			else if (it->it_flags & __FMODE_EXEC)
 				mode = LCK_PR;
 #endif
 			else
-- 
2.1.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux