Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29957803rwd; Wed, 5 Jul 2023 21:39:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlHHxAMNJAOCW0fK9CZp4ZlJpdiudzTaojRC7Fon0wnUnCYxLDUkkSrZoJJGcqiNjJsoN0QD X-Received: by 2002:a17:902:e78a:b0:1b8:7613:594d with SMTP id cp10-20020a170902e78a00b001b87613594dmr5324276plb.24.1688618374122; Wed, 05 Jul 2023 21:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688618374; cv=none; d=google.com; s=arc-20160816; b=D+6AjO4iw0NnIWlFVCpT+VdVtNmRXPphJ0fLeqvPps0MOTRCH5txY63O8Ea6J5uEuc JyJ+Wg/rHRiZFhNhcKUAapNkan9tMNV6alATZLseKryMsuAmeC5CQqJ8xvrGrwRJDvpw By5TCsOJdkA+fsrhcgAMWporIcJKY004pbgUxZFyM04GXOUQA2I29QGP1Jsl16HXZ/s2 XuZhDlNyuy9Dm6DaUFTWCk0/xToB5L/lFQ0xLp0s2sfwUtHSRwiL0i+1qu2eNeGNWmhq gb0c/1dnex/R338uZMXu6tnyIVOSAh/RA9vlM3VvqQcRVYot6GYoOfOqvyZIt3NqlJTD QAtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0+6/Ewb8CW5UwEFhxq3+XjTdI8H69MzsvTdOeTrNFoc=; fh=9W1V7exhOb7y8UrtKNqBdtZip0j9RypUYUA9yAglT20=; b=mZL2pLnQdtl9iCL5HIMeOkVearjRuz1yguhoO5SMPGOUoWo7B8mlr9EGyMZ6WiDJcL SzdsWcuSRBkmd4XBK5l2NRSfVco70wwWfu0PRqx0DFJMPOpqyrLeuXXJ2xclZJql6EuM KSVCrcc9oi7z0ZbFxVKlv1lw2QEE38j467DJ6kdvqEyKE9nqQFhKMyGa51CC9Uq7aGy6 V7+Sk5weehXC6jZiK7FmPcTOY8CRLnhAxSoVJ5w12/8GrStZWK1KYJ1Zex659aswaMAa 4iLDeVstLDSHEIkWOSP/Og3cnv3JMsUFQONrpQExRS7fOgtxeQsaXbv7cghA6YxWtF6i c6BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=mN6rfKgp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l11-20020a170902f68b00b001b8a7588efbsi505828plg.564.2023.07.05.21.39.21; Wed, 05 Jul 2023 21:39:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=mN6rfKgp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232690AbjGFDqR (ORCPT + 99 others); Wed, 5 Jul 2023 23:46:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233002AbjGFDqQ (ORCPT ); Wed, 5 Jul 2023 23:46:16 -0400 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A8E019A9 for ; Wed, 5 Jul 2023 20:46:15 -0700 (PDT) Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-4036bd4fff1so190941cf.0 for ; Wed, 05 Jul 2023 20:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688615174; x=1691207174; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0+6/Ewb8CW5UwEFhxq3+XjTdI8H69MzsvTdOeTrNFoc=; b=mN6rfKgpcNjak7Axni12ZY6Wk8AwXxOEoZcKwn3D6Sa5SW8IY24aEKK1mVTR429Lfp ItRJBvIY02HblatSRe2TZJIrobFqPVZqallzFmZVUXYDCbVBmMXzYDVy/he4OXA63AVP U4ePOEC6p+4hlvrx9HsJ/eQZ8ET4e9P6IeqbMghhkANlznyKoIt40kKZVBSPIJvKt1/Z WTv+lXEGTlP8i0SwC6qof5B0tzZjjWY6+7daVwz/YG4UYp9YY2Wd6xhbkHZrggk6JNQ4 X+tbMUbuB5btk/A6eumcLsHJLe66PwljLnwb2zsxQ4Z8fLORqFH0/6UfloZqBoTY5zVe cE8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688615174; x=1691207174; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0+6/Ewb8CW5UwEFhxq3+XjTdI8H69MzsvTdOeTrNFoc=; b=JiqLFpNQsW3Rim6yeo6VrF7/VRgseWlr6qUmCFhsjKFKsRfAxzPL1Xpy399zIhOXe5 il2Yjmleth2L9mVcBCx2TCTo2zww5yQ6oYyrDo3RskRG0du1zsnXZjRJ0E1qjOx8o8js F8R8AUBVpkq03sduuYMKNETvzJ42zwMybErfxhYSwHeh1GFjn1ABUrcSg74cQM7FJ2CK xSVKqxFvnO9wADzzkAffeC/ipblrKeBN+UJuA5OHZRIOtFN0tZQqJqvfpaoqGbl7vTMG 03S+RtBaGwUu2elwyPHJ03Z/ak+3U0sMGC/4HEN/zu1KUCERZM6guCp/7YioGrB+316g TEzg== X-Gm-Message-State: ABy/qLYYJzrDhGG3hU8GxoO/QFJCBECRXtPFcVF5MruVbxeUEztYuYdC +asBvDtSKWVvUqJaPXZ7kbaUbYKrmv9WQWpeaWud X-Received: by 2002:a05:622a:1999:b0:3ef:3361:75d5 with SMTP id u25-20020a05622a199900b003ef336175d5mr35107qtc.11.1688615174355; Wed, 05 Jul 2023 20:46:14 -0700 (PDT) MIME-Version: 1.0 References: <20230706032257.1662-1-duminjie@vivo.com> In-Reply-To: <20230706032257.1662-1-duminjie@vivo.com> From: John Stultz Date: Wed, 5 Jul 2023 20:46:03 -0700 Message-ID: Subject: Re: [PATCH v1] tools: timers: fix freq average calculation To: Minjie Du Cc: Thomas Gleixner , Stephen Boyd , Shuah Khan , "open list:TIMEKEEPING, CLOCKSOURCE CORE, NTP, ALARMTIMER" , "open list:KERNEL SELFTEST FRAMEWORK" , opensource.kernel@vivo.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 5, 2023 at 8:23=E2=80=AFPM Minjie Du wrote: > > Delete a duplicate assignment from this function implementation. > The note means ppm is average of the two actual freq samples. > But ppm have a duplicate assignment. > > Signed-off-by: Minjie Du > --- > tools/testing/selftests/timers/raw_skew.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/timers/raw_skew.c b/tools/testing/se= lftests/timers/raw_skew.c > index 5beceeed0..6eba203f9 100644 > --- a/tools/testing/selftests/timers/raw_skew.c > +++ b/tools/testing/selftests/timers/raw_skew.c > @@ -129,8 +129,7 @@ int main(int argc, char **argv) > printf("%lld.%i(est)", eppm/1000, abs((int)(eppm%1000))); > > /* Avg the two actual freq samples adjtimex gave us */ > - ppm =3D (tx1.freq + tx2.freq) * 1000 / 2; > - ppm =3D (long long)tx1.freq * 1000; > + ppm =3D (long long)(tx1.freq + tx2.freq) * 1000 / 2; Huh. So yeah, I looked back in my own history and this has been there forever. I'm guessing I was intending to average the two samples and then due to reasons I can't remember decided to just use the first in the short-term for some debugging (with the second assignment) and committed both. I think it should be safe, because if the freq values are not the same the test will return SKIP, so it's unlikely changing this would cause new test failures. Acked-by: John Stultz Thanks for noticing this and sending this out! -john