linux/tools
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
..
accounting SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
arch x86/CPU/AMD: Prevent improper isolation of shared resources in Zen2's op cache 2026-05-15 14:48:45 +02:00
bootconfig tools/bootconfig: fix fd leak in load_xbc_file() on fstat failure 2026-04-18 10:33:22 +02:00
bpf bpftool: Use libbpf error code for flow dissector query 2026-07-24 15:51:32 +02:00
build tools build: Align warning options with perf 2025-10-19 16:21:42 +02:00
cgroup tools/cgroup/slabinfo.py: updated to work on current kernel 2021-04-23 14:42:40 -07:00
debugging tools: Fix "the the" in a message in kernel-chktaint 2021-06-13 17:01:17 -06:00
edid tools/edid: Move EDID data sets from Documentation/ 2020-02-19 04:10:32 -07:00
firewire treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
firmware Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
gpio tools: gpio: fix debounce_period_us output of lsgpio 2023-06-21 15:59:12 +02:00
hv vmbus_testing: fix wrong python syntax for integer value comparison 2023-09-19 12:22:28 +02:00
iio tools/iio: Add memory allocation failure check for trigger_name 2024-10-17 15:11:52 +02:00
include bitops: make BYTES_TO_BITS() treewide-available 2026-07-24 15:51:56 +02:00
io_uring tools/io_uring/io_uring-cp: sync with liburing example 2021-08-13 08:58:11 -06:00
kvm/kvm_stat tools/kvm_stat: fix display of error when multiple processes are found 2022-08-11 13:07:51 +02:00
laptop change email address for Pali Rohár 2020-04-10 15:36:22 -07:00
leds .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
lib tools lib api: Fix mount_overload() snprintf truncation and toupper range 2026-07-24 15:51:38 +02:00
memory-model tools/memory-model: Fix bug in lock.cat 2024-08-19 05:45:15 +02:00
objtool objtool: Fix Clang jump table detection 2026-04-18 10:33:29 +02:00
pci tools: PCI: Zero-initialize param 2021-08-05 11:01:30 +01:00
pcmcia .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
perf bitops: make BYTES_TO_BITS() treewide-available 2026-07-24 15:51:56 +02:00
power tools/power cpupower: Reset errno before strtoull() 2026-03-04 07:19:57 -05:00
rcu tools/rcu: Add drgn script to dump number of RCU callbacks 2021-05-10 15:39:19 -07:00
scripts tools: Override makefile ARCH variable if defined, but empty 2024-12-14 19:51:30 +01:00
spi spi: tools: Add include folder to .gitignore 2026-03-04 07:19:32 -05:00
testing selftests/mm: fix exclusive_cow test fork() handling 2026-07-24 15:51:40 +02:00
thermal/tmon tools/thermal: Fix possible path truncations 2022-08-17 14:24:15 +02:00
time treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
tracing tracing/tools: Fix incorrcet short option in usage text for --threads 2025-12-07 06:09:32 +09:00
usb usbip: tools: support SuperSpeedPlus devices 2026-07-24 15:51:23 +02:00
virtio tools/virtio: check mmap return value in vringh_test 2026-07-24 15:51:34 +02:00
vm tools/mm/slabinfo: fix total_objects attribute name 2026-07-24 15:51:26 +02:00
wmi treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Makefile tracing/tools: Add the latency-collector to tools directory 2021-02-12 11:52:59 -05:00