FIELD_PREP_CONST(9)
β¨ FIELD_PREP_CONST(9) β¨
okay so bestie, welcome to the Kernel API Manual page for FIELD_PREP_CONST(9) β the one that prepares a constant bitfield element π
πΈ NAME πΈ
FIELD_PREP_CONST β prepare a constant bitfield element β¨
π SYNOPSIS π
FIELD_PREP_CONST (_mask , _val );
π¦ ARGUMENTS π¦
_maskβ the shifted mask that defines the fieldβs length and position π_valβ the value youβre putting in the field π«Ά
π DESCRIPTION π
FIELD_PREP_CONST masks and shifts up the value. The result should be combined with other fields of the bitfield using logical OR β yes, that part matters, slay π₯
Unlike FIELD_PREP, this is a constant expression and can therefore be used in initializers. Periodt. β¨
ngl the error checking is less comfortable for this version, and non-constant masks cannot be used. So keep that in mind, bestie π
π SEE ALSO π
Kernel file: ./include/linux/bitfield.h
Also check out FIELD_MAX(9), FIELD_FIT(9), FIELD_PREP(9), FIELD_GET(9), FIELD_GET_SIGNED(9), FIELD_MODIFY(9), field_prep(9), and field_get(9) π§
Byeee bestie β this iconic little page comes from the ./include/linux source/version and is dated October 2026 ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms