Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29955701rwd; Wed, 5 Jul 2023 21:36:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlGSt6YRTEu/UmqSGf+ROG/g1mxXPcGNMSEE/yGtGAQTAKAH823CKbvKO26z3Nm6MUfFf9Fc X-Received: by 2002:a05:6358:4311:b0:134:d030:e5ce with SMTP id r17-20020a056358431100b00134d030e5cemr903192rwc.24.1688618211149; Wed, 05 Jul 2023 21:36:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688618211; cv=pass; d=google.com; s=arc-20160816; b=0LFfWlbidqKgcgU6zpCLXLL3yV1/71wUK2aUk8AWuiznuHMEL9f2IediqQN+OpgrUq w1x6W60MDRir9mEHbW4cKwOK6CWlk7Zof/4R0e7FRtEsCg/S5zIlpWw65WNDVkb50qAA m6TMd+ZqHKRFjkGnRMlyaGEY+eN6PhOvAOIJe89YbfjnbFR7gxkONQ/bZ312hUZCF6bf Dg/iuqZqyk2XyOFFNUY30m0olKszpbg0cTe+KCtlVmB42ENUPTyl0ZkF9Ft9SUo62cLw 2M2mHDOLCnsYJZBs0qXPCXclXQwP+J0fRDHa366mRSvDZB5keJRCBm4eko82C2R6H+gs M9bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=5fXqMAuGgWsWpMHc6eR6GFeNoMEn5c4MVLl7rQGKEes=; fh=oh4DdSUYYvyENRTdm4iQRTOdrxOTO8t5T+k9rsNLass=; b=T/5ZojaVEAGdMTkY/OYI5O/9Zw7+WR/eqtaHpXmC+iG+8SEeAP+t88J6WqUKfNhtlw aguGT2BtOu2B5+b3SMJAfTlfVeOcvW20+ATz02tYoOckCGGd++VoIQnOBbuYhb4QYFFL aeql0FLSFahZe+Nvu2lWAUG/l8dCGOw54jZb6Fk+26fpoJjHJiomyyRf25ir9XvL3SCD ir3H3vihYug7ON8WIYB8njjssGD/laM9ca3DzzfuMO7/1rYJnuhigoNnHX2F0kskcM/O iP6miCewft+07ZbSDEMxpbIYlMERmJm8WwApeF/C+Pq+RHHPyBZiK3CfyuMMmhC29t1O t+YA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=fEwtc8GR; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t7-20020a170902e84700b001b80ecdcb88si558850plg.473.2023.07.05.21.36.38; Wed, 05 Jul 2023 21:36:51 -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=@vivo.com header.s=selector2 header.b=fEwtc8GR; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232890AbjGFDXT (ORCPT + 99 others); Wed, 5 Jul 2023 23:23:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjGFDXR (ORCPT ); Wed, 5 Jul 2023 23:23:17 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2097.outbound.protection.outlook.com [40.107.117.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79CEC1BC3; Wed, 5 Jul 2023 20:23:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LZeeqz2PUf2wXo5MdcMz1TUIzG38Nry1oEZSjMRe3CIgfzaOl3gQNfkp3/ep4zjn1O2SAg4dkqw34a+Q4T/wvRzOvxQXDcbpq3sPKAqLK+oTi+7D/76PfgOxHmd2OyPG64J1bGARglH+UlQMxr/7IJqu4HhiXyvCdsEmiH1Fv2KR2eoXGDmjr7GrClKHaa1AJdM78Wpjx+FdlyQqBua7XkYN2xjLX6pk4qG+GrZvrR6Zy5vvUja22fwvFUkL5S5+XZ2JHbGL0FAwSlei/nPbcvVd41whfbn0ezDe0AhhPjRUEo3r1NYl9a0hPZEl0/nq88bW3gz7TQ++79vb+G7f0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5fXqMAuGgWsWpMHc6eR6GFeNoMEn5c4MVLl7rQGKEes=; b=BZ13Ytok6qeeoUmmSBhvdnGFpFudN/gf4pfVWjmao/ft7zcTRW9YIWjRy3OsEJD27XoqFl7SwkE714HodNFY9gqw1NY210xIEYR0eX5nd+ztbkH97AH/PllIlmjX22oT9vCJ2DGurLFlSKd6tp6+X42Gvg81LOOxBzk6mQYVXySie+E37zWWX+B4sarfXnUpHXzj/vQKO+g5JKI5NdQwDpek2si84yPEPXEEEWNwwtikiRhawuQ1sEh1nuWkcQQx1Z96emaCoJAQxiPa3DZprsExtbVC73fhsJUeGP3jG82ZdVGqACxxWe7Z//IoUndUv6SGdct6T4BLAKgtebJOzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5fXqMAuGgWsWpMHc6eR6GFeNoMEn5c4MVLl7rQGKEes=; b=fEwtc8GRpXYRFVLVFv1vD5oH4czlOM4Te7fVZHodKfSzjSWc1cekyjiKiZIg3diRNQuN8n00SGV2JV44ezaIKBFm5tw8PtmBRe/tKfC1FWKlvWF9K/n8Y4X6MZG5KuGATx/731egHtsYvnZ2grPltIgWtQH8pc4SN1RqTNOP1k4dfI0cu8nlOJxThowelnQpq1hSHCp6jNxzVHb6G9UM6cyBxZxZCoKRBcTfUhecwm5cUy5vWlEiRX7b/ZySfjJWfMCRyLOfw0xENGjWQ1rlcv/llD3mOlWcvwExhiLmGmxkpxymfSfUqo2RzjhXsOK15E3+gf+brDTURlAuwPhhYw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SG2PR06MB5288.apcprd06.prod.outlook.com (2603:1096:4:1dc::9) by KL1PR0601MB4483.apcprd06.prod.outlook.com (2603:1096:820:7a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul 2023 03:23:09 +0000 Received: from SG2PR06MB5288.apcprd06.prod.outlook.com ([fe80::c2b:41ab:3b14:f920]) by SG2PR06MB5288.apcprd06.prod.outlook.com ([fe80::c2b:41ab:3b14:f920%7]) with mapi id 15.20.6565.016; Thu, 6 Jul 2023 03:23:09 +0000 From: Minjie Du To: John Stultz , Thomas Gleixner , Stephen Boyd , Shuah Khan , linux-kernel@vger.kernel.org (open list:TIMEKEEPING, CLOCKSOURCE CORE, NTP, ALARMTIMER), linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST FRAMEWORK) Cc: opensource.kernel@vivo.com, Minjie Du Subject: [PATCH v1] tools: timers: fix freq average calculation Date: Thu, 6 Jul 2023 11:22:57 +0800 Message-Id: <20230706032257.1662-1-duminjie@vivo.com> X-Mailer: git-send-email 2.39.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TY2PR0101CA0034.apcprd01.prod.exchangelabs.com (2603:1096:404:8000::20) To SG2PR06MB5288.apcprd06.prod.outlook.com (2603:1096:4:1dc::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SG2PR06MB5288:EE_|KL1PR0601MB4483:EE_ X-MS-Office365-Filtering-Correlation-Id: b0254a2b-32fa-4f8b-ab20-08db7dd05270 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pkRtRsETtO7wG++sO4xgryMc7bPHZgJYB2VDOtAIJ2A32G8qrZloYFFxQUOSS/pYwCN9bhEre67NFdIwCy+xEk3Ldto36BtEeAISXdv6pfZjSPmrqKgoF6w3Y5kvpSgxSEyTbB27WB9Nt2QGFK2fVHmJ7yO4/tZT6QZR3YYQz4femQXEZZlsz74JjmrH0Nj5889IiBCxLZoIbJEvDYURiIdUbaY7Z/ZTID1YKcmeW3RZyWesn9M7t/+Z472CdDru+HBEcTFwbnYet8EGyErfM6DoVfjeqxe8Rodb2uG+NoYEF17RDAcn9Lo1PgpwBr02xkhOLN43qQItgVAEa+dX3MGh4sDnQrf5Q32QDbCB1AUFtddt88Fmox+sHi0Akp2awoObluMDrpyDToEDh15Bp3FJxU0WSFDe1TT6iGMR1J1tfzRf0hL5tBpoPAKS812guU6Q4OFFIJP2mWJxlaWPWBzb4QJiotvTlp+E3SaQrHrAoqmekipdtZntFWoUFVNlabeQJkfMZvf8Z/jM1wtbbD5bOrEksJphofax92N+zKa5heDFnJL0QU+5EgofBYNRKq53asOFaXb3SGiZv5LI/9ABdgAUyH0aMykKhSRtjM1RUxdNeJ6vjEFcjFOFw27k X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SG2PR06MB5288.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(346002)(39860400002)(136003)(396003)(451199021)(66476007)(4326008)(66556008)(2616005)(38350700002)(107886003)(86362001)(186003)(1076003)(6506007)(26005)(83380400001)(38100700002)(66946007)(52116002)(6666004)(6512007)(478600001)(6486002)(110136005)(36756003)(41300700001)(4744005)(8936002)(8676002)(5660300002)(2906002)(316002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?+c33Wy5dlXaWooo77HIjZXyqSkHzGTqjTtl/esI0wxBSVtCVhcX9eK67BWi1?= =?us-ascii?Q?d15j7Sr6yWHCzYzLoPpu6y9E40xOYA/JqMm3XMInMTG/RqKi75PY9zxXAJjC?= =?us-ascii?Q?7Txb3s7C8hGJQJFpxvUgOkMUZgYhb2HofJEk6UTIbwXZrMDpteJqUbQ/1ied?= =?us-ascii?Q?XdzsKNLsVtNlUjA6OmKNd3VUWRMDN+MNYeDhOYVOxvOtHtNtKIeS1DndHGop?= =?us-ascii?Q?LfPS0DZVmQduwP2rXMxUIGHeFNK30VmAgi8jvHbm5QfmYFV4d/AL7pXGbFiA?= =?us-ascii?Q?eGlXTvSUucRSJ+GS+v6o1Wx5DDOJv+yTPVVE3RtUFrgMTLJLJYPJTw7bYttU?= =?us-ascii?Q?svf0UerEexIlrpLl7Bh14EfT33cKCGy/V9N3y4VEhT2eXP0DDw0eMbZS8Il2?= =?us-ascii?Q?ZapjBif6h1e6yTZs08ymqSHE9f//U/frJq0yRJv6KWqhb13cLFTkzSOhd3Dl?= =?us-ascii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b0KIjir823e4asyCHY94Zmd/AIyZsTezGEKNGWjHr9w?= =?us-ascii?Q?0xGVMdYfJM3oMAYN2TmmsobuiEPnfS9a553WpiiNNM8y+zQB64CJ1XKlXF8N?= =?us-ascii?Q?LRSgYgNpSXf9H6QlD8tiaIVxUEF9e+uFG5QoB0lrULwbSHfuCqlTFQHwHca3?= =?us-ascii?Q?zmUyksvR63PdxBO65Zfz6TKxfTQJCgTGgoEJxeH1CbgBSutVz+Vv609SDNDT?= =?us-ascii?Q?mKZ8gxQ64G03EiNLc0vfJEZZVySDslHtv2aVHXu7?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0254a2b-32fa-4f8b-ab20-08db7dd05270 X-MS-Exchange-CrossTenant-AuthSource: SG2PR06MB5288.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 03:23:09.5113 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1Micx05XX1kn3VBFt5Zm5+pKQ/wiG0JZfgpOrrQXW4QOgEvP2ZtEOQa4oVuzFqVO6CWgqUdGpFdB185MqFgmjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB4483 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 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; ppm = shift_right(ppm, 16); printf(" %lld.%i(act)", ppm/1000, abs((int)(ppm%1000))); -- 2.39.0