Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2739792pxb; Mon, 25 Apr 2022 01:01:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxGCqWOgWQq8008oFHsBNeQpyc6/ojOvbmGiYpwbu0tdIofD/d6WiHRUIKNg+pP/T+YX78 X-Received: by 2002:a05:6a00:1145:b0:4f6:3ebc:a79b with SMTP id b5-20020a056a00114500b004f63ebca79bmr17781385pfm.41.1650873712456; Mon, 25 Apr 2022 01:01:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650873712; cv=none; d=google.com; s=arc-20160816; b=eSir0El0+/Oe0HoKgpiu2Hcv3qDntVePmDmKMrlY7mJQvBnBcx7HZ+qst3u2UfT1/x zTjMD2XoviSbXPwap6kLUg6V7RO8VkkEbHXSu6LJiAbtr/Xkzg1sm8lv/0cqMkqTj318 w5lnAQs6ifDVb6U1YprfnZ3vtsE2UCo0465/2NyNjVpTiDX7be5syWnkVAVzj4o1Fczt PByQj/+3dU83KJxDKnW3aBMPkPL2ZXVFmRvkWKQ3w1Rh0TJrAPxFEIYGtTu7iACJbsKb +E5qcGGKzNFn+9UCfE3TGvgCzP7ZiFqCoWe5k4p3XswUd3GyvWd2BlpK1jL6pVZFiaLy BYyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=m1PPoXDlcVr9ut+Vdl4Vs4QStxBg1+b6oUCL8m5nXhY=; b=vST9OMwbFtBSzp1FmHP5zUPRhpELJkyQPjP+3Ya/wBEDWkV8xtVSAyIgSOR9ye2tA/ x2JVoXbVbTmFJLP5O863CHpCSsVsYmlWEnH8lDo62tnU/iQmcQbCC/pOZcDUlSsKx4Hw TQhxxL+UDm58pFngKpkujUZMJrssGJ2oGUF2xj4Rft49UgsDO9HorcoJOudGIpwu4RnO /uueYMKBZNGAZ0U/vzzH064UFk45c7FORp5UV+5e12Fmm2yp1GnxXa9MyoYkHMIlN7w7 EGWjr1d5i7+J3BnueLegF6bPiyW8xVDpLuM2De82Y8S0TnEVe9Lvi4hAxulBLASFDN/x rarQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc11-20020a17090b3b8b00b001d2f07c8f08si15952978pjb.167.2022.04.25.01.01.37; Mon, 25 Apr 2022 01:01:52 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239384AbiDXLum (ORCPT + 99 others); Sun, 24 Apr 2022 07:50:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239369AbiDXLuc (ORCPT ); Sun, 24 Apr 2022 07:50:32 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7AEF8136E36 for ; Sun, 24 Apr 2022 04:47:31 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id D4AA79200B3; Sun, 24 Apr 2022 13:47:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id CEE6592009B; Sun, 24 Apr 2022 12:47:30 +0100 (BST) Date: Sun, 24 Apr 2022 12:47:30 +0100 (BST) From: "Maciej W. Rozycki" To: John Stultz , Thomas Gleixner , Stephen Boyd , Russell King , Ingo Molnar cc: linux-kernel@vger.kernel.org Subject: [PATCH 3/3] sched_clock: Fix formatting of frequency reporting code In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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 Use flat rather than nested indentation for chained else/if clauses as per coding-style.rst: if (x == y) { .. } else if (x > y) { ... } else { .... } This also improves readability. Signed-off-by: Maciej W. Rozycki Fixes: 32fea568aec5b ("timers, sched/clock: Clean up the code a bit") --- Hi, I guess this got broken with 32fea568aec5b by mistake. Maciej --- kernel/time/sched_clock.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) linux-sched-clock-rate-cond.diff Index: linux-macro/kernel/time/sched_clock.c =================================================================== --- linux-macro.orig/kernel/time/sched_clock.c +++ linux-macro/kernel/time/sched_clock.c @@ -202,13 +202,11 @@ sched_clock_register(u64 (*read)(void), if (r >= 4000000) { r = DIV_ROUND_CLOSEST(r, 1000000); r_unit = 'M'; + } else if (r >= 4000) { + r = DIV_ROUND_CLOSEST(r, 1000); + r_unit = 'k'; } else { - if (r >= 4000) { - r = DIV_ROUND_CLOSEST(r, 1000); - r_unit = 'k'; - } else { - r_unit = ' '; - } + r_unit = ' '; } /* Calculate the ns resolution of this counter */