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 8885FC433F5 for ; Thu, 3 Mar 2022 10:31:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbiCCKbv (ORCPT ); Thu, 3 Mar 2022 05:31:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232201AbiCCKbv (ORCPT ); Thu, 3 Mar 2022 05:31:51 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 222F1179A25; Thu, 3 Mar 2022 02:31:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646303466; x=1677839466; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=wDq06r9kddhLaN6b+ChI1ivL51pnJ9aOuIAEFgqn6mo=; b=lnYSUp0qqmNSA63T6n/xfXtvIr0z3mkGz4B8Vs6jjRx8h12bnge7Dc7D 3lejfAETJQ4a7XumuwGrahBo9lda1MuYrgITu1pZZiGWBs0+A8MYMbDms zPUrt+awcBTLIcScVKhRMWt3JrjZDc3ZqEs0NSzC4+zeQKAohKjpaCmQN uAHT95PDl+xOvv3BbdS4bdG5wVPkxwJhph+Q9+MOmjNcAbSd7yHrnyBia Wvrl2HPv/fpLAIVTAllNBCtX/ZQhQtA7tzSZdLg2w8XRtQAP3PlmiGCn6 Og+ruJrDkf2YS6EnxSqKfKfEFOp1wBuxNdQmAoquX2VtO1s5ueEDSKXnZ Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10274"; a="253370222" X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208";a="253370222" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 02:31:04 -0800 X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208";a="545817308" Received: from smile.fi.intel.com ([10.237.72.59]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 02:30:58 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nPiio-00AjxS-JE; Thu, 03 Mar 2022 12:30:10 +0200 Date: Thu, 3 Mar 2022 12:30:10 +0200 From: Andy Shevchenko To: Tyrone Ting Cc: avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com, robh+dt@kernel.org, krzysztof.kozlowski@canonical.com, yangyicong@hisilicon.com, semen.protsenko@linaro.org, wsa@kernel.org, jie.deng@intel.com, sven@svenpeter.dev, bence98@sch.bme.hu, lukas.bulwahn@gmail.com, arnd@arndb.de, olof@lixom.net, tali.perry@nuvoton.com, Avi.Fishman@nuvoton.com, tomer.maimon@nuvoton.com, KWLIU@nuvoton.com, JJLIU0@nuvoton.com, kfting@nuvoton.com, openbmc@lists.ozlabs.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 03/11] i2c: npcm: Fix client address calculation Message-ID: References: <20220303083141.8742-1-warp5tw@gmail.com> <20220303083141.8742-4-warp5tw@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220303083141.8742-4-warp5tw@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org On Thu, Mar 03, 2022 at 04:31:33PM +0800, Tyrone Ting wrote: > From: Tali Perry > > Fix i2c client address by left-shifting 1 bit before > applying it to the data register. ... > - bus->dest_addr = slave_addr; > + bus->dest_addr = slave_addr << 1; 1. Why this is not using i2c_8bit_addr_from_msg() helper? 2. This is duplication of what npcm_i2c_master_start_xmit() does. Taking 2 into account, what is this exactly fixing? Sounds like a red herring. -- 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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B68BEC433F5 for ; Thu, 3 Mar 2022 10:32:53 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4K8S426NbWz3c2N for ; Thu, 3 Mar 2022 21:32:50 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=bDrwnLO1; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.intel.com (client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=andriy.shevchenko@linux.intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=bDrwnLO1; dkim-atps=neutral Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4K8S3F2XQYz3bYY for ; Thu, 3 Mar 2022 21:32:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646303530; x=1677839530; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=wDq06r9kddhLaN6b+ChI1ivL51pnJ9aOuIAEFgqn6mo=; b=bDrwnLO1s6ymNp4pwy/oCGBbGdzd7vTeCoALNZYbtmox2T0aMvk5WQzX nwRBiGLxe4IFsFBZgA0q8bLhZn5M/kjkfR3g1R0VdNlq4/Q/GceXwECqJ YtXlCf3Xe87xyfyeFgceUCbhHrbnYjL5JwiLpt4RW2/RTYs+x6OmbphfG Uv+7Tt0wv81nH+b0DRM+yIEtH8Ybk33EZqeoh+67VBZYwvzC0POK2JdNk od1FDGntnYAwix0LQ0MvEs9KgRqNmH/TgxmXT4S9LZ+mwR4pWw9/Ug9jB cC+1awDcl8IsL2h6jbpYmAwLmjfhijUKrgXOR8H6ccBcUrib9mB8nMe3+ Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10274"; a="253370223" X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208";a="253370223" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 02:31:04 -0800 X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208";a="545817308" Received: from smile.fi.intel.com ([10.237.72.59]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 02:30:58 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nPiio-00AjxS-JE; Thu, 03 Mar 2022 12:30:10 +0200 Date: Thu, 3 Mar 2022 12:30:10 +0200 From: Andy Shevchenko To: Tyrone Ting Subject: Re: [PATCH v3 03/11] i2c: npcm: Fix client address calculation Message-ID: References: <20220303083141.8742-1-warp5tw@gmail.com> <20220303083141.8742-4-warp5tw@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220303083141.8742-4-warp5tw@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tmaimon77@gmail.com, devicetree@vger.kernel.org, tali.perry1@gmail.com, linux-i2c@vger.kernel.org, benjaminfair@google.com, krzysztof.kozlowski@canonical.com, openbmc@lists.ozlabs.org, JJLIU0@nuvoton.com, lukas.bulwahn@gmail.com, tomer.maimon@nuvoton.com, KWLIU@nuvoton.com, bence98@sch.bme.hu, arnd@arndb.de, sven@svenpeter.dev, robh+dt@kernel.org, Avi.Fishman@nuvoton.com, yangyicong@hisilicon.com, semen.protsenko@linaro.org, jie.deng@intel.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, wsa@kernel.org, kfting@nuvoton.com, tali.perry@nuvoton.com, olof@lixom.net Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" On Thu, Mar 03, 2022 at 04:31:33PM +0800, Tyrone Ting wrote: > From: Tali Perry > > Fix i2c client address by left-shifting 1 bit before > applying it to the data register. ... > - bus->dest_addr = slave_addr; > + bus->dest_addr = slave_addr << 1; 1. Why this is not using i2c_8bit_addr_from_msg() helper? 2. This is duplication of what npcm_i2c_master_start_xmit() does. Taking 2 into account, what is this exactly fixing? Sounds like a red herring. -- With Best Regards, Andy Shevchenko