diff mbox series

[v2,3/5] math.h: Add unsigned 8 bits fractional numbers type

Message ID 20240604123008.327424-4-angelogioacchino.delregno@collabora.com (mailing list archive)
State Accepted
Headers show
Series MediaTek MT6357/8/9 PMIC Auxiliary ADC support | expand

Commit Message

AngeloGioacchino Del Regno June 4, 2024, 12:30 p.m. UTC
Some users may be requiring only rather small numbers as both
numerator and denominator: add signed and unsigned 8 bits
structs {s8,u8}_fract.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 include/linux/math.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andy Shevchenko June 4, 2024, 1:18 p.m. UTC | #1
On Tue, Jun 4, 2024 at 3:30 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Some users may be requiring only rather small numbers as both
> numerator and denominator: add signed and unsigned 8 bits
> structs {s8,u8}_fract.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Thank you!
diff mbox series

Patch

diff --git a/include/linux/math.h b/include/linux/math.h
index dd4152711de7..f5f18dc3616b 100644
--- a/include/linux/math.h
+++ b/include/linux/math.h
@@ -112,6 +112,8 @@  struct type##_fract {					\
 	__##type numerator;				\
 	__##type denominator;				\
 };
+__STRUCT_FRACT(s8)
+__STRUCT_FRACT(u8)
 __STRUCT_FRACT(s16)
 __STRUCT_FRACT(u16)
 __STRUCT_FRACT(s32)