On 8/7/26 10:14 AM, Quentin Schulz wrote:
Hi Jonas,

On 8/3/26 8:43 PM, Jonas Karlman wrote:
Hardware of various vendors, but very notably Rockchip, often uses
32-bit registers where the upper 16-bit half of the register is a
write-enable mask for the lower half.

Add hw_bitfield.h with two macros: FIELD_PREP_WM16, and
FIELD_PREP_WM16_CONST. The latter is a version that can be used in
initializers, like FIELD_PREP_CONST.

Import hw_bitfield.h from Linux commit 21368fcbb124 ("bitmap: introduce
hardware-specific bitfield operations"), first introduced in v6.18-rc1.

This contains two changes compared to the Linux version:
- include of linux/limit.h was dropped
- use of const_true() in FIELD_PREP_WM16_CONST() was dropped


Acked-by: Quentin Schulz <[email protected]>

The content in this patch is as described in the commit log.

I'm wondering whether we should try to get include/linux/limit.h (and include/vdso/limit.h) in. Also wondering if we could also get const_true() in somehow.

No changes made to this file in Linux kernel since v6.18-rc1, so could as well have said it's taken from 7.2-rc6 (which also means no missed fixes).

I'll wait on Tom's Reviewed-by before merging this though since it's not a straight import from the Linux kernel. I'm targeting the next branch for this.


Read patch 2 again and you convinced me that this should rather go in main, so will wait for Tom's R-b and target one of the 2026.10-rcX.

Sorry for the noise.

Cheers,
Quentin

Reply via email to