Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp619566imu; Thu, 13 Dec 2018 01:16:38 -0800 (PST) X-Google-Smtp-Source: AFSGD/XHlH3lkwmH86XbFzhjCUtUerzDtnw7f0aWpjLQRu8POoV+f4zgaLhDYlYo7s/WX4ISKIgV X-Received: by 2002:a17:902:8ec9:: with SMTP id x9mr23146010plo.27.1544692598363; Thu, 13 Dec 2018 01:16:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544692598; cv=none; d=google.com; s=arc-20160816; b=fmxMipkB23A/tnxkZma17fI3RxIf41oPArB2XuSNqfSfE3amqTJvX85nICmuZ/VJJP T00MqaS6U/9HVZsIdVEwIoPCNrr1SoKhKIhKK6XAKhGa4pIGZX/iBpNrzb2QHbCZ9ihM OIuM26YuKs1gr7xzncALHV5cqBZvVoZQChyG568JQDUeqF8Y0lq3BDlQ5qksOFcKf8YN L7v5/mm+olvAa9hTDa+K7f33gIHZ+lfCOBOvlcMkb5W22EnBb9PqjIA1q/Gh5U81mQtm GLe9S4wKS9vGT7ZxDqu8/6w2O3uSxXRNCSCi5AGyFnlVeYEE32q0u1rks1gdm/Fj53D8 AcaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=6s5OTxuhpBQ6SUHKC+43BTEYKidrahsMU8w6jyHjr+0=; b=utEq14g/K5lAhnHp9oggKhKm0/O8gD1vsjMC+RuaWUSdxmh9JFQA/5hZ1NOkgNP6/B UamRIKxXFXIDhdpj8uefMwZ5EW3W4+PH/vnhonmW50W2B1+ZuaIOjZ/ZjqdxIKeGkxuV en0C/nxIn2cFMAesdKzRbXooSYF5AiTO+seSlEV/i2oBiEqe0G0ubzYaXLFJNbCiuJ// mcVfjc+HT2q84rSYUUC+83U1l9ixLhztf7AHwX372dogwu8OLd/b8vaNtuTbb1AyfjWn /kfmK9HT71iUt5HUmznpVaNSHojjOZVYAPH9MFMfadIc+zPMZKauLC3VgvuuVahTeJ83 gDtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si1115593pgf.136.2018.12.13.01.16.24; Thu, 13 Dec 2018 01:16:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727837AbeLMJOE (ORCPT + 99 others); Thu, 13 Dec 2018 04:14:04 -0500 Received: from mailgw02.mediatek.com ([1.203.163.81]:42795 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727095AbeLMJOE (ORCPT ); Thu, 13 Dec 2018 04:14:04 -0500 X-UUID: c80aa5f96e3445abb442e1da0c70cc33-20181213 X-UUID: c80aa5f96e3445abb442e1da0c70cc33-20181213 Received: from mtkcas34.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1045786807; Thu, 13 Dec 2018 17:14:01 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 13 Dec 2018 17:13:50 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 13 Dec 2018 17:13:50 +0800 Message-ID: <1544692429.11699.31.camel@mhfsdcap03> Subject: Re: [PATCH 2/5] i2c: mediatek: remove useless code and replace definitions From: Qii Wang To: Wolfram Sang CC: , , , , , , , Date: Thu, 13 Dec 2018 17:13:49 +0800 In-Reply-To: <20181211202058.cd4wyz4so66iqspt@ninjato> References: <1543843974-4054-1-git-send-email-qii.wang@mediatek.com> <1543843974-4054-3-git-send-email-qii.wang@mediatek.com> <20181211202058.cd4wyz4so66iqspt@ninjato> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-12-11 at 21:20 +0100, Wolfram Sang wrote: > On Mon, Dec 03, 2018 at 09:32:51PM +0800, qii.wang@mediatek.com wrote: > > From: qii wang > > > > Completion_done is useless when we don't use its return value, > > so we remove it. Different speeds have been defined by macros, > > so we use macros definitions. > > Those are two seperate patches, or? > These two changes are relatively small, but it seems better to be divided into two seperate patches. > > > > Signed-off-by: qii wang > > --- > > drivers/i2c/busses/i2c-mt65xx.c | 6 ++---- > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c > > index a74ef76..660de1e 100644 > > --- a/drivers/i2c/busses/i2c-mt65xx.c > > +++ b/drivers/i2c/busses/i2c-mt65xx.c > > @@ -456,7 +456,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs, > > > > control_reg = readw(i2c->base + OFFSET_CONTROL) & > > ~(I2C_CONTROL_DIR_CHANGE | I2C_CONTROL_RS); > > - if ((i2c->speed_hz > 400000) || (left_num >= 1)) > > + if ((i2c->speed_hz > MAX_FS_MODE_SPEED) || (left_num >= 1)) > > control_reg |= I2C_CONTROL_RS; > > > > if (i2c->op == I2C_MASTER_WRRD) > > @@ -465,7 +465,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs, > > writew(control_reg, i2c->base + OFFSET_CONTROL); > > > > /* set start condition */ > > - if (i2c->speed_hz <= 100000) > > + if (i2c->speed_hz <= I2C_DEFAULT_SPEED) > > writew(I2C_ST_START_CON, i2c->base + OFFSET_EXT_CONF); > > else > > writew(I2C_FS_START_CON, i2c->base + OFFSET_EXT_CONF); > > @@ -642,8 +642,6 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs, > > return -ETIMEDOUT; > > } > > > > - completion_done(&i2c->msg_complete); > > - > > if (i2c->irq_stat & (I2C_HS_NACKERR | I2C_ACKERR)) { > > dev_dbg(i2c->dev, "addr: %x, transfer ACK error\n", msgs->addr); > > mtk_i2c_init_hw(i2c); > > -- > > 1.7.9.5 > >