From: "Biju Das" <biju.das.jz@bp.renesas.com>
To: Pavel Machek <pavel@denx.de>
Cc: nobuhiro1.iwamatsu@toshiba.co.jp,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
Biju Das <biju.das.jz@bp.renesas.com>,
cip-dev@lists.cip-project.org
Subject: [PATCH [5.10.y-cip] 02/13] units: Add SI metric prefix definitions
Date: Thu, 14 Jul 2022 14:56:16 +0100 [thread overview]
Message-ID: <20220714135627.2163551-3-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20220714135627.2163551-1-biju.das.jz@bp.renesas.com>
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
commit 26471d4a6cf8d5d0bd0fb55c7169de7d67cc703a upstream.
Sometimes it's useful to have well-defined SI metric prefix to be used
to self-describe the formulas or equations.
List most popular ones in the units.h.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
include/linux/units.h | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/include/linux/units.h b/include/linux/units.h
index 5c115c809507..4a25e0cc8fb3 100644
--- a/include/linux/units.h
+++ b/include/linux/units.h
@@ -4,6 +4,26 @@
#include <linux/math.h>
+/* Metric prefixes in accordance with Système international (d'unités) */
+#define PETA 1000000000000000ULL
+#define TERA 1000000000000ULL
+#define GIGA 1000000000UL
+#define MEGA 1000000UL
+#define KILO 1000UL
+#define HECTO 100UL
+#define DECA 10UL
+#define DECI 10UL
+#define CENTI 100UL
+#define MILLI 1000UL
+#define MICRO 1000000UL
+#define NANO 1000000000UL
+#define PICO 1000000000000ULL
+#define FEMTO 1000000000000000ULL
+
+#define MILLIWATT_PER_WATT 1000L
+#define MICROWATT_PER_MILLIWATT 1000L
+#define MICROWATT_PER_WATT 1000000L
+
#define ABSOLUTE_ZERO_MILLICELSIUS -273150
static inline long milli_kelvin_to_millicelsius(long t)
--
2.25.1
next parent reply other threads:[~2022-07-14 14:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220714135627.2163551-1-biju.das.jz@bp.renesas.com>
2022-07-14 13:56 ` Biju Das [this message]
2022-07-14 13:56 ` [PATCH [5.10.y-cip] 03/13] thermal/drivers: Add TSU driver for RZ/G2L Biju Das
2022-07-14 13:56 ` [PATCH [5.10.y-cip] 06/13] arm64: defconfig: Enable additional support for Renesas platforms Biju Das
2022-07-14 13:56 ` [PATCH [5.10.y-cip] 08/13] watchdog: rzg2l_wdt: Fix Runtime PM usage Biju Das
2022-07-14 13:56 ` [PATCH [5.10.y-cip] 10/13] watchdog: rzg2l_wdt: Fix reset control imbalance Biju Das
2022-07-14 13:56 ` [PATCH [5.10.y-cip] 12/13] watchdog: rzg2l_wdt: Use force reset for WDT reset Biju Das
2022-07-14 14:04 [PATCH [5.10.y-cip] 00/13] Add thermal driver and watchdog driver enhancements Biju Das
2022-07-14 14:04 ` [PATCH [5.10.y-cip] 02/13] units: Add SI metric prefix definitions Biju Das
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=20220714135627.2163551-3-biju.das.jz@bp.renesas.com \
--to=biju.das.jz@bp.renesas.com \
--cc=cip-dev@lists.cip-project.org \
--cc=nobuhiro1.iwamatsu@toshiba.co.jp \
--cc=pavel@denx.de \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.