Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4068197ybg; Fri, 25 Oct 2019 12:51:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwi+UUhlNwHQdLyS2+UFOKtqGTXz6UiN7fcytSPf4CqAifM7XQkkil1ipAJAUYUKSvshQ/ X-Received: by 2002:a17:907:41ae:: with SMTP id of22mr5208028ejb.30.1572033116769; Fri, 25 Oct 2019 12:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572033116; cv=none; d=google.com; s=arc-20160816; b=AsDpo0UKV3Hz2ok1Gzm8TTEfnkaGO1Ao5KL+E+8yYY+RznyD6QHNth8LZGm2ErmUmF N5VDjKsnqOBCBrbGyIm0canyelBru8sNoiV8jYL3S63xBMeBhLjyNCMLU1ZLwHqBxXNY 3/lIpKwb2ZkQmtM3XhSFAu6hrjOmdL1Wjnmyw7CXikbKPX4UaxyXYJOs1rbpPL5ik48R SXnH3sItyjMcd0RX3HNOkBevJBM7a1vmFTTeYHn/nXdcmssm2HER1KJYq/nLdd4q4U/C S4dJPN1dW3WxDz5hb/9nfpTt63/6+UHDiSsWBgGCeEixi+DOkBT5j1EcdQ2/ol88gT2Q C4Iw== 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; bh=hkY+aJL73a6KMMis60wL105MBcrrBE/7yE0qICaybS0=; b=lgCQzLk+ekpIP8lMk2uk4Eu8SHcYEn6chsD7JLxGkwyEQdIrOPICsEE9mUUSB1HcG5 44TA+fRD3APLkoDmO/+pWR2q8BLowoX61jvqBhM87b2UGGtnGZVpxtKmnXMe53SAUYBK 88rzQXxV9kC1RDRapHN0NOeCjskbtlLmVJYV512iL35U/7wtchkpxszuCoVoq+ZMz9i9 5td5o5bocrFQ7NeGEVTf+lKFcWGchk2i2IocmzzGlgKQn2afoTznoLvnt6JgjWaPDEwy 2nprB0yBVYXBc+Qaa6GdjQ2XSDXHKLQ74I2C49PDHvsfNO25K5/rjNRee9mfoEqQToex 3QRQ== 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 s7si1912937edd.290.2019.10.25.12.51.33; Fri, 25 Oct 2019 12:51:56 -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 S2409771AbfJYLVv (ORCPT + 99 others); Fri, 25 Oct 2019 07:21:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:56812 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726352AbfJYLVv (ORCPT ); Fri, 25 Oct 2019 07:21:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 396CDB227; Fri, 25 Oct 2019 11:21:49 +0000 (UTC) From: Michal Suchanek To: linux-scsi@vger.kernel.org Cc: Michal Suchanek , Christoph Hellwig , Matthew Wilcox , "Ewan D. Milne" , Jonathan Corbet , Jens Axboe , "James E.J. Bottomley" , "Martin K. Petersen" , Alexander Viro , "J. Bruce Fields" , Mauro Carvalho Chehab , Eric Biggers , Benjamin Coddington , Hannes Reinecke , Omar Sandoval , Ming Lei , Damien Le Moal , Bart Van Assche , Tejun Heo , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v3 1/7] cdrom: add poll_event_interruptible Date: Fri, 25 Oct 2019 13:21:38 +0200 Message-Id: <0a5ab9c86120851692aaa4390ee85ab9b2f86a8a.1572002144.git.msuchanek@suse.de> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: 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 Add convenience macro for polling an event that does not have a waitqueue. Signed-off-by: Michal Suchanek --- drivers/cdrom/cdrom.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index ac42ae4651ce..2ad6b73482fe 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -282,10 +282,24 @@ #include #include #include +#include #include +#include #include #include +#define poll_event_interruptible(event, interval) ({ \ + int ret = 0; \ + while (!(event)) { \ + if (signal_pending(current)) { \ + ret = -ERESTARTSYS; \ + break; \ + } \ + msleep_interruptible(interval); \ + } \ + ret; \ +}) + /* used to tell the module to turn on full debugging messages */ static bool debug; /* default compatibility mode */ -- 2.23.0