Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5768579pxu; Thu, 22 Oct 2020 10:31:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyr3ZSlApPmZbmCIw4k2Iin8alTs+p+UuT+1vizXgNMr8l2BUDqwF+/eTyDCn3gSYscCuuz X-Received: by 2002:a17:906:7247:: with SMTP id n7mr3296801ejk.174.1603387870122; Thu, 22 Oct 2020 10:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603387870; cv=none; d=google.com; s=arc-20160816; b=vc8QHMWd7s67sOhK2heDoNDmjoRkW3jelDjka36qU+b7QapYsuAn1iiM5fFFaGG5G9 L1O0Q2SzgIWz9P4+iRV0eOpXOpDbaRUUN26pzBFnMQYQ8lMOMM6zP1Y6ze8c4SgfOtfF Qk9Srpbxx5TIiPbbQJhFxFU+h3aZNufnFnzZf0Xpa5vGXHn0+LEk6GjFte1ZJMycOPw0 94p4NivLyGLdwwus/8LKI4ZS2qCm0hgwURYGNYSXzZy04RNPbuNPHhEv+qC2pngtnw66 gIdeSYvhZq6Pj/sa/jpug+WlNMW5YU73iM+tgiDJn4FGVj/whmavby+9Vuyct8OWvaLU r7gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=c8zp78bb/pXTlUAX0W09xxp+GhtDeiyb8d5IIZ/CBAE=; b=acYXaHWDXzMfWPhiJo3DfSz43pjft9Y96EWDXOa5xuetoJg0QqNtVHf3+r7EzyZdf7 oHPhhDkfdfWamnYEn98oYdF0OlmRaYnN+15jbPqmTNhfkfJWzGINn4T0ujziVnGrmzuM nZ6MBFqWZWxlNiotHRjt530MQO+8ABcJFM0kVmmZhjbRQnkBbN1iJ1EjAAlTbKPxAkhL rNDCDBxpBOJ66nD4taCQaPqlsoRJP5uEChNvlbC0BdCT5WWS4W8WHFHNROPHemxMb06x Uaeu4MUQVE1AJ++gZNZTrearzAtBAwTZz4seXvZ/YnBAbkJouz6UgkSzLHJpfqGyD7uq mxnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z6si1289584ejw.432.2020.10.22.10.30.47; Thu, 22 Oct 2020 10:31:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S368032AbgJVNuO (ORCPT + 99 others); Thu, 22 Oct 2020 09:50:14 -0400 Received: from mga05.intel.com ([192.55.52.43]:30260 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S368021AbgJVNuK (ORCPT ); Thu, 22 Oct 2020 09:50:10 -0400 IronPort-SDR: J/3rNtxkYhJTxLu2+PUhEJ/QDABaI8Kd6Pp+BXPl4EfFPUDR6e7g0klBrEYc0vz3ANToopeBdm 3Zqjh7OI+Z9g== X-IronPort-AV: E=McAfee;i="6000,8403,9781"; a="252226602" X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="252226602" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2020 06:50:06 -0700 IronPort-SDR: UmvmZgYrQJluVawmVk0ysP1kYPZEoyDPFdcl8i1Z/Kkio6aApOwta6WI7pybKS4m49t2vq7e3a /GHcBHk4xaVg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="359865513" Received: from mylly.fi.intel.com (HELO [10.237.72.187]) ([10.237.72.187]) by orsmga007.jf.intel.com with ESMTP; 22 Oct 2020 06:50:04 -0700 Subject: Re: [PATCH v2] i2c: designware: call i2c_dw_read_clear_intrbits_slave() once To: Michael Wu , Andy Shevchenko , Mika Westerberg , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Morgan Chang References: <20201022054625.21969-1-michael.wu@vatics.com> From: Jarkko Nikula Message-ID: Date: Thu, 22 Oct 2020 16:50:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201022054625.21969-1-michael.wu@vatics.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On 10/22/20 8:46 AM, Michael Wu wrote: > @@ -217,10 +214,8 @@ static int i2c_dw_irq_handler_slave(struct dw_i2c_dev *dev) > if (!i2c_slave_event(dev->slave, I2C_SLAVE_WRITE_RECEIVED, > &val)) > dev_vdbg(dev->dev, "Byte %X acked!", val); > - } else { > + } else > i2c_slave_event(dev->slave, I2C_SLAVE_STOP, &val); > - stat = i2c_dw_read_clear_intrbits_slave(dev); > - } > Minor nit. Please don't remove braces here since the upper part of if statement has them. From Documentation/process/coding-style.rst: " This does not apply if only one branch of a conditional statement is a single statement; in the latter case use braces in both branches: .. code-block:: c if (condition) { do_this(); do_that(); } else { otherwise(); } " Otherwise looks good to me. Jarkko