Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4586955rwj; Tue, 20 Dec 2022 12:13:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf41LKxD6GTBJKIoX7WyKiTp8JuI7JNX7OiYjoBmc1AhVJI5X0vxtkOO3AeCvro0xVomdKlr X-Received: by 2002:a05:6a20:7f89:b0:9d:efbf:6622 with SMTP id d9-20020a056a207f8900b0009defbf6622mr78036295pzj.48.1671567218649; Tue, 20 Dec 2022 12:13:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671567218; cv=none; d=google.com; s=arc-20160816; b=w3WonCo2ggb71Th7D+IhD2yVzBcNQTyBp+98mF8RMc/JUXD/eyW9+cEOaW/KkjaaAW zoMhuOHhvdYkpT/x4mJBRNYsazUNWHSjzSRUQEjDVPaLa5xl379j2Zo4Sa9+ZZzQY2c7 wZxahbQzaswHIIiJXwIBNPf7GUXh26wdNBTMSnfV9WEo2TalQ/L5GRG2w9NTI8WTuTv6 qvgVuEMdkrsJ6c7hTfKYC6XwmmJExwZ49K4vqWR81LebyfukXccY9n9dOAsuNtyXd6dS UBHGaeVujjRpivyDGgq/5ubEVKIyJ1rM+RVmnjuadzoMVvWSg9mYgWSgUrfrCxEq0U4O CX2w== 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=WydRiGlmPoChM5/2tXDaRY8Ux+cMfsib8BQWaNIuShE=; b=b5r/a59TeibikrNt2ZrSvUsa8GOuKmz4lIHEdH+4lBdE7UIgadYzyQmZMdYd3Wjt3L JC0vuo7h6ILJI6yEo5pzRp4MuTVFgVNPkqrT84BVAgMKl2K6wUS91NYdF3iYXVyAUu+g +smtEQLQGfx0AtpEZvj6vJA3QfcJ55qrJFgfEKBcD5cn4AjljY9xDzLJ1QLSYMBuWIFE kO4HG52CSiyojsPBtVgJigZwxACtklq8mHZTWzlQxTY9v49pr5O44s/pE5zormiK0DEa pnTnEEEXvyOcit098i2QvZEte74qzR1mcrv2sW/6kAUi3QXcRyweDCocp4tNGLHwkmGX zK4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YgdpOu6m; 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 t203-20020a635fd4000000b0046b121a3246si15741631pgb.842.2022.12.20.12.13.28; Tue, 20 Dec 2022 12:13:38 -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=YgdpOu6m; 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 S234028AbiLTTYE (ORCPT + 68 others); Tue, 20 Dec 2022 14:24:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbiLTTYB (ORCPT ); Tue, 20 Dec 2022 14:24:01 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB30E12744; Tue, 20 Dec 2022 11:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671564240; x=1703100240; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=TNrcl6HyQDoGaxe0Au1HRzRI9AdANs+U7cJkYFrUXDs=; b=YgdpOu6mTkygKZP5ERGdwSUrBltlNLrh9uTcXXlEhPCbF/kNym09Xj6z xMYM7q7rZjqm58j8kTON85dDPsNLStbHh8dBBd217ibnft6pu9fUOXMGB qJh85+NnwCB093mRXSCHM0ER+KD66NSKmHmm1HVQk1CTJmWQYGm+bJsYT pfCA1314Xu0+KPuO0cPfn9QwYeh/OYz+NbpUSmf2JZbXOPqNkSfeWWeZ3 izR+EXeBa6Uw/6gf28DBp6iz+yim1ExY08rgZa6x6OYstx3kfcFbN2kQI 3yqTfib2Qe94+2zKZPpxmKcZIwgoHcey7evnXSJYOdioyai5/pBc8Nf8B w==; X-IronPort-AV: E=McAfee;i="6500,9779,10567"; a="307378264" X-IronPort-AV: E=Sophos;i="5.96,259,1665471600"; d="scan'208";a="307378264" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2022 11:24:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10567"; a="644572944" X-IronPort-AV: E=Sophos;i="5.96,259,1665471600"; d="scan'208";a="644572944" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga007.jf.intel.com with ESMTP; 20 Dec 2022 11:23:55 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p7iDR-00D9Pb-2e; Tue, 20 Dec 2022 21:23:53 +0200 Date: Tue, 20 Dec 2022 21:23:53 +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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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:43:06PM +0200, Hawa, Hanna wrote: > On 12/20/2022 7:11 PM, 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. > > Okay.. will move the 'MICRO) -' one line before > > > > > - 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. > > Why it's broken indentation? I'm asking to know for the next time. The word > 'offset' is not part of DIV_ROUND_CLOSEST_ULL parentheses. In wrong > indentation the checkpatch shout about it, but it didn't happen with the > above. The continuation line of the expression should go under the opening parentheses, but you are right, the part outside DIV_ should be under D and not as you suggested below. But the problem is that you made illogical split while I suggested to leave DIV_...() on one line and the rest on the other. > Does the below the correct indentation? No. 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; -- With Best Regards, Andy Shevchenko