From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamin Lin Date: Mon, 21 Jun 2021 13:14:46 +0800 Subject: [PATCH 3/3] i2c:support new register set for ast2600 In-Reply-To: References: <20210617094424.27123-1-jamin_lin@aspeedtech.com> <20210617094424.27123-4-jamin_lin@aspeedtech.com> <20210618035855.GB31659@aspeedtech.com> Message-ID: <20210621051446.GB27876@aspeedtech.com> List-Id: To: linux-aspeed@lists.ozlabs.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit The 06/18/2021 10:00, Andy Shevchenko wrote: > On Fri, Jun 18, 2021 at 11:58:55AM +0800, Jamin Lin wrote: > > The 06/17/2021 10:36, Andy Shevchenko wrote: > > > On Thu, Jun 17, 2021 at 05:43:40PM +0800, Jamin Lin wrote: > > > > Add i2c new driver to support new register set for AST2600. > > > > AST2600 support three modes for data transfer which are > > > > byte mode, buffer mode and dma mode, respectively. > > > > The global driver of i2c is used to set the new register > > > > mode and define the base clock frequency > > > > of baseclk_1~baseclk_4. > > > > - shrink the code base by at least ~15% (it's possible), i.e. -200 LOCs > > Can you describe it more detail? > > Do you mean I should separate the patch file to fix size limitation? > > No. Based on my brief review you introduce to many redundant LOCs (lines of > code). Remove them, refactor the code, make it small and neat and easy to read > and understand. It is possible to achieve! > Will fix Thanks > > > - rethink how you do calculations and bit operations > > > - better code style > > > > > Thanks for your review and very good suggestion > > I will update them and sent patch again. > > By the way, I received test failed email from Robot due to compiling > > warning. I will fix them, too. > > -- > With Best Regards, > Andy Shevchenko > > 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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEFC9C49EA2 for ; Mon, 21 Jun 2021 05:14:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D27C660FE9 for ; Mon, 21 Jun 2021 05:14:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229441AbhFUFRI (ORCPT ); Mon, 21 Jun 2021 01:17:08 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:18364 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbhFUFRH (ORCPT ); Mon, 21 Jun 2021 01:17:07 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 15L50DTC006012; Mon, 21 Jun 2021 13:00:13 +0800 (GMT-8) (envelope-from jamin_lin@aspeedtech.com) Received: from aspeedtech.com (192.168.100.253) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 21 Jun 2021 13:14:48 +0800 Date: Mon, 21 Jun 2021 13:14:46 +0800 From: Jamin Lin To: Andy Shevchenko CC: Rob Herring , Joel Stanley , "Andrew Jeffery" , Philipp Zabel , "Wolfram Sang" , Arnd Bergmann , "Jean Delvare" , Jarkko Nikula , Khalil Blaiech , Krzysztof Kozlowski , Geert Uytterhoeven , Bence =?utf-8?B?Q3PDs2vDoXM=?= , Yicong Yang , Mike Rapoport , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Ryan Chen , "open list:I2C SUBSYSTEM HOST DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , open list , ChiaWei Wang , Troy Lee , Steven Lee Subject: Re: [PATCH 3/3] i2c:support new register set for ast2600 Message-ID: <20210621051446.GB27876@aspeedtech.com> References: <20210617094424.27123-1-jamin_lin@aspeedtech.com> <20210617094424.27123-4-jamin_lin@aspeedtech.com> <20210618035855.GB31659@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [192.168.100.253] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 15L50DTC006012 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org The 06/18/2021 10:00, Andy Shevchenko wrote: > On Fri, Jun 18, 2021 at 11:58:55AM +0800, Jamin Lin wrote: > > The 06/17/2021 10:36, Andy Shevchenko wrote: > > > On Thu, Jun 17, 2021 at 05:43:40PM +0800, Jamin Lin wrote: > > > > Add i2c new driver to support new register set for AST2600. > > > > AST2600 support three modes for data transfer which are > > > > byte mode, buffer mode and dma mode, respectively. > > > > The global driver of i2c is used to set the new register > > > > mode and define the base clock frequency > > > > of baseclk_1~baseclk_4. > > > > - shrink the code base by at least ~15% (it's possible), i.e. -200 LOCs > > Can you describe it more detail? > > Do you mean I should separate the patch file to fix size limitation? > > No. Based on my brief review you introduce to many redundant LOCs (lines of > code). Remove them, refactor the code, make it small and neat and easy to read > and understand. It is possible to achieve! > Will fix Thanks > > > - rethink how you do calculations and bit operations > > > - better code style > > > > > Thanks for your review and very good suggestion > > I will update them and sent patch again. > > By the way, I received test failed email from Robot due to compiling > > warning. I will fix them, too. > > -- > With Best Regards, > Andy Shevchenko > > 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 X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26BA3C48BE5 for ; Mon, 21 Jun 2021 05:18:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA2A160FE9 for ; Mon, 21 Jun 2021 05:18:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA2A160FE9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Xfub937e+i7qwh7AsDLZD2/doRagoTsarpoix7elaUs=; b=08DRwaysOBZ3YS MV+5RwU0yR9bbBB1FgMgET1aEkbl5Ubtf1Bk6lVaBjdNkhGaxj96OYKYdKrJjz8Tz4LFRFc8PeQwv 4/cIhYQQYHp3EtIuAUPxqkwC/Rk9REmstdgF+2I3+hJrEzWAoTscj75hPWzqmpzjePU3DUzLVIZ2k zmlw8pStyMJwmu6f2jhE8nXqDM9oMoAfLS1Fakg4piHMDijqwWNpuGjg3jTnH2P5v/MM+zJWVoD9w jAsuG4krl5erKT2uNc2lqOYFRwQF9I9FYC47lV1X8HynE12Y87vCslM1kU1aseQsnDVhWzI6HuS7F JXkseGoe2yqlFjTSuA6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvCIL-0028TV-2l; Mon, 21 Jun 2021 05:16:26 +0000 Received: from twspam01.aspeedtech.com ([211.20.114.71]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvCHL-0028CT-Tn for linux-arm-kernel@lists.infradead.org; Mon, 21 Jun 2021 05:15:25 +0000 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 15L50DTC006012; Mon, 21 Jun 2021 13:00:13 +0800 (GMT-8) (envelope-from jamin_lin@aspeedtech.com) Received: from aspeedtech.com (192.168.100.253) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 21 Jun 2021 13:14:48 +0800 Date: Mon, 21 Jun 2021 13:14:46 +0800 From: Jamin Lin To: Andy Shevchenko CC: Rob Herring , Joel Stanley , "Andrew Jeffery" , Philipp Zabel , "Wolfram Sang" , Arnd Bergmann , "Jean Delvare" , Jarkko Nikula , Khalil Blaiech , Krzysztof Kozlowski , Geert Uytterhoeven , Bence =?utf-8?B?Q3PDs2vDoXM=?= , Yicong Yang , Mike Rapoport , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Ryan Chen , "open list:I2C SUBSYSTEM HOST DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , open list , ChiaWei Wang , Troy Lee , Steven Lee Subject: Re: [PATCH 3/3] i2c:support new register set for ast2600 Message-ID: <20210621051446.GB27876@aspeedtech.com> References: <20210617094424.27123-1-jamin_lin@aspeedtech.com> <20210617094424.27123-4-jamin_lin@aspeedtech.com> <20210618035855.GB31659@aspeedtech.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [192.168.100.253] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 15L50DTC006012 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210620_221524_311063_41CD8092 X-CRM114-Status: GOOD ( 22.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The 06/18/2021 10:00, Andy Shevchenko wrote: > On Fri, Jun 18, 2021 at 11:58:55AM +0800, Jamin Lin wrote: > > The 06/17/2021 10:36, Andy Shevchenko wrote: > > > On Thu, Jun 17, 2021 at 05:43:40PM +0800, Jamin Lin wrote: > > > > Add i2c new driver to support new register set for AST2600. > > > > AST2600 support three modes for data transfer which are > > > > byte mode, buffer mode and dma mode, respectively. > > > > The global driver of i2c is used to set the new register > > > > mode and define the base clock frequency > > > > of baseclk_1~baseclk_4. > > > > - shrink the code base by at least ~15% (it's possible), i.e. -200 LOCs > > Can you describe it more detail? > > Do you mean I should separate the patch file to fix size limitation? > > No. Based on my brief review you introduce to many redundant LOCs (lines of > code). Remove them, refactor the code, make it small and neat and easy to read > and understand. It is possible to achieve! > Will fix Thanks > > > - rethink how you do calculations and bit operations > > > - better code style > > > > > Thanks for your review and very good suggestion > > I will update them and sent patch again. > > By the way, I received test failed email from Robot due to compiling > > warning. I will fix them, too. > > -- > With Best Regards, > Andy Shevchenko > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel