From: Damian Muszynski Date: Fri, 20 Oct 2023 13:49:25 +0000 (+0200) Subject: units: Add BYTES_PER_*BIT X-Git-Tag: v6.7-rc1~91^2~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e8eed5f7366f1f5decb694168bd06fb59ef6b12c;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu --- diff --git a/include/linux/units.h b/include/linux/units.h index 2793a41e73a2b..ff1bd6b5f5b37 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)