Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3385160imm; Mon, 4 Jun 2018 02:41:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJTa2zNfAKpu/74BGRqzuJBd1zBUcl3rUWo+gLpUMihl29F2tNH9Y00NX1KuB6sRtdjD1rl X-Received: by 2002:aa7:8298:: with SMTP id s24-v6mr79853pfm.136.1528105277140; Mon, 04 Jun 2018 02:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528105277; cv=none; d=google.com; s=arc-20160816; b=ErLHxHZbRJXZHtdPcHF8JZhjUrF1ULnwtWOemgXjABttUWdBaxB7cufMLezBldnJOn YYb5ZmRiHwCk1JZ8+eC7HJDab0W5Tkg5DfiO8hxQ9oe8jc2mToT645GfqmX36WZyrDGn UENDb3WMuxZJRxAHuUXqFgX6SwEjaaGTK6yI4hhkx3kgxZ3pLbSkseyTRebxHzmzqo5h azmHE5jaoU8eEyGyCFQtGfD5bTF4TqWTGxwgi7gwWc+kX1tkB1NAE6od9/V6QKQfvGVJ 5Y78IB2iSK5ctLtVaqag4htjt0H4l4xKutDN3BtMBY52JxBfsARqnD17p72ZE1vvHEpX 1H4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=sYTpGLcHpL50SQ4NpWfgYqaNYdfZYa1rnbHKqy3fMsg=; b=bYIQakOAzxnBrhsGxU6y+mFGDmNKw+JnCNTLLEZS5npDVMMqrVTuSs+0AEO3Dh1+T0 ssFmkm4MqItAtuxAZuIPZpD3X+u8xgWX1ZTxDvRAHngPNuGGATh/aMQve7XgdGejYjKS 75wvN4Ef4RQ9z43QWxb+jHU42WtkGXbDEychNEO0A/BBsp465cAd1gTu91SS5zXx0YE0 +OMNx/8IIc1WaX4gxu3u+Oaqu11hDj+CFzTLBz6CzjpJUlXVzftt54DP/RNuFdVSj8GZ pbXsQ3+y4ZxPfxaowP/br17e1so9WKX88iOcTGjELMXtcpdiwvgFjjuzvgdLT8KrOMu9 D85A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oOBB6k2E; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9-v6si3127790pgo.593.2018.06.04.02.41.02; Mon, 04 Jun 2018 02:41:17 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oOBB6k2E; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751798AbeFDJkk (ORCPT + 99 others); Mon, 4 Jun 2018 05:40:40 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:45465 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750886AbeFDJkj (ORCPT ); Mon, 4 Jun 2018 05:40:39 -0400 Received: by mail-qt0-f193.google.com with SMTP id i18-v6so29078836qtp.12 for ; Mon, 04 Jun 2018 02:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sYTpGLcHpL50SQ4NpWfgYqaNYdfZYa1rnbHKqy3fMsg=; b=oOBB6k2EPRJwXylsOrtoPKNhMpUIHfnb9ZfWi2s0FxgkZd+xjJpa9ArGKVv6ahFY3A 9xe+CB0bEO6K7LJwoit6grpEBDCEjxc8nO2aCLjIzTenAM05MPG0U/VCiozzqdrfaJmF OSad9LtqfkjR5VfEfJ32QqnSUjwoEaY+zXqpTi+iskpHX+7A2Nly8bMmB/zktB1P2I6T B0B4Y4gxjKlY9zt/JjfN8rT5QBrb62sCLZGDd6jkYDoVctQrDqk7dGUgQhP8dXlY+fGd 28wLkWLHaHTi+cvnG0oAjhkenyaelBJTMIg8MkpGA66fVV2cr9TmKOObsVH5OMcZE5uT /edw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sYTpGLcHpL50SQ4NpWfgYqaNYdfZYa1rnbHKqy3fMsg=; b=O7VyeiM7Q+Q92aSY/KVMkA/tWSW5DPrc663OYwvPiOUm7THRoOeN+yGzdWZ9cLLvwk fh9Z0PXpxc5ENR/1c5zzsiN2UvJLh/0DDHf/gx8M+jAl3OcB5InYqJVmyVsa5mmMMvvP TxZseb8g5aTCyJ+BALtBN8qfmBGFCs60AFWVc8O+gEIFT9Bj/attJlRHBwaHx4yG5ngw UjQNcUWRFZ6pN2Bxsa7V5G+JfazZIjPAeIcftq19SOdvYO0IbH7LSeNzLGON9scsDIE5 6UgNvC729u3R+X+qMPkgY2HY8KfmC/Ik+VPCTX0CtAygKSw0/qt2hom+2Uq4MCfaTMu1 sN7g== X-Gm-Message-State: APt69E3fxlcRMoi6Lo7QjoAsXqSrtF8GmMo0RkIq29OAUK68B47rgfS0 EzLrCeZLlBPNWK3mpFSmiNSLIxDVbs8cSuG3tA8= X-Received: by 2002:ac8:430e:: with SMTP id z14-v6mr17216633qtm.105.1528105238826; Mon, 04 Jun 2018 02:40:38 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:98f9:0:0:0:0:0 with HTTP; Mon, 4 Jun 2018 02:40:37 -0700 (PDT) In-Reply-To: <20180604054452.GD17993@dell> References: <20180511135030.14590-1-ckeepax@opensource.cirrus.com> <20180604054452.GD17993@dell> From: Andy Shevchenko Date: Mon, 4 Jun 2018 12:40:37 +0300 Message-ID: Subject: Re: [PATCH] mfd: arizona: Don't use regmap_read_poll_timeout To: Lee Jones Cc: Charles Keepax , patches@opensource.cirrus.com, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 4, 2018 at 8:44 AM, Lee Jones wrote: > On Fri, 11 May 2018, Charles Keepax wrote: >> + while (true) { >> + ret = regmap_read(arizona->regmap, reg, &val); >> >> + if ((val & mask) == target) >> + return 0; >> + >> + if (ktime_compare(ktime_get(), timeout) > 0) >> + break; >> + >> + usleep_range(ARIZONA_REG_POLL_DELAY_US / 2, >> + ARIZONA_REG_POLL_DELAY_US); >> + } From my point of view infinite loops not good for readability and maintenance. Perhaps do { ... } while (ktime_compare(...)); ? -- With Best Regards, Andy Shevchenko