staging: lustre: cleanup le32 assignment to ldp_flags
authorValentin Vidic <Valentin.Vidic@CARNet.hr>
Fri, 5 May 2017 05:27:41 +0000 (07:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Jun 2017 08:32:41 +0000 (17:32 +0900)
Introduces a local var to collect flags and convert
them to le32.

Fixes the following sparse warnings:

drivers/staging/lustre/lustre/lmv/lmv_obd.c:2305:23: warning: invalid assignment: |=
drivers/staging/lustre/lustre/lmv/lmv_obd.c:2305:23:    left side has type restricted __le32
drivers/staging/lustre/lustre/lmv/lmv_obd.c:2305:23:    right side has type int
drivers/staging/lustre/lustre/lmv/lmv_obd.c:2383:39: warning: invalid assignment: |=
drivers/staging/lustre/lustre/lmv/lmv_obd.c:2383:39:    left side has type restricted __le32
drivers/staging/lustre/lustre/lmv/lmv_obd.c:2383:39:    right side has type int

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/lmv/lmv_obd.c

index aaff986f928728f8a06c1e1a529ae4b19b3cfc68..b222dfa11a10c8f4922c8d7dc2990430f02978e7 100644 (file)
@@ -2274,6 +2274,7 @@ static int lmv_read_striped_page(struct obd_export *exp,
        struct lu_fid master_fid = op_data->op_fid1;
        struct obd_device *obd = exp->exp_obd;
        __u64 hash_offset = offset;
+       __u32 ldp_flags;
        struct page *min_ent_page = NULL;
        struct page *ent_page = NULL;
        struct lu_dirent *min_ent = NULL;
@@ -2301,7 +2302,7 @@ static int lmv_read_striped_page(struct obd_export *exp,
        dp = kmap(ent_page);
        memset(dp, 0, sizeof(*dp));
        dp->ldp_hash_start = cpu_to_le64(offset);
-       dp->ldp_flags |= LDF_COLLIDE;
+       ldp_flags = LDF_COLLIDE;
 
        area = dp + 1;
        left_bytes = PAGE_SIZE - sizeof(*dp);
@@ -2379,8 +2380,8 @@ out:
                ent_page = NULL;
        } else {
                if (ent == area)
-                       dp->ldp_flags |= LDF_EMPTY;
-               dp->ldp_flags = cpu_to_le32(dp->ldp_flags);
+                       ldp_flags |= LDF_EMPTY;
+               dp->ldp_flags |= cpu_to_le32(ldp_flags);
                dp->ldp_hash_end = cpu_to_le64(hash_offset);
        }