From: Jonathan Santos <Jonathan.Santos@analog.com>
To: <linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: Jonathan Santos <Jonathan.Santos@analog.com>, <lars@metafoo.de>,
<jic23@kernel.org>, <dlechner@baylibre.com>, <nuno.sa@analog.com>,
<andy@kernel.org>, <robh@kernel.org>, <krzk+dt@kernel.org>,
<conor+dt@kernel.org>, <marcelo.schmitt1@gmail.com>,
<jonath4nns@gmail.com>
Subject: [PATCH v3 3/4] math.h: Add 64-bit fractional numbers types
Date: Fri, 5 Sep 2025 06:49:32 -0300 [thread overview]
Message-ID: <f9ebbb830fab46201dacbffa4cbe223782f0acf3.1757001160.git.Jonathan.Santos@analog.com> (raw)
In-Reply-To: <cover.1757001160.git.Jonathan.Santos@analog.com>
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
next prev parent reply other threads:[~2025-09-05 15:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 9:48 [PATCH v3 0/4] Add support for ADAQ776x-1 ADC Family Jonathan Santos
2025-09-05 9:49 ` [PATCH v3 1/4] dt-bindings: iio: adc: ad7768-1: add new supported parts Jonathan Santos
2025-09-05 17:06 ` David Lechner
2025-09-05 9:49 ` [PATCH v3 2/4] iio: adc: ad7768-1: introduce chip info for future multidevice support Jonathan Santos
2025-09-05 16:51 ` Andy Shevchenko
2025-09-05 17:06 ` David Lechner
2025-09-05 9:49 ` Jonathan Santos [this message]
2025-09-05 16:45 ` [PATCH v3 3/4] math.h: Add 64-bit fractional numbers types Andy Shevchenko
2025-09-05 9:49 ` [PATCH v3 4/4] iio: adc: ad7768-1: add support for ADAQ776x-1 ADC Family Jonathan Santos
2025-09-05 17:08 ` David Lechner
2025-09-05 17:23 ` Andy Shevchenko
2025-09-05 17:25 ` Andy Shevchenko
2025-09-07 10:56 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f9ebbb830fab46201dacbffa4cbe223782f0acf3.1757001160.git.Jonathan.Santos@analog.com \
--to=jonathan.santos@analog.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=jonath4nns@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.com \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®