]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
power: supply: core: fix clang -Wunsequenced
authorPhong Tran <tranmanphong@gmail.com>
Thu, 2 May 2019 01:27:06 +0000 (08:27 +0700)
committerSebastian Reichel <sre@kernel.org>
Thu, 2 May 2019 20:10:46 +0000 (22:10 +0200)
The increment operator of  pointer in be32_to_cpu() is not explicitly.
It made the warning from clang:

drivers/power/supply/power_supply_core.c:674:36: error: multiple
unsequenced modifications to 'list' [-Werror,-Wunsequenced]
drivers/power/supply/power_supply_core.c:675:41: error: multiple
unsequenced modifications to 'list' [-Werror,-Wunsequenced]

Link: https://github.com/ClangBuiltLinux/linux/issues/460
Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/power_supply_core.c

index 874495c6faceb595df2881896020329e84b43455..f7033ecf6d0b71549a424f1c667e39e31107dff4 100644 (file)
@@ -671,8 +671,10 @@ int power_supply_get_battery_info(struct power_supply *psy,
                }
 
                for (i = 0; i < tab_len; i++) {
-                       table[i].ocv = be32_to_cpu(*list++);
-                       table[i].capacity = be32_to_cpu(*list++);
+                       table[i].ocv = be32_to_cpu(*list);
+                       list++;
+                       table[i].capacity = be32_to_cpu(*list);
+                       list++;
                }
        }