math.h: Add unsigned 8 bits fractional numbers type
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tue, 4 Jun 2024 12:30:06 +0000 (14:30 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 1 Jul 2024 18:28:58 +0000 (19:28 +0100)
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>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20240604123008.327424-4-angelogioacchino.delregno@collabora.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
include/linux/math.h

index dd41527..f5f18dc 100644 (file)
@@ -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)