[PATCH v3 3/4] math.h: Add 64-bit fractional numbers types

Jonathan Santos posted 4 patches 4 days, 11 hours ago
[PATCH v3 3/4] math.h: Add 64-bit fractional numbers types
Posted by Jonathan Santos 4 days, 11 hours ago
Extend fractional numbers types to include __u64 and __s64 data types.

Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
---
v3 Changes:
* New patch.
* OBS: Andy suggested to support long types, but the macro was made for
  data types like __TYPE. So i have added the __u64 and __s64 types.
---
 include/linux/math.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/math.h b/include/linux/math.h
index 0198c92cbe3e..ff28a0dcfaa8 100644
--- a/include/linux/math.h
+++ b/include/linux/math.h
@@ -130,6 +130,8 @@ __STRUCT_FRACT(s16)
 __STRUCT_FRACT(u16)
 __STRUCT_FRACT(s32)
 __STRUCT_FRACT(u32)
+__STRUCT_FRACT(s64)
+__STRUCT_FRACT(u64)
 #undef __STRUCT_FRACT
 
 /* Calculate "x * n / d" without unnecessary overflow or loss of precision. */
-- 
2.34.1
Re: [PATCH v3 3/4] math.h: Add 64-bit fractional numbers types
Posted by Andy Shevchenko 4 days, 4 hours ago
On Fri, Sep 05, 2025 at 06:49:32AM -0300, Jonathan Santos wrote:
> Extend fractional numbers types to include __u64 and __s64 data types.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko