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] [day] [month] [year] [list]
Message-ID: <1323111761.21423.229.camel@work-vm>
Date:	Mon, 05 Dec 2011 11:02:41 -0800
From:	John Stultz <john.stultz@...aro.org>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Richard Cochran <richard.cochran@...cron.at>
Subject: Re: [PTP] Implement clock_getres() function correctly

On Sun, 2011-12-04 at 18:07 +0100, Thomas Gleixner wrote:
> On Sun, 4 Dec 2011, Thomas Gleixner wrote:
> 
> > clock_getres() needs to put the resolution into the provided timespec
> > and return 0 in case of success.
> > 
> > Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> > Cc: stable@...r.kernel.org
> 
> Gah, wrong version.
> 
> diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
> index cf3f999..6b0c02a 100644
> --- a/drivers/ptp/ptp_clock.c
> +++ b/drivers/ptp/ptp_clock.c
> @@ -101,7 +101,10 @@ static s32 scaled_ppm_to_ppb(long ppm)
> 
>  static int ptp_clock_getres(struct posix_clock *pc, struct timespec *tp)
>  {
> -	return 1; /* always round timer functions to one nanosecond */
> +	/* Resolution is one nanosecond */
> +	tp->tv_sec = 0;
> +	tp->tv_nsec = 1;
> +	return 0;
>  }
> 
>  static int ptp_clock_settime(struct posix_clock *pc, const struct timespec *tp)


Looks good.

Acked-by: John Stultz <john.stultz@...aro.org>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ