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
Unified · Split
| @@ -671,8 +671,10 @@ int power_supply_get_battery_info(struct power_supply *psy, · 670 unmodified lines | ||
| 671 | 671 | } |
| 672 | 672 | |
| 673 | 673 | for (i = 0; i < tab_len; i++) { |
| 674 | − table[i].ocv = be32_to_cpu(*list++); | |
| 675 | − table[i].capacity = be32_to_cpu(*list++); | |
| 674 | + table[i].ocv = be32_to_cpu(*list); | |
| 675 | + list++; | |
| 676 | + table[i].capacity = be32_to_cpu(*list); | |
| 677 | + list++; | |
| 676 | 678 | } |
| 677 | 679 | } |
| 678 | 680 | |