Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2919726ybb; Sun, 22 Mar 2020 10:50:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsGfiqh56uM62z+J4k46f16e50+GhUhgrLMQbImH9OEYXqQIk48DHRc13fQoJiOjnfpl933 X-Received: by 2002:a54:410c:: with SMTP id l12mr14494853oic.13.1584899449430; Sun, 22 Mar 2020 10:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584899449; cv=none; d=google.com; s=arc-20160816; b=y23ug+yfCRUuO2uJhUF5rgeqyewBjrotAbVhHjCmPr3aGnAD9pgV+R0iiLl/nbVNke dOCuhQrdbuyYM6llEKjOfUjF5xnJgMoXl4LBT0zTi7susy4rt4nnN8GkOM/mdyg0gx17 hQ6Qyeqmi9c3wE43tN9QJe+dbE59qxSCAbXpOUq8MQ3wDJ188e68UZ2OwdB0MPV81Anj QTNNARqZy99+fzzPV6U/3K5vTmjL09/vJ+MTjMgQU1rHUtgIAdMxQZWSyzofk1p76uAK BKYdQAlaggGd+NZeFIyGKZSSgfzkJGsVWXg0FQfXoHZDlARVTDmUr+lGm+JcNL+1QFA5 B1sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qmwlS5xIuT/pca30qYGROuDmXKXBAcQ9eYLHT8tR2lo=; b=IOcEPT0NXlWGjhTrXlMnz4znZ0hvdS4o/9bq2EHG8x2WaNoKnw2CGURXpC1ByCh/PK 9bEp6vUqQhr+Pza4W+jbwM36OzT6qyoLcjNmuDtriKAexKSWj0WmM5NXzUQ0T2VldGod x+AByxCJe5/kOmDHG0pvNOM+6bQy3TokpsvCZHzX39coJrjxZoWS+pNy3pA2GGJFDwnN HJ5KZi1xT5b2cMxybeU9auaoTFhDYgT8W4oRFWIEAQUx+VQz6JO/A4VGoSl4swUqW7TH ykRb+xfaTIwKLXsuPSr+SvcKNzbDX6fKessiChqz79uIfyfwl63tViyg5eO+EVBOAP5G AYRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NHOWPtIA; 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 y7si7330754ote.303.2020.03.22.10.50.37; Sun, 22 Mar 2020 10:50:49 -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=NHOWPtIA; 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 S1727022AbgCVRuD (ORCPT + 99 others); Sun, 22 Mar 2020 13:50:03 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:35654 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726983AbgCVRuB (ORCPT ); Sun, 22 Mar 2020 13:50:01 -0400 Received: by mail-pl1-f195.google.com with SMTP id g6so4872510plt.2; Sun, 22 Mar 2020 10:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qmwlS5xIuT/pca30qYGROuDmXKXBAcQ9eYLHT8tR2lo=; b=NHOWPtIA4T9507e44+YKSVBWFsEbzLRGMdrfadWPbkKIoZWc7EnrevPGJygmnc2q9k ApeRBj6fYDTDG7H6Pk74W/0LTsYNf3B4juBA/UEO9bjlt7VLkYj9hIKZ5/BxSdJrFtht 5N2jSMcdHF0Sg1LhI4/bJvJLtxTTKAIg0ZtZS+ULwJCYKsEdTf5EIyBGhDuRjFaNINlJ tCkgfGSBwY0meLqPyy3IrSktWWApHcgZnrR0zAuGcVR+PG5MuR9hX+LeY8lc55b5gkyp wYpJqARBvwRXD2zUG2FNbEd/9hD2Bc84cp3R8hnK1IvhzodGyrqCwxOHhviqpwTCYvM5 Fl5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qmwlS5xIuT/pca30qYGROuDmXKXBAcQ9eYLHT8tR2lo=; b=l6A45Jef5vYBafbbFS4sfxDTVNbtBp8JUirvWBFhsSYv7fyNTBpDSmU9dlR6LV9W8R ebnoLs6RsNnkcejKwJ+HOvptn9uMzeuKPfd0vHtUmnFL2I62nbX7RGD4BU59O1U/JwZu /hQBZYRKs3Hrgj9R5esRsgwAX9T9t4vs+XTG4ZRnrIUTenWflEIDUcFGs9H+7kZmFndF /O0OhHKCrfUqE66g2NIHNfaTsxZXTwHWIT8y10IBwm9NlRYwBdXjG957UO5Qggk89mUY kyiJjwi6NSf6Zb/MOAzHFQ0l+p7tuJjHCICvNw04Xd6hZM3sJBm78zTiMdB8g8h6ddLw 5MzA== X-Gm-Message-State: ANhLgQ1c1omWg5UHBCRsGzTVe9ndrlFGwtzCeA6CXWBmfTQTHVk8f/Qs T23D5E8mqOSZd1X21dd9dqw= X-Received: by 2002:a17:90a:6c22:: with SMTP id x31mr20960911pjj.124.1584899400051; Sun, 22 Mar 2020 10:50:00 -0700 (PDT) Received: from localhost ([216.24.188.11]) by smtp.gmail.com with ESMTPSA id c128sm10887375pfa.11.2020.03.22.10.49.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Mar 2020 10:49:59 -0700 (PDT) From: Dejin Zheng To: andrew@lunn.ch, f.fainelli@gmail.com, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, mchehab+samsung@kernel.org, corbet@lwn.net, gregkh@linuxfoundation.org, broonie@kernel.org, tglx@linutronix.de, netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Dejin Zheng Subject: [PATCH net-next v5 02/10] iopoll: redefined readx_poll_timeout macro to simplify the code Date: Mon, 23 Mar 2020 01:49:35 +0800 Message-Id: <20200322174943.26332-3-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200322174943.26332-1-zhengdejin5@gmail.com> References: <20200322174943.26332-1-zhengdejin5@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org redefined readx_poll_timeout macro by read_poll_timeout to simplify the code. Signed-off-by: Dejin Zheng --- v4 -> v5: - no changed v3 -> v4: - no changed v2 -> v3: - no changed v1 -> v2: - no changed include/linux/iopoll.h | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h index 7d44a2e20267..29c016cd6249 100644 --- a/include/linux/iopoll.h +++ b/include/linux/iopoll.h @@ -72,25 +72,7 @@ * macros defined below rather than this macro directly. */ #define readx_poll_timeout(op, addr, val, cond, sleep_us, timeout_us) \ -({ \ - u64 __timeout_us = (timeout_us); \ - unsigned long __sleep_us = (sleep_us); \ - ktime_t __timeout = ktime_add_us(ktime_get(), __timeout_us); \ - might_sleep_if((__sleep_us) != 0); \ - for (;;) { \ - (val) = op(addr); \ - if (cond) \ - break; \ - if (__timeout_us && \ - ktime_compare(ktime_get(), __timeout) > 0) { \ - (val) = op(addr); \ - break; \ - } \ - if (__sleep_us) \ - usleep_range((__sleep_us >> 2) + 1, __sleep_us); \ - } \ - (cond) ? 0 : -ETIMEDOUT; \ -}) + read_poll_timeout(op, val, cond, sleep_us, timeout_us, addr) /** * readx_poll_timeout_atomic - Periodically poll an address until a condition is met or a timeout occurs -- 2.25.0