Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp600202pxh; Tue, 9 Nov 2021 15:59:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxO4Pt03CQoRwGACqCkgS+uXGUvroShkyTaAKD8ZMPpJCDD5qpYbdLm8Ga66Mvr+9RX8fIb X-Received: by 2002:a92:9513:: with SMTP id y19mr8034491ilh.300.1636502370724; Tue, 09 Nov 2021 15:59:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636502370; cv=none; d=google.com; s=arc-20160816; b=D9iss6H89KTeRgR+1nec6s5/sPUD+SUqLPEKuAkgJDrSQCagZqeIS1CZlx3+QzIf3O rupyfAUIiHSJyxDfXnz4VTzI6kJAt7X/mlg0KUBcq86M3hUxV66G3JUaX8c0IZZbvlaF WJdz8zwzz/QQe8Es+zCRiZljD/w/f5tgDRg/JSpxBbrNcp61WyEd2brJQuGiKNBZcV1c nT7MOA5sDOET38mO4aumhDq1RPjfCGJ1yCn65KIsudROiPxAVauNozMRVDa6oIlZy+oz cqHjO/hZhJ3b9UHnHmzGrMm4tKvpuwHhZnKcCy6M9/t9lsut4vuNqUpjT0P9wg19KDWV nNYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=QWZbYImksIzv02TaTcSoeL2AH9p1KuQzc9zOf9HRLjE=; b=EHqI4dmhgLjNvBO51nAfTujrSt942PMnsc4zswsUZ6IzXrEdCv1xeVPWD/rPAexOAT OiB72QQabpIYd9bXfiK2YNrlQkMPuN/vjnIIetHP/xKkfBgNPMicrXIImX/JdvTZDPnz kDLICbLxLpr4VVMsFKmku/zzVovIjSlbIka3IQyd6pTB6OeQynspDeMRpfay/r1rdHz9 KEzpThiAfBbR8zRiYgdmGEN3HZrTXswVwTDodJNXZnXT7x0hZyo07z7j/aZ5Aiikdreq YfT8GjEdzfcw1ugOHW9Umd36eN27qQbjPl5bUjOPUBfieNyh1fmbT21KQYzFpiu+x+y8 xhQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a9si6960529iow.48.2021.11.09.15.59.19; Tue, 09 Nov 2021 15:59:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236293AbhKIPFF (ORCPT + 97 others); Tue, 9 Nov 2021 10:05:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:33910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236189AbhKIPFD (ORCPT ); Tue, 9 Nov 2021 10:05:03 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 48CF861052; Tue, 9 Nov 2021 15:02:13 +0000 (UTC) Date: Tue, 9 Nov 2021 16:02:08 +0100 From: Christian Brauner To: Anders Roxell Cc: shuah@kernel.org, christian@brauner.io, nathan@kernel.org, ndesaulniers@google.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH 2/2] selftests: cgroup: use function 'labs()' over 'abs()' Message-ID: <20211109150208.rzzvteprq2tp5biq@wittgenstein> References: <20211105162530.3307666-1-anders.roxell@linaro.org> <20211105162530.3307666-2-anders.roxell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211105162530.3307666-2-anders.roxell@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- Thanks! Acked-by: Christian Brauner