Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4550687rwj; Tue, 20 Dec 2022 11:40:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXs3zaoBsvi3dZtQl3A2F+ep+jmyiuv3VAFSCOen6E0B1daSpSNiSnNKoCsH8BI2rKtvXv/d X-Received: by 2002:a17:902:f70c:b0:188:6b9c:d17d with SMTP id h12-20020a170902f70c00b001886b9cd17dmr15242718plo.16.1671565243426; Tue, 20 Dec 2022 11:40:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671565243; cv=none; d=google.com; s=arc-20160816; b=XhejNU2MHMnQyoJ6cuvz1OMjkE7ond0pR3ToPUiwOubS66Dr/6rtpaFJzJMvoNoHGD xTd7YRN3L95mSqcr2vooJhT1tuGh3Lpk51QIUSwr0DDfLVhJZ3oYnZnobK0+UPhBFJKo epHj7rxMd+sa64gkQsHMDTnYpm/IGCXdwqKthxuWcIEt8pdHO+Ayr2iCYyazckCAy+lL AZ7f2WGtqUctHVQXCU2GAiwC+Wegjdag5ANT0NxQxVFOSChG17zb1aG+bRoqdaghCOEO p3MS8QJfEgv1c/nGViDWxYdryeq+QwGYdV8Q48+D0OcYxXNCxRJcaG+nPOcmQ5av+sb6 1hBQ== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=/41rGcQUTJY1m/KT+2QCSMVcUErszhLbrjwhtKx7G9A=; b=NqBjuUvh4XKG0+zwavNY/cigZSVkRauzbuZ8QVgeNokMx1sEhpzKYL53+ZX2Lo5bAm sowYznngMrB0q2AYKkk/BiBmsCiWUjVKBm9ysc/80POtArj6r2/fG2dw8Ug+KKZ5qjKo +MltEvTRY8YE/QiCrR0WjFXBp3exK/iXrJ6w7XSU83PgD+iJmnKy+F/5srDAddP8lTfI /WXG6r9kb/LhXQgF8gvfL07GbFykeNeN1szb/PZ2icL1g1qCeOYRZlps8XyD7M415EKQ By8Qr05soQUbfVGoVKg+QiFmVmzylyJICo4ZohHqTuOOtuU0DOsx7eCb25cNwPPcWcLg KDIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FiM5Q6mE; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3-20020a170902e48300b0018659963cdcsi13501226ple.514.2022.12.20.11.40.32; Tue, 20 Dec 2022 11:40:43 -0800 (PST) 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=@intel.com header.s=Intel header.b=FiM5Q6mE; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234036AbiLTT1O (ORCPT + 68 others); Tue, 20 Dec 2022 14:27:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbiLTT1L (ORCPT ); Tue, 20 Dec 2022 14:27:11 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C121E15A12; Tue, 20 Dec 2022 11:27:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671564430; x=1703100430; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=JKi7Gbk8QaG/Kih0RcBWajsCoTFOfbRBkS4nokxwglo=; b=FiM5Q6mEnvFgXc1oVGo91q4SCN+FQQO1XHDFBYy7U2ukRChYxMQQd0pY npFm8QAQBfxwBcZU5KqPI6FaEjfAUKKxYteJYrF/DROC+EC5lO+K+/LBN NpLBvw1dSD2RGE7N0aMG6sNmsTCH6HMJ+yaHFBVrUZCuEFztTt4bIJ8fh LeNeVjdzPpEb8B9Nfmqmr6+EkZVp21BU/4eDQ4nBmjHmlEy7CrZAlGkoA ZKuNzHRtQ4eJACHyKaHllCLCL/6Jo183HSwnwtM8bFXkFsvfCMa1alY/B mzczSgWCp3ypr1wYOXd3JDFUb+4T81gZ6/yiRp6vbhWNeE12sOzd1VYDw w==; X-IronPort-AV: E=McAfee;i="6500,9779,10567"; a="381924653" X-IronPort-AV: E=Sophos;i="5.96,259,1665471600"; d="scan'208";a="381924653" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2022 11:27:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10567"; a="825387496" X-IronPort-AV: E=Sophos;i="5.96,259,1665471600"; d="scan'208";a="825387496" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga005.jf.intel.com with ESMTP; 20 Dec 2022 11:27:04 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p7iGU-00D9UL-0K; Tue, 20 Dec 2022 21:27:02 +0200 Date: Tue, 20 Dec 2022 21:27:01 +0200 From: Andy Shevchenko To: "Hawa, Hanna" Cc: wsa@kernel.org, jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com, jsd@semihalf.com, linus.walleij@linaro.org, ben-linux@fluff.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, dwmw@amazon.co.uk, benh@amazon.com, ronenk@amazon.com, talel@amazon.com, jonnyc@amazon.com, hanochu@amazon.com, farbere@amazon.com, itamark@amazon.com, Lareine Khawaly Subject: Re: [PATCH v4 1/1] i2c: designware: use casting of u64 in clock multiplication to avoid overflow Message-ID: References: <20221220164806.77576-1-hhhawa@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 On Tue, Dec 20, 2022 at 09:23:53PM +0200, Andy Shevchenko wrote: > On Tue, Dec 20, 2022 at 07:43:06PM +0200, Hawa, Hanna wrote: ... > return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * tSYMBOL, MICRO) - > 8 + offset; > > return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * (tSYMBOL + tf), MICRO) - > 3 + offset; > > return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * (tLOW + tf), MICRO) - > 1 + offset; Thinking more on this, I would probably replace the order of arguments to make it ' + offset - N' in each case. Since plus will be on the previous line and become first it will be easier to parse the arithmetical expression. -- With Best Regards, Andy Shevchenko