From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755258AbcGHOkI (ORCPT ); Fri, 8 Jul 2016 10:40:08 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:57658 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754802AbcGHOkA (ORCPT ); Fri, 8 Jul 2016 10:40:00 -0400 Date: Fri, 8 Jul 2016 16:39:25 +0200 From: Mark Brown To: Philipp Zabel Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Message-ID: <20160708143925.GY6247@sirena.org.uk> References: <1467814781-15007-1-git-send-email-p.zabel@pengutronix.de> <20160707094254.GK6247@sirena.org.uk> <1467885703.4236.40.camel@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7TJsTKtAWvgVQEcr" Content-Disposition: inline In-Reply-To: <1467885703.4236.40.camel@pengutronix.de> X-Cookie: You are always busy. User-Agent: Mutt/1.6.0 (2016-04-01) X-SA-Exim-Connect-IP: 137.158.22.235 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] regmap: add iopoll-like polling macro X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --7TJsTKtAWvgVQEcr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jul 07, 2016 at 12:01:43PM +0200, Philipp Zabel wrote: > Am Donnerstag, den 07.07.2016, 11:42 +0200 schrieb Mark Brown: > > On Wed, Jul 06, 2016 at 04:19:41PM +0200, Philipp Zabel wrote: > > > This patch adds a macro regmap_read_poll_timeout that works similar > > > to the readx_poll_timeout defined in linux/iopoll.h, except that this > > > can also return the error value returned by a failed regmap_read. > > Please make this a proper function. > I can't, the condition has to be evaluated inside the loop. This is > basically a poor man's function template. Given that the condition is always going to be essentially the same one checking that (read & mask) == value we could just parameterize it couldn't we? --7TJsTKtAWvgVQEcr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXf7scAAoJECTWi3JdVIfQ9fkH/RVfPpC/FNoRzziFi0maFv9C oqbHfVBSw0n+mbM3kFg4gjjIy9TbUhsuGskxq8IQDpniB04PP/tuCSDF35FguDch fuXuvz39PR4Hnuc8cEuEGXpMIDr1m6jZ1uLOUsxdH0hY0Yu2yavE0X+ogGM7XZqJ VpzXQfqI17GYtqQWeKTxvHNV3U8s0c21tDT5sbFB7X45mYJPhwAKHb+J4Gpna+rH 581OcabsA5G6Nk5gDAU4cWeZp7Gc3aEnS2KUvVTu3qFvgxengT1JZwgdCj2x/S9L BoK9X3kKfCZ1Zr9MeWJ1abuoQ4tb3r48WTAPWSXmd4NJyf9za70jiSd1hDBzK1Q= =zzRg -----END PGP SIGNATURE----- --7TJsTKtAWvgVQEcr--