Received: by 10.223.176.5 with SMTP id f5csp734046wra; Sat, 27 Jan 2018 08:46:13 -0800 (PST) X-Google-Smtp-Source: AH8x2263bCwCnQfxmU9yY+EWkv8x6wYpf+ptzdlVSq0BPTFMYHmvw+E7n3mQZ2VPiWpZZm+g7VMI X-Received: by 2002:a17:902:7586:: with SMTP id j6-v6mr5219891pll.23.1517071573120; Sat, 27 Jan 2018 08:46:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517071573; cv=none; d=google.com; s=arc-20160816; b=hEtIAzp/MtyNklmBJkdOis/grKCDtHOfiqMH22b8IS3PEf3M/hUd/ZrgpIn/zRvgyE AqqxI+EdOQiCsRQBltDALMxr3aeIqCz1XN1obpp+B3M0U61zsqLCe37bc4DAa8dmZ6vw +3UM0LeS9V9LPvs2VF1SrwV4YNnsgMnxjyqdythhXAplX62AFMHzH8soFYoIaM9fSgO3 KdRpDz+RPBlMTiZLn3nSb1R4fFzU5UuHl2872u12X06k2vwyl6jLKvMRc8CT8GZm2Hj/ 2eYaJaF798XXQ1pZ7PInGwiYtf3X0WOLJ4OnrLl4uGb7yP0fnj3d7tRzSTmt0rvCzR6Z +kCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:to:from :arc-authentication-results; bh=14T9J3+fyiXE0RCBGZ/UzbmAcPlMd7Yh+kwq4noMUWg=; b=hXd6Pt/5FPpAa5ILQbWbC0RaJ5iEs7ie+Yy106joXTPH66TPO3QRr/jJ0d9vrE/9j2 fxEcLTzp+/II3zEXu6+C2VBN0XW4Rt7rpl5iftffFa0gaJZNLatN2xDEVCSvuINmciVt hE/MJ78DBhadKPqIyC7Cw9yWhznwzfi5nXvn+lwd3KzfmNxISkgumv+xRIVXQo3dIjVo yqftODy6pYLSJtJr1+1KQ23A/LoVY3rc3IcS+lyl7tZwHlPhXTJvezUO4+pFYw+nECH+ EqNj4vtbDwtJrn9bCnLSca4qtB3/wEBPeixD/R18d0hQOipD1IrhgK8TRioblzFQL8e6 fIsA== 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 j63si4573709pge.411.2018.01.27.08.45.48; Sat, 27 Jan 2018 08:46:13 -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 S1753213AbeA0QpT (ORCPT + 99 others); Sat, 27 Jan 2018 11:45:19 -0500 Received: from mx2.suse.de ([195.135.220.15]:44976 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753122AbeA0QpQ (ORCPT ); Sat, 27 Jan 2018 11:45:16 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id EF97EACF0; Sat, 27 Jan 2018 16:38:33 +0000 (UTC) From: Michal Suchanek To: Jens Axboe , Jonathan Corbet , Borislav Petkov , Tim Waugh , "David S. Miller" , "James E.J. Bottomley" , "Martin K. Petersen" , Michal Suchanek , Kees Cook , Christophe JAILLET , Thomas Gleixner , Greg Kroah-Hartman , Kate Stewart , Philippe Ombredanne , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH resend 1/6] delay: add poll_event_interruptible Date: Fri, 26 Jan 2018 17:58:35 +0100 Message-Id: X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add convenience macro for polling an event that does not have a waitqueue. Signed-off-by: Michal Suchanek --- include/linux/delay.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/delay.h b/include/linux/delay.h index b78bab4395d8..3ae9fa395628 100644 --- a/include/linux/delay.h +++ b/include/linux/delay.h @@ -64,4 +64,16 @@ static inline void ssleep(unsigned int seconds) msleep(seconds * 1000); } +#define poll_event_interruptible(event, interval) ({ \ + int ret = 0; \ + while (!(event)) { \ + if (signal_pending(current)) { \ + ret = -ERESTARTSYS; \ + break; \ + } \ + msleep_interruptible(interval); \ + } \ + ret; \ +}) + #endif /* defined(_LINUX_DELAY_H) */ -- 2.13.6