Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6702186yba; Wed, 1 May 2019 18:29:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrSfL6XIuUep0hz+eR+jC42iMbPYzEC2fu50yg4sD0EfzcURtRFNum3ZoJJBj11jvfcaJm X-Received: by 2002:a17:902:9a07:: with SMTP id v7mr733061plp.291.1556760592869; Wed, 01 May 2019 18:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556760592; cv=none; d=google.com; s=arc-20160816; b=vMMsiWG8qNsk+6+QBkjPp39NGWybzLLzdGGYAQwWUScaIHI7r/5QiMFdzB89c3HL1A D6/o9vHYcF7bbhzFXt7D55+P1+p5zGX7F9TW4G8FIrDs+OXtS3SFfK4nvsOIUIo6xL43 emDMLG8mz2ZOww7Mer5J5lneZmA6Gvy58FQgKJO3W3z7xhN0LZzXO3QRienx0mSSsmDE 1xn6oBBjAFlMzy2E2ucr7QoFbMFaxN7XTIEJ13Pp/8YnrtOhITTtwox7d01b2niQoEjU I4JlT6dEUGBr1NyszgH8lk3Go0pn98dO+YY71zRec/uNF21VK1Ii2nynAYEL3ds5NI1C G7Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=phRIMmYflgZfcBCKyZBekM9N7nqlxyMrFktT8H7bj/g=; b=ch8POu7poqu+LdimQwQiaKwUN7RcVUz4/9yatvoBfoaFn+faQs5Ol6O4Mq10SlAjS4 qJs8miFq2IG2txESY5zw+d2TpL0yna4UYIvhYzokwxgQzM/559ABPwLbw3f7n4YMIbso 5DDgeoBHAmTxlXI/cI51SkzVu1F3szU+mRN8xZbSx3BXmoASjNpmdFG54nlJwiJLwYYS 1fin/fs/kY3v2QYUs6n+kQfPyRng+kGdbdTIjJqnu1KY7YotGw24CFxEmk7t7qo0d2Gu pCmYbu1fCuahMTQ7Gu0qPDaa4ShUk/atzawXiMeV5Sc4jMqpZQ6AcDveIyfTTIbKH9QM r00g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SRcsMvPF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31si31418511plj.417.2019.05.01.18.29.37; Wed, 01 May 2019 18:29:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SRcsMvPF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726267AbfEBB2Q (ORCPT + 99 others); Wed, 1 May 2019 21:28:16 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:38473 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726166AbfEBB2Q (ORCPT ); Wed, 1 May 2019 21:28:16 -0400 Received: by mail-pf1-f196.google.com with SMTP id 10so296956pfo.5; Wed, 01 May 2019 18:28:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=phRIMmYflgZfcBCKyZBekM9N7nqlxyMrFktT8H7bj/g=; b=SRcsMvPFbeG5f/i+HYue0NAlkY4H5dDGVbVQkIo3G55R9KKkMvE18oZxLPAquZQciy 0Bv1RdCGvWkFAhCIAZxcn8r7rdo9m96MgyH4IsRViBCYRxy6QrgbdtDigY71CsBxUzPw wNRunHxztue++rSq52ob9QMRs1Uc3ojskKt5+ul2uYX/7VxfEotopbOrRRnRxlky79l0 H60lK6QYozS7Y9DTq047UQ/bqCZ1bmKnKXTOA90Sy4qH5pdyjHyrZaUFsOYtqAZBOlQg IuGAJa1Jf2yTjQTetIsFkZTSbJI8e//6QEbuY2BJBGbZWtbJDdTZF9N4EuMcgtww1yrv AlZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=phRIMmYflgZfcBCKyZBekM9N7nqlxyMrFktT8H7bj/g=; b=A6QQiSyN/AI1cIlZetTTG33GSBo2Qelc0694A+geIjCf2kSrJYdGIaImjIy/L1U62c bUNqg+OEMi3KYwFBX0sadK8GnFOZ25g9lSqegJTURd4hCrG7KcfM8VtDSB22Z8xoRndn Va+dljOgH6nAH6V7CHjpJG7O0IDA80cGrdv7iMXz5B8XhLcOctaoRx649kx4ARHKfYco wwSNfTdXy3SpXX1t2uvBb8vLYxwRbtHnvjBntH82MrOvisDlGbgHem5315JGA8O+jor2 gZP8R0djlGCwSqu01/DLpMsxEh8rXAYEIPMOPNByZ3D4f8WaJWgBQdtqWUYN3ZQoR1Hb EjuA== X-Gm-Message-State: APjAAAUOGtAm8UjKs0uFdQz0IbDudIlGg/eK6kZ+oZJhv56bQZ/pIqFb gtZPwiffTNhopmXb0+2WLGY= X-Received: by 2002:aa7:928b:: with SMTP id j11mr1111291pfa.200.1556760495454; Wed, 01 May 2019 18:28:15 -0700 (PDT) Received: from debian.net.fpt ([42.114.18.133]) by smtp.gmail.com with ESMTPSA id 10sm53728342pfh.14.2019.05.01.18.28.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 May 2019 18:28:14 -0700 (PDT) From: Phong Tran To: sre@kernel.org Cc: ndesaulniers@google.com, natechancellor@gmail.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Phong Tran Subject: [PATCH] power: supply: core: fix clang -Wunsequenced Date: Thu, 2 May 2019 08:27:06 +0700 Message-Id: <20190502012704.12505-1-tranmanphong@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/power/supply/power_supply_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index c917a8b43b2b..7cc6f5fac0d0 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -665,8 +665,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++; } } -- 2.21.0