[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210616114718.0e4c2142@canb.auug.org.au>
Date: Wed, 16 Jun 2021 11:47:18 +1000
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: David Miller <davem@...emloft.net>,
Networking <netdev@...r.kernel.org>
Cc: Jakub Kicinski <kuba@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Next Mailing List <linux-next@...r.kernel.org>,
"Radu Pirea (NXP OSS)" <radu-nicolae.pirea@....nxp.com>
Subject: linux-next: manual merge of the net-next tree with the net tree
Hi all,
Today's linux-next merge of the net-next tree got conflicts in:
drivers/ptp/ptp_clock.c
include/linux/ptp_clock_kernel.h
between commit:
475b92f93216 ("ptp: improve max_adj check against unreasonable values")
from the net tree and commit:
9d9d415f0048 ("ptp: ptp_clock: make scaled_ppm_to_ppb static inline")
from the net-next tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc drivers/ptp/ptp_clock.c
index 21c4c34c52d8,a780435331c8..000000000000
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
diff --cc include/linux/ptp_clock_kernel.h
index 51d7f1b8b32a,a311bddd9e85..000000000000
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@@ -186,6 -186,32 +186,32 @@@ struct ptp_clock_event
};
};
+ /**
+ * scaled_ppm_to_ppb() - convert scaled ppm to ppb
+ *
+ * @ppm: Parts per million, but with a 16 bit binary fractional field
+ */
-static inline s32 scaled_ppm_to_ppb(long ppm)
++static inline long scaled_ppm_to_ppb(long ppm)
+ {
+ /*
+ * The 'freq' field in the 'struct timex' is in parts per
+ * million, but with a 16 bit binary fractional field.
+ *
+ * We want to calculate
+ *
+ * ppb = scaled_ppm * 1000 / 2^16
+ *
+ * which simplifies to
+ *
+ * ppb = scaled_ppm * 125 / 2^13
+ */
+ s64 ppb = 1 + ppm;
+
+ ppb *= 125;
+ ppb >>= 13;
- return (s32)ppb;
++ return (long)ppb;
+ }
+
#if IS_REACHABLE(CONFIG_PTP_1588_CLOCK)
/**
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists