lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1427836236.16312.28.camel@intel.com>
Date:	Tue, 31 Mar 2015 21:10:36 +0000
From:	"Keller, Jacob E" <jacob.e.keller@...el.com>
To:	"richardcochran@...il.com" <richardcochran@...il.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"baolin.wang@...aro.org" <baolin.wang@...aro.org>,
	"b45643@...escale.com" <b45643@...escale.com>,
	"amirv@...lanox.com" <amirv@...lanox.com>,
	"peppe.cavallaro@...com" <peppe.cavallaro@...com>,
	"sonic.zhang@...log.com" <sonic.zhang@...log.com>,
	"rayagond@...avyalabs.com" <rayagond@...avyalabs.com>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"sony.chacko@...gic.com" <sony.chacko@...gic.com>,
	"Vick, Matthew" <matthew.vick@...el.com>,
	"arnd@...aro.org" <arnd@...aro.org>,
	"Frank.Li@...escale.com" <Frank.Li@...escale.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"mchan@...adcom.com" <mchan@...adcom.com>,
	"prashant@...adcom.com" <prashant@...adcom.com>,
	"davem@...emloft.net" <davem@...emloft.net>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
	"john.stultz@...aro.org" <john.stultz@...aro.org>
Subject: Re: [PATCH net-next 06/11] ptp: e1000e: use helpers for converting
 ns to timespec.

On Tue, 2015-03-31 at 23:08 +0200, Richard Cochran wrote:
> This patch changes the driver to use ns_to_timespec64() instead of
> open coding the same logic.
> 
> Compile tested only.
> 
> Signed-off-by: Richard Cochran <richardcochran@...il.com>
> ---
>  drivers/net/ethernet/intel/e1000e/ptp.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c
> index b747a3e..d2272ad 100644
> --- a/drivers/net/ethernet/intel/e1000e/ptp.c
> +++ b/drivers/net/ethernet/intel/e1000e/ptp.c
> @@ -111,15 +111,13 @@ static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
>  	struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,
>  						     ptp_clock_info);
>  	unsigned long flags;
> -	u32 remainder;
>  	u64 ns;
>  
>  	spin_lock_irqsave(&adapter->systim_lock, flags);
>  	ns = timecounter_read(&adapter->tc);
>  	spin_unlock_irqrestore(&adapter->systim_lock, flags);
>  
> -	ts->tv_sec = div_u64_rem(ns, NSEC_PER_SEC, &remainder);
> -	ts->tv_nsec = remainder;
> +	*ts = ns_to_timespec64(ns);
>  
>  	return 0;
>  }


Acked-by: Jacob Keller <jacob.e.keller@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ