linux/tools/include
Alexander Lobakin d4989777a1 bitops: make BYTES_TO_BITS() treewide-available
[ Upstream commit 7d8296b250 ]

Avoid open-coding that simple expression each time by moving
BYTES_TO_BITS() from the probes code to <linux/bitops.h> to export
it to the rest of the kernel.
Simplify the macro while at it. `BITS_PER_LONG / sizeof(long)` always
equals to %BITS_PER_BYTE, regardless of the target architecture.
Do the same for the tools ecosystem as well (incl. its version of
bitops.h). The previous implementation had its implicit type of long,
while the new one is int, so adjust the format literal accordingly in
the perf code.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Acked-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: 55052184ac ("iio: common: st_sensors: honour channel endianness in read_axis_data")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-07-24 15:51:56 +02:00
..
asm tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' 2021-05-10 09:01:00 -03:00
asm-generic hugetlb_encode.h: fix undefined behaviour (34 << 26) 2024-07-05 09:14:23 +02:00
linux bitops: make BYTES_TO_BITS() treewide-available 2026-07-24 15:51:56 +02:00
nolibc tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers 2025-10-19 16:21:31 +02:00
tools tools include: add dis-asm-compat.h to handle version differences 2023-03-17 08:49:04 +01:00
trace/events tools/lib/lockdep: Remove private kernel headers 2017-06-05 09:28:14 +02:00
uapi bpf: Fix L4 csum update on IPv6 in CHECKSUM_COMPLETE 2025-06-27 11:05:38 +01:00
vdso tools headers: Synchronize linux/bits.h with the kernel sources 2020-04-14 11:40:05 -03:00