[PATCH v4 3/4] units: add BASIS_POINTS macro

Jonathan Santos posted 4 patches 5 days ago
[PATCH v4 3/4] units: add BASIS_POINTS macro
Posted by Jonathan Santos 5 days ago
Add macro for basis points unit, defined as a 1/100th of a percent.

Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
---
v4 Changes:
* New patch.
---
 include/linux/units.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/units.h b/include/linux/units.h
index 00e15de33eca..da2c24fe5ee7 100644
--- a/include/linux/units.h
+++ b/include/linux/units.h
@@ -21,6 +21,8 @@
 #define PICO	1000000000000ULL
 #define FEMTO	1000000000000000ULL
 
+#define BASIS_POINTS 10000UL
+
 #define NANOHZ_PER_HZ		1000000000UL
 #define MICROHZ_PER_HZ		1000000UL
 #define MILLIHZ_PER_HZ		1000UL
-- 
2.34.1
Re: [PATCH v4 3/4] units: add BASIS_POINTS macro
Posted by Andy Shevchenko 5 days ago
On Wed, Nov 26, 2025 at 06:56:26PM -0300, Jonathan Santos wrote:
> Add macro for basis points unit, defined as a 1/100th of a percent.

Fine, but why? Can you elaborate more on use cases?

...


Perhaps you also want to add a PERCENT to understand the relationship
between two?

> +#define BASIS_POINTS 10000UL

And this needs a comment with an example (something like I asked above
for the commit message).


-- 
With Best Regards,
Andy Shevchenko