Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3192654imm; Fri, 10 Aug 2018 05:26:36 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzbvmT9Q6UQ/9ZTdEpL9zp8ifgfE+rzZLUP0YGNmkSyZLmxs9c0xSJ0tGNb+XHpD1M2TMdA X-Received: by 2002:a62:c218:: with SMTP id l24-v6mr6920466pfg.185.1533903996062; Fri, 10 Aug 2018 05:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533903996; cv=none; d=google.com; s=arc-20160816; b=LwpVNPPtDH8QVGANsKrc/IiX5HNdbz0Y4xFkaZiG7lm5FEiuEOx99qMavfsCHC63Hj kBAw17gtXLXtzWVxoeaYnqK2XHjl7EKp9Xh+3camR4ze4G7KBoHY0ih8WGYEKJc7yzT3 mVodL3/cKkDVcDgqEy4MB1Wb7aEDQRaZcYyGapeLqWo19dv4zEkRlQL1oRE2ojXpPDwY IMYavyHjaC79Gvm5PoiE4TgY7zS+ufJVnRsL7xc7XRZo4E6jk81ZKVlImhIlkokY1nWp K3kCKNoUnc8iY/tQLpNHB7YBRT9/kRBLvacutxIdEhh13c5n7Yqj9LV1gg+EESiNHK/b k2HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=CnT+g2BXImRgkh2k02yNzziJUGUGCmIZKuRc1IrqrIo=; b=rfgyOmn7lJmtCHQKym7e2d+Bpbvo7wA1xioc1UZ+E4CWad88gS04L7vPDnAXvOEj1T jvWEJ9cu1AB00dWmuEpG4Kk40jEOO3ZQOkZmIlqgBLTDI8/GuD0FNZz8YwfN8AGn9Qo+ 3QXxxwc0a/DckcfTIgbiNr5yYOVD4Q8kXHSEcXfbYDyRzBLGmdHMzTCPOPX+uZxmopOq i/4zq25af5T2BiEjc7zjI7C3+TqacpcnbwQkg8ELbJRKC8aYKZPwJl0JL9eyXwSsvFN8 p8eEvrT9VUB+a4XdWpjud6+VJDluM6yuF45NEZSagvM7nsGbfGY0uI08EyHK8oVsc+/O lnvQ== 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 u76-v6si12024354pfj.58.2018.08.10.05.26.21; Fri, 10 Aug 2018 05:26:36 -0700 (PDT) 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 S1727949AbeHJOzO (ORCPT + 99 others); Fri, 10 Aug 2018 10:55:14 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:52297 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727544AbeHJOzO (ORCPT ); Fri, 10 Aug 2018 10:55:14 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fo6Tl-0004JF-LF; Fri, 10 Aug 2018 14:25:17 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1fo6Tf-0003P0-3V; Fri, 10 Aug 2018 14:25:11 +0200 Date: Fri, 10 Aug 2018 14:25:11 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Esben Haabendal Cc: linux-i2c@vger.kernel.org, Wolfram Sang , Rob Herring , Mark Rutland , Yuan Yao , Philipp Zabel , Phil Reid , Lucas Stach , Clemens Gruber , Peter Rosin , Fabio Estevam , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/4] i2c: imx: Simplify stopped state tracking Message-ID: <20180810122511.2xnelcn6tguirfbp@pengutronix.de> References: <20180709094304.8814-1-esben.haabendal@gmail.com> <20180709094304.8814-4-esben.haabendal@gmail.com> <20180724075919.iyysd7dtbddvbavq@pengutronix.de> <87k1ozzquk.fsf@gmail.com> <20180809162652.r34omvkctzxte422@pengutronix.de> <87zhxuo9o1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87zhxuo9o1.fsf@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Esben, On Fri, Aug 10, 2018 at 11:25:34AM +0200, Esben Haabendal wrote: > Uwe Kleine-K?nig writes: > > Currently you have: > > > > if (for_busy && (temp & I2SR_IBB)) { > > i2c_imx->stopped = 0; > > break; > > } > > > > if (!for_busy && !(temp & I2SR_IBB)) { > > i2c_imx->stopped = 1; > > break; > > } > > > > The semantic of this is the same (apart from always updating .stopped) > > but is imho easier: > > > > i2c_imx->stopped = !(temp & I2SR_IBB); > > > > if (for_busy != i2c_imx->stopped) > > break; > > Yes, that should work also. > Shorter, but IMHO a bit more convoluted to read. > Let me know if I should send a new version with this change. unless someone else chimes in I'd say keep it as is. I'd prefer my variant, but I accept that this is something subjective. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |