summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-09-23 23:09:53 +0100
committerYury Norov <ynorov@nvidia.com>2026-09-23 18:17:45 -0400
commitd267d2f41222912a5f40dc064df64cee57c8bade (patch)
treea1bc532d99fc4b759db896153ecbf7f18060cc41 /include
parent1c88ceb09d5e5506456a625043bc9b35ce86fc41 (diff)
downloadlinux-next-d267d2f41222912a5f40dc064df64cee57c8bade.tar.gz
linux-next-d267d2f41222912a5f40dc064df64cee57c8bade.zip
bitfield: Restore be16_replace_bits()
Commit 1c88ceb09d5e5 ("bitfield: get rid of __MAKE_OP machinery") removed a bunch of unused bitfield operations including be16_replace_bits() but commit 508bdb4938928 ("iio: adc: Add AD7768 and AD7768-4 core support") introduces a new user. Restore the function so the build still works once both branches are merged. Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Yury Norov <ynorov@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/bitfield-fix-width.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/bitfield-fix-width.h b/include/linux/bitfield-fix-width.h
index fba86bb76999..f73b8cd65601 100644
--- a/include/linux/bitfield-fix-width.h
+++ b/include/linux/bitfield-fix-width.h
@@ -94,6 +94,12 @@ u16 be16_get_bits(__be16 v, u16 field)
}
static __always_inline __must_check
+__be16 be16_replace_bits(__be16 old, u16 val, u16 field)
+{
+ return (old & ~cpu_to_be16(field)) | be16_encode_bits(val, field);
+}
+
+static __always_inline __must_check
__u16 u16_encode_bits(u16 v, u16 field)
{
__assert_field(v, field);