From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10DFEC25B6C for ; Tue, 24 Oct 2023 11:17:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbjJXLRr (ORCPT ); Tue, 24 Oct 2023 07:17:47 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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