Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

time64.h: Consolidated PSEC_PER_SEC definition

We have currently three users of the PSEC_PER_SEC each of them defining it
individually. Instead, move it to time64.h to be available for everyone.

There is a new user coming with the same constant in use. It will also
make its life easier.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andy Shevchenko and committed by
David S. Miller
a460513e 3036ec03

+7 -8
+2
drivers/net/ethernet/mscc/ocelot_ptp.c
··· 4 4 * Copyright (c) 2017 Microsemi Corporation 5 5 * Copyright 2020 NXP 6 6 */ 7 + #include <linux/time64.h> 8 + 7 9 #include <soc/mscc/ocelot_ptp.h> 8 10 #include <soc/mscc/ocelot_sys.h> 9 11 #include <soc/mscc/ocelot.h>
-2
drivers/phy/phy-core-mipi-dphy.c
··· 12 12 #include <linux/phy/phy.h> 13 13 #include <linux/phy/phy-mipi-dphy.h> 14 14 15 - #define PSEC_PER_SEC 1000000000000LL 16 - 17 15 /* 18 16 * Minimum D-PHY timings based on MIPI D-PHY specification. Derived 19 17 * from the valid ranges specified in Section 6.9, Table 14, Page 41
+4 -4
drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
··· 11 11 #include <linux/clk-provider.h> 12 12 #include <linux/delay.h> 13 13 #include <linux/init.h> 14 + #include <linux/mfd/syscon.h> 14 15 #include <linux/module.h> 15 16 #include <linux/of_device.h> 16 17 #include <linux/platform_device.h> 18 + #include <linux/pm_runtime.h> 17 19 #include <linux/reset.h> 20 + #include <linux/time64.h> 21 + 18 22 #include <linux/phy/phy.h> 19 23 #include <linux/phy/phy-mipi-dphy.h> 20 - #include <linux/pm_runtime.h> 21 - #include <linux/mfd/syscon.h> 22 - 23 - #define PSEC_PER_SEC 1000000000000LL 24 24 25 25 #define UPDATE(x, h, l) (((x) << (l)) & GENMASK((h), (l))) 26 26
-2
include/soc/mscc/ocelot_ptp.h
··· 37 37 38 38 #define PTP_CFG_MISC_PTP_EN BIT(2) 39 39 40 - #define PSEC_PER_SEC 1000000000000LL 41 - 42 40 #define PTP_CFG_CLK_ADJ_CFG_ENA BIT(0) 43 41 #define PTP_CFG_CLK_ADJ_CFG_DIR BIT(1) 44 42
+1
include/vdso/time64.h
··· 9 9 #define NSEC_PER_MSEC 1000000L 10 10 #define USEC_PER_SEC 1000000L 11 11 #define NSEC_PER_SEC 1000000000L 12 + #define PSEC_PER_SEC 1000000000000LL 12 13 #define FSEC_PER_SEC 1000000000000000LL 13 14 14 15 #endif /* __VDSO_TIME64_H */