From: Arnaldo Carvalho de Melo Date: Mon, 19 May 2025 14:37:20 +0000 (-0300) Subject: tools headers: Synchronize uapi/linux/bits.h with the kernel sources X-Git-Tag: v6.16-rc1~57^2~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fa7a1e8d2d65a17bc5d6a9978d1352e0b0ef59d2;p=thirdparty%2Flinux.git tools headers: Synchronize uapi/linux/bits.h with the kernel sources To pick up the changes in this cset: 1e7933a575ed8af4 ("uapi: Revert "bitops: avoid integer overflow in GENMASK(_ULL)"") This addresses this perf build warning: Warning: Kernel ABI header differences: diff -u tools/include/uapi/linux/bits.h include/uapi/linux/bits.h Please see tools/include/uapi/README for further details. Acked-by: Vincent Mailhol Acked-by: Yury Norov [NVIDIA] Cc: Adrian Hunter Cc: I Hsin Cheng Cc: Ian Rogers Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Namhyung Kim Link: https://lore.kernel.org/r/20250519214126.1652491-6-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/include/uapi/linux/bits.h b/tools/include/uapi/linux/bits.h index 5ee30f882736c..682b406e10679 100644 --- a/tools/include/uapi/linux/bits.h +++ b/tools/include/uapi/linux/bits.h @@ -4,13 +4,9 @@ #ifndef _UAPI_LINUX_BITS_H #define _UAPI_LINUX_BITS_H -#define __GENMASK(h, l) \ - (((~_UL(0)) - (_UL(1) << (l)) + 1) & \ - (~_UL(0) >> (__BITS_PER_LONG - 1 - (h)))) +#define __GENMASK(h, l) (((~_UL(0)) << (l)) & (~_UL(0) >> (BITS_PER_LONG - 1 - (h)))) -#define __GENMASK_ULL(h, l) \ - (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \ - (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h)))) +#define __GENMASK_ULL(h, l) (((~_ULL(0)) << (l)) & (~_ULL(0) >> (BITS_PER_LONG_LONG - 1 - (h)))) #define __GENMASK_U128(h, l) \ ((_BIT128((h)) << 1) - (_BIT128(l)))