Skip to content

Commit

Permalink
units: add the HZ macros
Browse files Browse the repository at this point in the history
The macros for the unit conversion for frequency are duplicated in
different places.

Provide these macros in the 'units' header, so they can be reused.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Daniel Lezcano <[email protected]>
Reviewed-by: Christian Eggers <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Cc: Chanwoo Choi <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Lukasz Luba <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Miquel Raynal <[email protected]>
Cc: MyungJoo Ham <[email protected]>
Cc: Peter Meerwald <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Zhang Rui <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dlezcano authored and torvalds committed Sep 8, 2021
1 parent c922191 commit e2c7703
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/linux/units.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

#include <linux/math.h>

#define HZ_PER_KHZ 1000UL
#define KHZ_PER_MHZ 1000UL
#define HZ_PER_MHZ 1000000UL

#define MILLIWATT_PER_WATT 1000UL
#define MICROWATT_PER_MILLIWATT 1000UL
#define MICROWATT_PER_WATT 1000000UL
Expand Down

0 comments on commit e2c7703

Please sign in to comment.