All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Schmidt <mschmidt@redhat.com>
To: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org,
	Richard Cochran <richardcochran@gmail.com>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
	Karol Kolacinski <karol.kolacinski@intel.com>,
	Jacob Keller <jacob.e.keller@intel.com>
Subject: [Intel-wired-lan] [PATCH net-next 3/3] ice: fold ice_ptp_read_time into ice_ptp_gettimex64
Date: Mon, 26 Feb 2024 16:11:25 +0100	[thread overview]
Message-ID: <20240226151125.45391-4-mschmidt@redhat.com> (raw)
In-Reply-To: <20240226151125.45391-1-mschmidt@redhat.com>

This is a cleanup. It is unnecessary to have this function just to call
another function.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 25 +++---------------------
 1 file changed, 3 insertions(+), 22 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index b6c7246245c6..cb061966cc9e 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -1166,26 +1166,6 @@ static void ice_ptp_reset_cached_phctime(struct ice_pf *pf)
 	ice_ptp_mark_tx_tracker_stale(&pf->ptp.port.tx);
 }
 
-/**
- * ice_ptp_read_time - Read the time from the device
- * @pf: Board private structure
- * @ts: timespec structure to hold the current time value
- * @sts: Optional parameter for holding a pair of system timestamps from
- *       the system clock. Will be ignored if NULL is given.
- *
- * This function reads the source clock registers and stores them in a timespec.
- * However, since the registers are 64 bits of nanoseconds, we must convert the
- * result to a timespec before we can return.
- */
-static void
-ice_ptp_read_time(struct ice_pf *pf, struct timespec64 *ts,
-		  struct ptp_system_timestamp *sts)
-{
-	u64 time_ns = ice_ptp_read_src_clk_reg(pf, sts);
-
-	*ts = ns_to_timespec64(time_ns);
-}
-
 /**
  * ice_ptp_write_init - Set PHC time to provided value
  * @pf: Board private structure
@@ -1926,9 +1906,10 @@ ice_ptp_gettimex64(struct ptp_clock_info *info, struct timespec64 *ts,
 		   struct ptp_system_timestamp *sts)
 {
 	struct ice_pf *pf = ptp_info_to_pf(info);
+	u64 time_ns;
 
-	ice_ptp_read_time(pf, ts, sts);
-
+	time_ns = ice_ptp_read_src_clk_reg(pf, sts);
+	*ts = ns_to_timespec64(time_ns);
 	return 0;
 }
 
-- 
2.43.2


WARNING: multiple messages have this Message-ID (diff)
From: Michal Schmidt <mschmidt@redhat.com>
To: intel-wired-lan@lists.osuosl.org
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
	Karol Kolacinski <karol.kolacinski@intel.com>,
	Jacob Keller <jacob.e.keller@intel.com>,
	netdev@vger.kernel.org
Subject: [PATCH net-next 3/3] ice: fold ice_ptp_read_time into ice_ptp_gettimex64
Date: Mon, 26 Feb 2024 16:11:25 +0100	[thread overview]
Message-ID: <20240226151125.45391-4-mschmidt@redhat.com> (raw)
In-Reply-To: <20240226151125.45391-1-mschmidt@redhat.com>

This is a cleanup. It is unnecessary to have this function just to call
another function.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 25 +++---------------------
 1 file changed, 3 insertions(+), 22 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index b6c7246245c6..cb061966cc9e 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -1166,26 +1166,6 @@ static void ice_ptp_reset_cached_phctime(struct ice_pf *pf)
 	ice_ptp_mark_tx_tracker_stale(&pf->ptp.port.tx);
 }
 
-/**
- * ice_ptp_read_time - Read the time from the device
- * @pf: Board private structure
- * @ts: timespec structure to hold the current time value
- * @sts: Optional parameter for holding a pair of system timestamps from
- *       the system clock. Will be ignored if NULL is given.
- *
- * This function reads the source clock registers and stores them in a timespec.
- * However, since the registers are 64 bits of nanoseconds, we must convert the
- * result to a timespec before we can return.
- */
-static void
-ice_ptp_read_time(struct ice_pf *pf, struct timespec64 *ts,
-		  struct ptp_system_timestamp *sts)
-{
-	u64 time_ns = ice_ptp_read_src_clk_reg(pf, sts);
-
-	*ts = ns_to_timespec64(time_ns);
-}
-
 /**
  * ice_ptp_write_init - Set PHC time to provided value
  * @pf: Board private structure
@@ -1926,9 +1906,10 @@ ice_ptp_gettimex64(struct ptp_clock_info *info, struct timespec64 *ts,
 		   struct ptp_system_timestamp *sts)
 {
 	struct ice_pf *pf = ptp_info_to_pf(info);
+	u64 time_ns;
 
-	ice_ptp_read_time(pf, ts, sts);
-
+	time_ns = ice_ptp_read_src_clk_reg(pf, sts);
+	*ts = ns_to_timespec64(time_ns);
 	return 0;
 }
 
-- 
2.43.2


  parent reply	other threads:[~2024-02-26 15:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 15:11 [Intel-wired-lan] [PATCH net-next 0/3] ice: lighter locking for PTP time reading Michal Schmidt
2024-02-26 15:11 ` Michal Schmidt
2024-02-26 15:11 ` [Intel-wired-lan] [PATCH net-next 1/3] ice: add ice_adapter for shared data across PFs on the same NIC Michal Schmidt
2024-02-26 15:11   ` Michal Schmidt
2024-02-26 19:18   ` [Intel-wired-lan] " Jacob Keller
2024-02-26 19:18     ` Jacob Keller
2024-02-27  7:05   ` [Intel-wired-lan] " Jiri Pirko
2024-02-27  7:05     ` Jiri Pirko
2024-02-27  8:11     ` [Intel-wired-lan] " Michal Schmidt
2024-02-27  8:11       ` Michal Schmidt
2024-02-28  2:35   ` [Intel-wired-lan] " Jakub Kicinski
2024-02-28  2:35     ` Jakub Kicinski
2024-02-28 17:39     ` [Intel-wired-lan] " Keller, Jacob E
2024-02-28 17:39       ` Keller, Jacob E
2024-02-26 15:11 ` [Intel-wired-lan] [PATCH net-next 2/3] ice: avoid the PTP hardware semaphore in gettimex64 path Michal Schmidt
2024-02-26 15:11   ` Michal Schmidt
2024-02-26 19:36   ` [Intel-wired-lan] " Jacob Keller
2024-02-26 19:36     ` Jacob Keller
2024-02-26 20:11     ` [Intel-wired-lan] " Michal Schmidt
2024-02-26 20:11       ` Michal Schmidt
2024-02-26 21:13       ` [Intel-wired-lan] " Jacob Keller
2024-02-26 21:13         ` Jacob Keller
2024-02-26 15:11 ` Michal Schmidt [this message]
2024-02-26 15:11   ` [PATCH net-next 3/3] ice: fold ice_ptp_read_time into ice_ptp_gettimex64 Michal Schmidt
2024-02-26 19:36   ` [Intel-wired-lan] " Jacob Keller
2024-02-26 19:36     ` Jacob Keller
2024-02-26 19:16 ` [Intel-wired-lan] [PATCH net-next 0/3] ice: lighter locking for PTP time reading Jacob Keller
2024-02-26 19:16   ` Jacob Keller
2024-02-26 20:01   ` [Intel-wired-lan] " Michal Schmidt
2024-02-26 20:01     ` Michal Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240226151125.45391-4-mschmidt@redhat.com \
    --to=mschmidt@redhat.com \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=karol.kolacinski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.