From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752067AbdATNEP (ORCPT ); Fri, 20 Jan 2017 08:04:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42634 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752028AbdATNEN (ORCPT ); Fri, 20 Jan 2017 08:04:13 -0500 Subject: Re: [patch 4/5] PTP: add PTP_SYS_OFFSET emulation via cross timestamps infrastructure To: Marcelo Tosatti , kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170120122025.665985919@redhat.com> <20170120122503.746158230@redhat.com> Cc: Radim Krcmar , Richard Cochran , Miroslav Lichvar From: Paolo Bonzini Message-ID: <48bb2650-ed00-ec07-31bf-8780d3ab5568@redhat.com> Date: Fri, 20 Jan 2017 13:55:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170120122503.746158230@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 20 Jan 2017 12:55:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/01/2017 13:20, Marcelo Tosatti wrote: > kernel/time/timekeeping.c | 79 +++++++++++++++++++++++++++++++++++++++ Why not leave this in drivers/ptp/ptp_chardev.c? > + if (ptp->info->emulate_ptp_sys_offset_mean) { > + err = emulate_ptp_sys_offset(ptp->info, sysoff, arg); > + break; > + } I think this should be simply "if (!ptp->info->gettime64)" and, likewise, there should be an emulation based getcrosststamp in ptp_clock_gettime. Paolo