summaryrefslogtreecommitdiffstats
path: root/include/linux/math.h
diff options
context:
space:
mode:
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>2024-06-04 14:30:06 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-07-01 19:28:58 +0100
commite38a82df2c9924577d39ce5ccee9e9edcadc3b5d (patch)
tree2755319bc6438be85866a4ca3a7c14777f673589 /include/linux/math.h
parent4d8aa430624006ba06254aa607f8756a75e42c8d (diff)
downloadlinux-stable-e38a82df2c9924577d39ce5ccee9e9edcadc3b5d.tar.gz
linux-stable-e38a82df2c9924577d39ce5ccee9e9edcadc3b5d.tar.bz2
linux-stable-e38a82df2c9924577d39ce5ccee9e9edcadc3b5d.zip
math.h: Add unsigned 8 bits fractional numbers type
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>
Diffstat (limited to 'include/linux/math.h')
-rw-r--r--include/linux/math.h2
1 files changed, 2 insertions, 0 deletions
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)