[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211109150208.rzzvteprq2tp5biq@wittgenstein>
Date: Tue, 9 Nov 2021 16:02:08 +0100
From: Christian Brauner <christian.brauner@...ntu.com>
To: Anders Roxell <anders.roxell@...aro.org>
Cc: shuah@...nel.org, christian@...uner.io, nathan@...nel.org,
ndesaulniers@...gle.com, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH 2/2] selftests: cgroup: use function 'labs()' over 'abs()'
On Fri, Nov 05, 2021 at 05:25:30PM +0100, Anders Roxell wrote:
> When building selftests/cgroup with clang, the compiler warn about the
> function abs() see below:
>
> In file included from test_memcontrol.c:21:
> ./cgroup_util.h:16:9: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
> return abs(a - b) <= (a + b) / 100 * err;
> ^
> ./cgroup_util.h:16:9: note: use function 'labs' instead
> return abs(a - b) <= (a + b) / 100 * err;
> ^~~
> labs
>
> The note indicates what to do, Rework to use the function 'labs()'.
>
> Signed-off-by: Anders Roxell <anders.roxell@...aro.org>
> ---
Thanks!
Acked-by: Christian Brauner <christian.brauner@...ntu.com>
Powered by blists - more mailing lists