Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1542602lqe; Mon, 8 Apr 2024 11:57:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVMA1ISwCUEbRAKkQpsSMZjo8EYYQkjv+AGH1eyjQ8eG3pe7Ahkh0H19zgFStOEgmQp4OS4CI5/JrMr6rqwk/oT5KKx9FE56GSQsi2SdQ== X-Google-Smtp-Source: AGHT+IGkPZiHHvMCpRSmOsDemkDlL9y19XybwkM4GpgO/oSPG2PUEZPzZuWXtOL0tjPPCohJ6Zpd X-Received: by 2002:a17:907:da5:b0:a51:a995:607a with SMTP id go37-20020a1709070da500b00a51a995607amr8337723ejc.25.1712602626154; Mon, 08 Apr 2024 11:57:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712602626; cv=pass; d=google.com; s=arc-20160816; b=YTxf63BQ+ZKdt/nG4++2ihItq0FqrjcCmZs4KdLPEp5zJrgPwkoXSWmDTFT//gI4M0 lvK9/B1hI/UZM+s4mqVGxaTA4EZJKgo1YBEHsaXpQwAEnwJL61sOxcrpU91wCCsEs+8M BJdkQJPcVSD1/mGIM8ebaCGrVnvgie/7MZBfFdBY4KBMSGw3826u7GMCEaNUROM6TLhK bRYgrVx7WDSN1QcmomFTQMxsF1x/eNsZQMTriw2+s8HOClAuxNE0tGScpZfj5cfOZYWv ymLC5U21W7Iil0GVk+B8Qu561L09cyAuGgmaDxtEQT6bL7pItcFf1qQo4rqRhwpkI5Gz zylw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=apfbFuLeR0dKTGxEjYFAjqb0D2e9OUYSQUTqwDdBd3U=; fh=v7+DPqFnSHaYBrQEDQoNHuPA1AcCSGajmOGlEK8qZM4=; b=NJXc6mwzsJeZtyeFJ161/LNssxVImtw4uqJaBQJz9v4IrAe6CRjLZGkFFLMkNKegDL NQh0cRdBQSX/z42A47tnB6XY4A9Xfpq8JZusGDzYbatHbxhpVd0LGiIjgKsgFv2E77U7 CNzyAkZRYtK7+qtdd4cqoA+2d9+LYzLgXtizHDD/2+SBWZLpy+easeqMph4h6HyhzbbF 9+u64rf2WRR0WUt5/KyzrVjN62VUG8F4Xq+J9dAE+YSeHxc11ZZqL656BA8tJfv88X3m J0YgWPu6LOoTGIckw/tFCROBDKjznR6IGKJ9mA9C+CTdF67vdOlLft+z3Cw2OLTCW9T9 Ig+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zi04pRXS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-135852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w20-20020a170906481400b00a51e1596e2csi485612ejq.1023.2024.04.08.11.57.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 11:57:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zi04pRXS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-135852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9690A1F224CA for ; Mon, 8 Apr 2024 18:57:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4B3714882B; Mon, 8 Apr 2024 18:55:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Zi04pRXS" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D59FA147C9F; Mon, 8 Apr 2024 18:55:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712602526; cv=none; b=Wz9aAbD+SP3V+pXvputaeh7y6/mpQa75p078tiickigOZO3pPO9zR7LNAYb3ftAh7jTt59NM/YrTBOktsBxtNAhrBW3V3UXNDIbHP2/2cIC3Gt0F04HQ5LxPAiT76wETzHLWfimrcD1095YZ4uQC0kksM71DJkd6DPQJOFSZxOg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712602526; c=relaxed/simple; bh=6IP15GRrvoLWh+SkcnFaIq4Jq+IWeRLFF0e6voiaEoM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jEdOu78rp3pl7Ua5zJ7e4d4I5pm6USLFcQ7bivwBVlaQdNM8/JSNPkK/2IR1rVgo5ffIC013ahmg4AbwrM2Qt52Y2EDkQt3ROI9SVaXRY3s177U/ZHXCZT33UxJs2Nx/hPyGYAva43+EZxPIZh5Nr0yJyTKbgU9WeRo59BvaNlA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Zi04pRXS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E37DC433A6; Mon, 8 Apr 2024 18:55:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712602526; bh=6IP15GRrvoLWh+SkcnFaIq4Jq+IWeRLFF0e6voiaEoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zi04pRXSNJM5LcEtZVPcOcxUMaCTLL4pxB6O4fqD6TkkJFEJxsd17dTOgXSYenG1u dj/l8g51Dw5KXwcRxwP97wX+tXuq1O/EhkhelbctuW0dxvHmAEPnpK6vfykTfAbT6P wv5ORA4MOYaRzLN550SCGqCBzUOTiAlh/o6r4fEa9wBmwCWrzrlFgKD+7OmDt2XouZ yQ9jZ03/lnP3I/fpL54zNhlNbYIswSd95jrPso4lYBi3zZHKXkAya28RHIWT7ZWMrS m31luBCIshtkxKdbrCjdCisRQjlnyvBnyyu1nI8F8L8+SFlJr94yg5Cul9nySQKHfM KXFY8FFfsWlOA== From: Namhyung Kim To: Arnaldo Carvalho de Melo , Ian Rogers , Kan Liang Cc: Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Arnd Bergmann , Geert Uytterhoeven , Palmer Dabbelt , linux-arch@vger.kernel.org Subject: [PATCH 8/9] tools/include: Sync asm-generic/bitops/fls.h with the kernel sources Date: Mon, 8 Apr 2024 11:55:19 -0700 Message-ID: <20240408185520.1550865-9-namhyung@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240408185520.1550865-1-namhyung@kernel.org> References: <20240408185520.1550865-1-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To pick up the changes from: cb4ede926134 ("riscv: Avoid code duplication with generic bitops implementation") This should address these tools/perf build warnings: Warning: Kernel ABI header differences: diff -u tools/include/asm-generic/bitops/__fls.h include/asm-generic/bitops/__fls.h diff -u tools/include/asm-generic/bitops/fls.h include/asm-generic/bitops/fls.h Cc: Arnd Bergmann Cc: Geert Uytterhoeven Cc: Palmer Dabbelt Cc: linux-arch@vger.kernel.org Signed-off-by: Namhyung Kim --- tools/include/asm-generic/bitops/__fls.h | 8 ++++++-- tools/include/asm-generic/bitops/fls.h | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/include/asm-generic/bitops/__fls.h b/tools/include/asm-generic/bitops/__fls.h index 03f721a8a2b1..54ccccf96e21 100644 --- a/tools/include/asm-generic/bitops/__fls.h +++ b/tools/include/asm-generic/bitops/__fls.h @@ -5,12 +5,12 @@ #include /** - * __fls - find last (most-significant) set bit in a long word + * generic___fls - find last (most-significant) set bit in a long word * @word: the word to search * * Undefined if no set bit exists, so code should check against 0 first. */ -static __always_inline unsigned long __fls(unsigned long word) +static __always_inline unsigned long generic___fls(unsigned long word) { int num = BITS_PER_LONG - 1; @@ -41,4 +41,8 @@ static __always_inline unsigned long __fls(unsigned long word) return num; } +#ifndef __HAVE_ARCH___FLS +#define __fls(word) generic___fls(word) +#endif + #endif /* _ASM_GENERIC_BITOPS___FLS_H_ */ diff --git a/tools/include/asm-generic/bitops/fls.h b/tools/include/asm-generic/bitops/fls.h index b168bb10e1be..26f3ce1dd6e4 100644 --- a/tools/include/asm-generic/bitops/fls.h +++ b/tools/include/asm-generic/bitops/fls.h @@ -3,14 +3,14 @@ #define _ASM_GENERIC_BITOPS_FLS_H_ /** - * fls - find last (most-significant) bit set + * generic_fls - find last (most-significant) bit set * @x: the word to search * * This is defined the same way as ffs. * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. */ -static __always_inline int fls(unsigned int x) +static __always_inline int generic_fls(unsigned int x) { int r = 32; @@ -39,4 +39,8 @@ static __always_inline int fls(unsigned int x) return r; } +#ifndef __HAVE_ARCH_FLS +#define fls(x) generic_fls(x) +#endif + #endif /* _ASM_GENERIC_BITOPS_FLS_H_ */ -- 2.44.0.478.gd926399ef9-goog