Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1812648rda; Tue, 24 Oct 2023 04:17:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbKEYY8BHrVdhg0gDLZfuH9mB+DyYpyPcXhr4IX0vRsbBJejfePubchdUj/AoHMi8Oy65v X-Received: by 2002:a05:6870:498b:b0:1e9:8a35:863a with SMTP id ho11-20020a056870498b00b001e98a35863amr14332466oab.20.1698146272189; Tue, 24 Oct 2023 04:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698146272; cv=none; d=google.com; s=arc-20160816; b=inXeg9FM1tH8AvmvqRrHpJAv/v9BAiGkRIJvxE2q9f/83xAYD+AK5CGHHRXdqLBtX6 L+mziHxCfHswMTFOuy02hWq+nRZV/DzikSXX5sQca+6pDmX2X03zqP3OaiGSGmR4Ipx+ KVtTXdwVlYxGfGEtiDYPm6QZ9C54G/yW23WFl7u/uRb5bB4eO+HwZc/pmcbHtVlvcAYT Y+uf+5kT5GNF7j/1KZyXmEBicRfx4oiiw8c9sW8vML+tQqIOERapr0czc6PDBJG/LSVR cYrxMEPopiZLV7Nlnc9hyONrj9j0LiK/nJ/kSwJpE6q+jlCdYy+MGVq1OqWF0wzEt51J hrtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=y4ddwwoRZIf9GighcB9fA02i2O6mN32J+WAtRY++Rfk=; fh=lYO4CKITswMVjnOL7/57a5R9NP4hTxnuyDppX6Igpb4=; b=0llH/GVzpLjAvQIv5vYlW/snpsCeA+OzH74wtqD3m1h6pzK6TPvaqKzeyvJAwcUF7O lIFY73KWdI4Oh0Q2CO/+GX7RD/iafuHF2NBFSkaa3IMB3PJumYp3Xtud9m3Cp4za/Qfd iUsKegYs6Mm3QkgA/MqG1YeZjDTYXRuMHuW5DfsNk0SxIrlKaAAlPin0AK1g1PRqbxUx 5W8DAf+sca2CZkr2ST97aTatf/jGFJ8fV65xRJI9cabpWtmn1dkAQIYTXuVvd0RdkwDZ ozHuV17a27TU8+3/nbi2/VqT62usz5hbMK8eFj8JQE+6KgFEYjWfLriol+IzrRDGXdLe 1JnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BHNtX25p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id f26-20020a63381a000000b005ae776b8619si8403455pga.460.2023.10.24.04.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 04:17:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BHNtX25p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2B8E38068969; Tue, 24 Oct 2023 04:17:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229897AbjJXLRq (ORCPT + 99 others); Tue, 24 Oct 2023 07:17:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229783AbjJXLRp (ORCPT ); Tue, 24 Oct 2023 07:17:45 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E21D7B; Tue, 24 Oct 2023 04:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698146262; x=1729682262; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=yT3C7M/uPNjTrUCibeAzmCQLBq5xF4IThdbPcRCFoCc=; b=BHNtX25p9driK0xvzuo7A5z3P7nDwFqQvZ5L9VMbxN31Lge9Fz6DwElv R6/J98zc7/j9FYytYItXAMsaoCVjlmD/EOAABm/d3n4rqtncpt39/UDJO lUkrBMme+H1LLUMt+yjDK6i5vXYBnsuHelLwonsxGc7zjIWYjisGcVGhO pJLySIbd2WJnRn2+jwX6Y2AEXQ3qiRY2aSUmOsPk7WVu5NMQ/jtn4JAVD FfK+zqFE1Q1ToHGYCzk/lZQG40ufy3KlLCU2jO4iAn47pnY8O+2MkL0QZ p7wZYke3XNJ5rgcGQO0jkubBAUpS7Qp/vRF/sJod44d3TsZcf3vPhwuuf w==; X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="384234774" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="384234774" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 04:17:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="882091615" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="882091615" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga004.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 04:17:39 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC2) (envelope-from ) id 1qvFPk-00000008C7P-0TDP; Tue, 24 Oct 2023 14:17:36 +0300 Date: Tue, 24 Oct 2023 14:17:35 +0300 From: Andy Shevchenko To: Christopher Obbard Cc: Sebastian Reichel , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, stable@vger.kernel.org Subject: Re: [PATCH v1 1/2] clk: composite: Fix handling of high clock rates Message-ID: References: <20230519190522.194729-1-sebastian.reichel@collabora.com> <20230519190522.194729-2-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 24 Oct 2023 04:17:51 -0700 (PDT) On Sat, May 20, 2023 at 08:57:16AM +0100, Christopher Obbard wrote: > On Fri, 2023-05-19 at 21:05 +0200, Sebastian Reichel wrote: ... > > -???????????????????????rate_diff = abs(req->rate - tmp_req.rate); > > +???????????????????????if (req->rate >= tmp_req.rate) > > +???????????????????????????????rate_diff = req->rate - tmp_req.rate; > > +???????????????????????else > > +???????????????????????????????rate_diff = tmp_req.rate - req->rate; Btw, we have abs_diff() helper for this kind of cases. -- With Best Regards, Andy Shevchenko