All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Phong Tran <tranmanphong@gmail.com>
Cc: ndesaulniers@google.com, natechancellor@gmail.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	clang-built-linux@googlegroups.com
Subject: Re: [PATCH] power: supply: core: fix clang -Wunsequenced
Date: Thu, 2 May 2019 22:15:54 +0200	[thread overview]
Message-ID: <20190502201554.qvuunxprepxhvzbm@earth.universe> (raw)
In-Reply-To: <20190502012704.12505-1-tranmanphong@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1387 bytes --]

Hi,

On Thu, May 02, 2019 at 08:27:06AM +0700, Phong Tran wrote:
> 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>
> ---

Thanks, queued to power-supply's for-next branch.

-- Sebastian

>  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
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2019-05-02 20:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02  1:27 [PATCH] power: supply: core: fix clang -Wunsequenced Phong Tran
2019-05-02 18:00 ` Nick Desaulniers
2019-05-02 20:15 ` Sebastian Reichel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190502201554.qvuunxprepxhvzbm@earth.universe \
    --to=sebastian.reichel@collabora.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=tranmanphong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.