mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 08:04:49 +01:00
- more rust helpers (Alice); - more bitops tests (Ryota); - FIND_NTH_BIT() uninitialized variable fix (Lee Yongjun); - random cleanups (Andy, H. Peter). -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEi8GdvG6xMhdgpu/4sUSA/TofvsgFAmmJIqMACgkQsUSA/Tof vsj/uwv/WIv9Wa3oTm3qzkIyaxeowIQE+DeDduporSoO8fnVfEYHjPuihMy3J5Gv x6iNUq9n8fMhmg/qHHyKwb/Ow8Ob11re9MZWS6a02wlm8Het0W9hKEk1z7qauFsI Vqq3rlMO3wYGaSPmlnh7rn/NHByrJ49ZrJcoX3he0Ov5MKp1w+dP3Czee4HGTb3A SM0cf4iCR3/Jj3flTsMghZgqZKNhsIe+ejX++dFPhmv82FHbIBcwUfN6CM27OGdy M7GAro1xIaoTwQVKCO2AycLAu8j+Rx9s+mcGuIAWynDo6YG1tVetADZQ+nRJG+x9 WdUDZwBDyEZlx/8BGnS56wevYxXEfC0lMTTgBqsYlCtLToyeE8G6NUVCLzEJAQCJ iWhcsenQVIiEHtYBZI/o2PmEp1Puzk1jI0+uFib1jE5Llf3+FrfMQGOiN2TBStEa zVIOipr+L9EaBbJdiKCV1jTl/MoDuCdRPLyby8egxPS+rk4RugvDsGc31XN48118 OHIJO2M/ =WnLV -----END PGP SIGNATURE----- Merge tag 'bitmap-for-6.20' of https://github.com/norov/linux Pull bitmap updates from Yury Norov: - more rust helpers (Alice) - more bitops tests (Ryota) - FIND_NTH_BIT() uninitialized variable fix (Lee Yongjun) - random cleanups (Andy, H. Peter) * tag 'bitmap-for-6.20' of https://github.com/norov/linux: lib/tests: extend KUnit test for bitops with more cases bitops: Add more files to the MAINTAINERS lib/find_bit: fix uninitialized variable use in FIND_NTH_BIT lib/tests: add KUnit test for bitops rust: cpumask: add __rust_helper to helpers rust: bitops: add __rust_helper to helpers rust: bitmap: add __rust_helper to helpers linux/bitfield.h: replace __auto_type with auto
69 lines
1.6 KiB
C
69 lines
1.6 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <linux/bitops.h>
|
|
#include <linux/find.h>
|
|
|
|
__rust_helper
|
|
void rust_helper___set_bit(unsigned long nr, unsigned long *addr)
|
|
{
|
|
__set_bit(nr, addr);
|
|
}
|
|
|
|
__rust_helper
|
|
void rust_helper___clear_bit(unsigned long nr, unsigned long *addr)
|
|
{
|
|
__clear_bit(nr, addr);
|
|
}
|
|
|
|
__rust_helper
|
|
void rust_helper_set_bit(unsigned long nr, volatile unsigned long *addr)
|
|
{
|
|
set_bit(nr, addr);
|
|
}
|
|
|
|
__rust_helper
|
|
void rust_helper_clear_bit(unsigned long nr, volatile unsigned long *addr)
|
|
{
|
|
clear_bit(nr, addr);
|
|
}
|
|
|
|
/*
|
|
* The rust_helper_ prefix is intentionally omitted below so that the
|
|
* declarations in include/linux/find.h are compatible with these helpers.
|
|
*
|
|
* Note that the below #ifdefs mean that the helper is only created if C does
|
|
* not provide a definition.
|
|
*/
|
|
#ifdef find_first_zero_bit
|
|
__rust_helper
|
|
unsigned long _find_first_zero_bit(const unsigned long *p, unsigned long size)
|
|
{
|
|
return find_first_zero_bit(p, size);
|
|
}
|
|
#endif /* find_first_zero_bit */
|
|
|
|
#ifdef find_next_zero_bit
|
|
__rust_helper
|
|
unsigned long _find_next_zero_bit(const unsigned long *addr,
|
|
unsigned long size, unsigned long offset)
|
|
{
|
|
return find_next_zero_bit(addr, size, offset);
|
|
}
|
|
#endif /* find_next_zero_bit */
|
|
|
|
#ifdef find_first_bit
|
|
__rust_helper
|
|
unsigned long _find_first_bit(const unsigned long *addr, unsigned long size)
|
|
{
|
|
return find_first_bit(addr, size);
|
|
}
|
|
#endif /* find_first_bit */
|
|
|
|
#ifdef find_next_bit
|
|
__rust_helper
|
|
unsigned long _find_next_bit(const unsigned long *addr, unsigned long size,
|
|
unsigned long offset)
|
|
{
|
|
return find_next_bit(addr, size, offset);
|
|
}
|
|
#endif /* find_next_bit */
|