Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1593934rwp; Thu, 13 Jul 2023 13:21:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlHDaiLFo1evIXWJ/nY6OJ9ppGlij/9VtmI4qKtV/bfDqL1hLiwQVWliJZYGIxZGDVEKuj+c X-Received: by 2002:a05:6e02:112:b0:347:5ce2:b996 with SMTP id t18-20020a056e02011200b003475ce2b996mr2571123ilm.20.1689279708942; Thu, 13 Jul 2023 13:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689279708; cv=none; d=google.com; s=arc-20160816; b=WEvQJKsAoQHJMCMLuojmDUneTeHKKFa2g2lHiXEMr0Zpp8paQN7woGwyQdcO36l7Mx /hYsNTEYylo8Tw37653065fs84Ft4ooPv1BM9DM4qkUo+a7v64lGpKkmKQ6IU8hTHcZ2 h6P5eWH52ey0DwmwJdM5eBOSbl+AQYRSWXLfDTW7UoNqMYa8Vwv6p2lWaSpYedgBvbQJ suK0nO3+2+n7fsb2m2GnPxBhxsUqF2/pFuoYxBmfuaZxFpUGNt+NIAACtCWm4Txr917X Gx5rOgRKwbhZafoTlf3bFRyUZdJRIWau+XCHUQjUDQBgCjtZimRmv/KGOGqQtxn7CBBq Oy7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Rsorryzax5Y3bPybZVINyEhtRW0LniXcZ10eoX/oXNs=; fh=XThrGQZDPag3DSbyux4L4NK+p78brovYfD2PONxNt9A=; b=u0fx1dUzDgaOMD8fO1+v7w8HZCfYvr1f2yytJod5TQeNqodfQ5155iAYy4JQhQsFn6 eGWdeJCT7NFrXLfYVRXgUA/zeG7ZdF/RPkrLxsjiR4HAJlZAq0XDX5cwmUbl1TqwPhq4 Wem3cFy1IDCMfvnqv4xm1zGagIg4EohEUFdfZxQFH4Fr/TOFtqcdDwrfSRfEWgQ5rH7V OagR85MHqu1HQjETA/5viwB9Qv9Opgc2PvRuL6rMmsPM0wGTYUOFZdFI4qQ25S4lpsBX lEH8WPdZXmYJP0w1xhoKXILlAx1EhLXZBNNGsCJGXRpqK7Jn7fbJFV3X9SaHdnyLfa6W e5xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Wlpj5dG+; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ms19-20020a17090b235300b00263deaac48esi5811469pjb.8.2023.07.13.13.21.36; Thu, 13 Jul 2023 13:21:48 -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=@linuxfoundation.org header.s=google header.b=Wlpj5dG+; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233101AbjGMTdx (ORCPT + 99 others); Thu, 13 Jul 2023 15:33:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233121AbjGMTdw (ORCPT ); Thu, 13 Jul 2023 15:33:52 -0400 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B3C82D43 for ; Thu, 13 Jul 2023 12:33:50 -0700 (PDT) Received: by mail-io1-xd36.google.com with SMTP id ca18e2360f4ac-785d3a53ed6so13470039f.1 for ; Thu, 13 Jul 2023 12:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1689276829; x=1689881629; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Rsorryzax5Y3bPybZVINyEhtRW0LniXcZ10eoX/oXNs=; b=Wlpj5dG+wbmOlRt78R8ZsYTt2KGnZ4b+1ZOW35Cnu+YaI36KwgaNBwZq/4kFw1dhdQ c+Xj5t1BxQ/tOspHvzpnxbPQD6zDQhf9B6CXvLY7+Vns7yx4OPsE3xI6soIw5ndMa20s 5DywhV7tv+AgZA6ox08cHS7T72Qn+231KUHbg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689276829; x=1689881629; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Rsorryzax5Y3bPybZVINyEhtRW0LniXcZ10eoX/oXNs=; b=JuoaWHqcnaFb33ixfJ9kLnYHzuhVI9uOrN5OmiJ9ncRq2hgjZ9LKmQe7GUekBRLkHu Arys/tKPKrUwKifJqZZx48qGDVMg66+35okXcq/kQsmiuLteHf8Hquk4IyNiv8lU/Ksl aNctcOVJm5pQy7BqOpAbH6+WwjzYXi1CCh2g3gZH7Y1dd24f+Ze4MZoL98XqyStWm1PX yb61dqge1SmW9s9Dg97egP63/1W8jCghSVnKyGf+7ExTIFOlaKSTqWjqSSY9v2PIursI yr0nxNYpGFMG+3oZ+jMUxZLjlXWxO+wCqavQnReOdt5gK09kneLq6BoVgdQ9ZGIQ671+ mrVw== X-Gm-Message-State: ABy/qLYGb6T3Z7b+9tI/VAAMxyjgJtsxTYvgMb0NlepJ9qJtIzfrbvMR RztO8gjBhsK38QLv1LF6YrtdJ3fgXGOf8BQ75WE1NA== X-Received: by 2002:a05:6602:2762:b0:780:d65c:d78f with SMTP id l2-20020a056602276200b00780d65cd78fmr2869824ioe.2.1689276829390; Thu, 13 Jul 2023 12:33:49 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id h8-20020a02c4c8000000b0042b761d2594sm2103883jaj.125.2023.07.13.12.33.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Jul 2023 12:33:49 -0700 (PDT) Message-ID: Date: Thu, 13 Jul 2023 13:33:48 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v1] tools: timers: fix freq average calculation Content-Language: en-US To: John Stultz , 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, Shuah Khan References: <20230706032257.1662-1-duminjie@vivo.com> From: Shuah Khan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 7/5/23 21:46, John Stultz wrote: > On Wed, Jul 5, 2023 at 8:23 PM 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/selftests/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 = (tx1.freq + tx2.freq) * 1000 / 2; >> - ppm = (long long)tx1.freq * 1000; >> + ppm = (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 Applied to linux-kselftest fixes branch for next rc2 or rc3 thanks, -- Shuah