]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu-cputype.c: assign value to multiple variables (ar->bit32 and ar->bit64)
authorrilysh <nightquick@proton.me>
Wed, 6 Dec 2023 05:21:27 +0000 (00:21 -0500)
committerrilysh <nightquick@proton.me>
Wed, 6 Dec 2023 05:21:27 +0000 (00:21 -0500)
clang with -Wcomma will emit an warning of "misuse of comma operator".
Since the value that will be assigned, is the same for both (bit32 and bit64),
just assigning directly to both variables seems reasonable.

Signed-off-by: rilysh <nightquick@proton.me>
sys-utils/lscpu-cputype.c

index 6111f012ab37cfc29ce748504fe255a1848ec645..5063be43bb0823fab62d3dd526fdc2553344eb93 100644 (file)
@@ -643,11 +643,11 @@ struct lscpu_arch *lscpu_read_architecture(struct lscpu_cxt *cxt)
 
                snprintf(buf, sizeof(buf), " %s ", ct->flags);
                if (strstr(buf, " lm "))
-                       ar->bit32 = 1, ar->bit64 = 1;                   /* x86_64 */
+                       ar->bit32 = ar->bit64 = 1;                      /* x86_64 */
                if (strstr(buf, " zarch "))
-                       ar->bit32 = 1, ar->bit64 = 1;                   /* s390x */
+                       ar->bit32 = ar->bit64 = 1;                      /* s390x */
                if (strstr(buf, " sun4v ") || strstr(buf, " sun4u "))
-                       ar->bit32 = 1, ar->bit64 = 1;                   /* sparc64 */
+                       ar->bit32 = ar->bit64 = 1;                      /* sparc64 */
        }
 
        if (ct && ct->isa) {