Move constants to the right of binary operators.
A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
constant c;
expression e;
binary operator b = {==,!=,&,|};
@@
(
- c
+ e
b
- e
+ c
|
- c < e
+ e > c
)
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        int mode;
        int err;
 
-       mode = (0755 & ~current_umask()) | S_IFDIR;
+       mode = (~current_umask() & 0755) | S_IFDIR;
        op_data = ll_prep_md_op_data(NULL, dir, NULL, filename,
                                     strlen(filename), mode, LUSTRE_OPC_MKDIR,
                                     lump);
        /* We don't swab objects for directories */
        switch (le32_to_cpu(lmm->lmm_magic)) {
        case LOV_MAGIC_V1:
-               if (LOV_MAGIC != cpu_to_le32(LOV_MAGIC))
+               if (cpu_to_le32(LOV_MAGIC) != LOV_MAGIC)
                        lustre_swab_lov_user_md_v1((struct lov_user_md_v1 *)lmm);
                break;
        case LOV_MAGIC_V3:
-               if (LOV_MAGIC != cpu_to_le32(LOV_MAGIC))
+               if (cpu_to_le32(LOV_MAGIC) != LOV_MAGIC)
                        lustre_swab_lov_user_md_v3((struct lov_user_md_v3 *)lmm);
                break;
        default:
 
                switch (lmm->lmm_magic) {
                case LOV_USER_MAGIC_V1:
-                       if (LOV_USER_MAGIC_V1 == cpu_to_le32(LOV_USER_MAGIC_V1))
+                       if (cpu_to_le32(LOV_USER_MAGIC_V1) == LOV_USER_MAGIC_V1)
                                break;
                        /* swab objects first so that stripes num will be sane */
                        lustre_swab_lov_user_md_objects(
                        lustre_swab_lov_user_md_v1((struct lov_user_md_v1 *)lmm);
                        break;
                case LOV_USER_MAGIC_V3:
-                       if (LOV_USER_MAGIC_V3 == cpu_to_le32(LOV_USER_MAGIC_V3))
+                       if (cpu_to_le32(LOV_USER_MAGIC_V3) == LOV_USER_MAGIC_V3)
                                break;
                        /* swab objects first so that stripes num will be sane */
                        lustre_swab_lov_user_md_objects(
 
                op_data->op_handle = *fh;
        op_data->op_capa1 = ll_mdscapa_get(inode);
 
-       if (LLIF_DATA_MODIFIED & ll_i2info(inode)->lli_flags)
+       if (ll_i2info(inode)->lli_flags & LLIF_DATA_MODIFIED)
                op_data->op_bias |= MDS_DATA_MODIFIED;
 }
 
         * little endian.  We convert it to host endian before
         * passing it to userspace.
         */
-       if (LOV_MAGIC != cpu_to_le32(LOV_MAGIC)) {
+       if (cpu_to_le32(LOV_MAGIC) != LOV_MAGIC) {
                int stripe_count;
 
                stripe_count = le16_to_cpu(lmm->lmm_stripe_count);
        default: {
                int err;
 
-               if (LLIOC_STOP ==
-                    ll_iocontrol_call(inode, file, cmd, arg, &err))
+               if (ll_iocontrol_call(inode, file, cmd, arg, &err) ==
+                    LLIOC_STOP)
                        return err;
 
                return obd_iocontrol(cmd, ll_i2dtexp(inode), 0, NULL,
        fid = &ll_i2info(inode)->lli_fid;
        CDEBUG(D_INFO, "trying to match res "DFID"\n", PFID(fid));
 
-       rc = md_lock_match(ll_i2mdexp(inode), LDLM_FL_BLOCK_GRANTED|flags,
+       rc = md_lock_match(ll_i2mdexp(inode), flags | LDLM_FL_BLOCK_GRANTED,
                           fid, LDLM_IBITS, &policy, mode, lockh);
 
        return rc;
 
        }
 
        /* When called by ll_setattr_raw, file is i1. */
-       if (LLIF_DATA_MODIFIED & ll_i2info(i1)->lli_flags)
+       if (ll_i2info(i1)->lli_flags & LLIF_DATA_MODIFIED)
                op_data->op_bias |= MDS_DATA_MODIFIED;
 
        return op_data;