summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamian Muszynski <damian.muszynski@intel.com>2023-10-20 16:49:25 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2023-10-27 13:04:28 +0300
commite8eed5f7366f1f5decb694168bd06fb59ef6b12c (patch)
treeb6758e77b6450cbec847c2e37f2b30733179285d
parent8e6857f76dafba874593107f9e5c20030c5956ed (diff)
downloadlinux-e8eed5f7366f1f5decb694168bd06fb59ef6b12c.tar.xz
units: Add BYTES_PER_*BIT
There is going to be a new user of the BYTES_PER_[K/M/G]BIT definition besides possibly existing ones. Add them to the header. Signed-off-by: Damian Muszynski <damian.muszynski@intel.com> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Reviewed-by: Tero Kristo <tero.kristo@linux.intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--include/linux/units.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/units.h b/include/linux/units.h
index 2793a41e73a2..ff1bd6b5f5b3 100644
--- a/include/linux/units.h
+++ b/include/linux/units.h
@@ -31,6 +31,10 @@
#define MICROWATT_PER_MILLIWATT 1000UL
#define MICROWATT_PER_WATT 1000000UL
+#define BYTES_PER_KBIT (KILO / BITS_PER_BYTE)
+#define BYTES_PER_MBIT (MEGA / BITS_PER_BYTE)
+#define BYTES_PER_GBIT (GIGA / BITS_PER_BYTE)
+
#define ABSOLUTE_ZERO_MILLICELSIUS -273150
static inline long milli_kelvin_to_millicelsius(long t)