From patchwork Thu Jul 14 13:56:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13005263 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from relmlie5.idc.renesas.com (relmlie5.idc.renesas.com [210.160.252.171]) by mx.groups.io with SMTP id smtpd.web11.7961.1657807298414414828 for ; Thu, 14 Jul 2022 07:01:38 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: bp.renesas.com, ip: 210.160.252.171, mailfrom: biju.das.jz@bp.renesas.com) X-IronPort-AV: E=Sophos;i="5.92,271,1650898800"; d="scan'208";a="126169990" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 14 Jul 2022 22:56:35 +0900 Received: from localhost.localdomain (unknown [10.226.92.147]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 320BD40031FB; Thu, 14 Jul 2022 22:56:33 +0900 (JST) From: "Biju Das" To: Pavel Machek Cc: nobuhiro1.iwamatsu@toshiba.co.jp, Lad Prabhakar , Biju Das , 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 Message-Id: <20220714135627.2163551-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220714135627.2163551-1-biju.das.jz@bp.renesas.com> References: <20220714135627.2163551-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 List-Id: From: Andy Shevchenko 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 Signed-off-by: Wolfram Sang Signed-off-by: Biju Das --- 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 +/* 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)