staging: erofs: unzip_vle.c: Constant in comparison on right side
authorCristian Sicilia <sicilia.cristian@gmail.com>
Mon, 12 Nov 2018 20:43:58 +0000 (21:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Nov 2018 09:59:31 +0000 (10:59 +0100)
Comparisons should place the constant
on the right side of the test.

Signed-off-by: Cristian Sicilia <sicilia.cristian@gmail.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/unzip_vle.c

index 1ffeeaa6e976c5d7e99c7f20a6b718f7159a6298..35add4eb3057e13437c9dfbe3f7d65395b939077 100644 (file)
@@ -250,8 +250,8 @@ static inline bool try_to_claim_workgroup(
 retry:
        if (grp->next == Z_EROFS_VLE_WORKGRP_NIL) {
                /* type 1, nil workgroup */
-               if (Z_EROFS_VLE_WORKGRP_NIL != cmpxchg(&grp->next,
-                       Z_EROFS_VLE_WORKGRP_NIL, *owned_head))
+               if (cmpxchg(&grp->next, Z_EROFS_VLE_WORKGRP_NIL,
+                           *owned_head) != Z_EROFS_VLE_WORKGRP_NIL)
                        goto retry;
 
                *owned_head = grp;
@@ -262,8 +262,8 @@ retry:
                 * be careful that its submission itself is governed
                 * by the original owned chain.
                 */
-               if (Z_EROFS_VLE_WORKGRP_TAIL != cmpxchg(&grp->next,
-                       Z_EROFS_VLE_WORKGRP_TAIL, *owned_head))
+               if (cmpxchg(&grp->next, Z_EROFS_VLE_WORKGRP_TAIL,
+                           *owned_head) != Z_EROFS_VLE_WORKGRP_TAIL)
                        goto retry;
 
                *owned_head = Z_EROFS_VLE_WORKGRP_TAIL;