Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4404166rwj; Tue, 20 Dec 2022 09:37:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXvKAZqtc+MmtgOMWYp6RzQx4Qkd27oKWMaWBZ5ZmeDOmW44T1hSe9rS7BHSuV87G8BhEP6I X-Received: by 2002:a17:906:5012:b0:7c1:2e19:ba3f with SMTP id s18-20020a170906501200b007c12e19ba3fmr2504896ejj.57.1671557876228; Tue, 20 Dec 2022 09:37:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671557876; cv=none; d=google.com; s=arc-20160816; b=QVb0FHfIzKcSO57DNd4O7a4U/zB9dbeZieigoCLH2OsHhRn7yPIp3FyQ48IgMgAC1e JNnYiXyH9HtWop7xCdeXBYUN8zmUYLolvINs0o1PV6s/YHQHIWKHte49rdz7Na8fC6KU CJanhpDvi9RgAYRgU97ZHobrT8ZJVzgUTjU5YZTvZMapVg8HIfiBpjy+Epo2I9Qm5Bra 5EueNllg9AY92oP3Kc5t8su052k9pLVNGE61oEkhEXI+Neyl5kc7cTQXrdXKHk13LLj4 x3Q9oe7R/J0i+/BqGmBAaiHBVy0o+507sjshUlL1Io9ES4Ii1nz+FLrxDvXMOgBWKf7J wFxg== 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=i8XKWwO0AmtZpgRZfYFLKk2GP85T/ajoYW3nrD5v95g=; b=Cb0W9kz0S51xN2225EWuXXgW/rTXvfMZGlUfoVQ1JwZdP+mhDXHtzxa2QEsUZGnv/K Jlrl0XlGMGEf8QziHXxs7DambxQL3EA51pyW4LLn0gvS1jvkSjKZwvzwH9FWwGdire4J ElY5Zc9sp00RN0UgbrLgCJut6wPUIeSefIFFU8QiijEnTqSXh/OddVNgBDO14l4oPHpk mWiKsbu06UocXGEYby8J+R+c0ORkA0NuIm+01YCgV4yVByp7fctPBfUExBOH00BIo9Oe 38IMnphZEtwSuujLODqVsTlNQTOETZFpxPux08/xHm7qsY2mzcFkxY9rn0Gp86E1bjFe 9JNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iX+O1lYD; 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 sa27-20020a1709076d1b00b007c16425c86esi12443222ejc.276.2022.12.20.09.37.40; Tue, 20 Dec 2022 09:37:56 -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=iX+O1lYD; 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 S233903AbiLTRR2 (ORCPT + 69 others); Tue, 20 Dec 2022 12:17:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229575AbiLTRRZ (ORCPT ); Tue, 20 Dec 2022 12:17:25 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB74ADDD; Tue, 20 Dec 2022 09:17:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671556644; x=1703092644; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=xu0kNEDcfd1J1zT07SRIJFWypFJkTEWrkOXrQpKSv30=; b=iX+O1lYDK6SapC0yAsx0PKkSgo+cJiV+aNZ7b466U52+1gB1YwnGUrbp vwP5RKmTqtLnFH58q6/IXKaT5x+76fXNJLRDEgc712P3VOGtoPV2WdlNZ 0gm/G7KeSwf0QootFKV/LZKU6XG85kM77/UXTadCoZTVC8gLmTPRr79ke LKo52lKRT/wSMtUv1L9cZ20Enr5QPKXg9l+bJLf3doT8Efy/Y44PINzWK 4KyJXJZ1ILhS+qW2wObogX/BLqheTm6KhQCGaYklMEGANh6ixbF0RN4sN lqE12QHWCZzJlbGz0bts0+5n1oBmo1huxhsaFr7zdbZkGizyKcd1V8Wm1 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10567"; a="318362673" X-IronPort-AV: E=Sophos;i="5.96,259,1665471600"; d="scan'208";a="318362673" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2022 09:13:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10567"; a="739847856" X-IronPort-AV: E=Sophos;i="5.96,259,1665471600"; d="scan'208";a="739847856" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP; 20 Dec 2022 09:13:05 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p7gAp-00D1Ru-24; Tue, 20 Dec 2022 19:13:03 +0200 Date: Tue, 20 Dec 2022 19:13:03 +0200 From: Andy Shevchenko To: Hanna Hawa 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 07:11:51PM +0200, Andy Shevchenko wrote: > On Tue, Dec 20, 2022 at 04:48:06PM +0000, Hanna Hawa wrote: ... > > - return DIV_ROUND_CLOSEST(ic_clk * tSYMBOL, MICRO) - 8 + offset; > > + return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * tSYMBOL, MICRO) - 8 + > > + offset; > > Broken indentation. > > ... > > > - return DIV_ROUND_CLOSEST(ic_clk * (tSYMBOL + tf), MICRO) - 3 + offset; > > + return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * (tSYMBOL + tf), > > + MICRO) - 3 + offset; > > I would still go with 'MICRO) -' part to be on the previous line despite being > over 80, this is logical split which increases readability. > > > - return DIV_ROUND_CLOSEST(ic_clk * (tLOW + tf), MICRO) - 1 + offset; > > + return DIV_ROUND_CLOSEST_ULL((u64)ic_clk * (tLOW + tf), MICRO) - 1 + > > + offset; > > Broken indentation. That said, can you just follow what I have said in a review of v3? -- With Best Regards, Andy Shevchenko