Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3502546ybc; Thu, 21 Nov 2019 09:15:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzc/jJ9Lfko2YEN07GOVVeYPIM5hPKONSahfTf9G5djI8dvLMIOSV9IsigmgPpDzB8/Gf1z X-Received: by 2002:a17:906:b2c7:: with SMTP id cf7mr14845624ejb.218.1574356514250; Thu, 21 Nov 2019 09:15:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574356514; cv=none; d=google.com; s=arc-20160816; b=rEVc1LSYk+DpzQNwMpYkgTyVFLx38/4r7FSLPx+2PF8D7vVlPLw+qk51OWZBwDCQn1 krz8b164lJLXMKIrFgkInVVmqzB1Zt4mVNpl071cHdsWD3yKVU3mJz3GxKn6qWezCwME YhYrXEcCDCw/p4nkSRdqgfrO116fG759soLLG/YJD9G541QDHCoZwRjwMWbQiH90SBPh +AAIkD26C9V2waJBDiAbQYZvzkuam8Aslt4Lvn7ArJ9UlN1clQPXiiMMDSFQ00NSBTvY 5qkfFqVFXDDvjvp6vPyP7KrU0SzbacjiJZ9XdITInts6mjlEO0eyLiJ+p0DtT3F3fZTp nNrg== 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=XUbkFbh0B95OoEXmOcp0o97qc1OAfP497qIwQTGIum6OOVPWDBIVZ48H9RDIBWrGVK lfi7//v6MN345K9ZK/aFKQ7psVQn0gmKJZir8OXlNzQlEDjuTMpVbDvsSkyuz03Fti1s +IjMf1Rutqk+eGL/iH7WsMMCnpy+BB4gFqbfa1s7R0t/EsRhcKxn/lLWSiDMJWx9Ke+i rBwCxaGzoppdg3jU6Ozt+XdWv27yoaLJfDsQA6jb++Z7Z1j7YEBCLhwTpaMRVFvHz5dQ i7VrcicEaq6Ee6HJt21nq7qRaPbuIl82W7s1la6AN6yM/vQ7+O4tSTEga/1ZF/2ixMD/ 8Pfg== 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 l13si2071955eja.13.2019.11.21.09.14.49; Thu, 21 Nov 2019 09:15:14 -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 S1727116AbfKURNi (ORCPT + 99 others); Thu, 21 Nov 2019 12:13:38 -0500 Received: from mx2.suse.de ([195.135.220.15]:54038 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726279AbfKURNg (ORCPT ); Thu, 21 Nov 2019 12:13:36 -0500 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 66360B26C; Thu, 21 Nov 2019 17:13:35 +0000 (UTC) From: Michal Suchanek To: linux-scsi@vger.kernel.org, linux-block@vger.kernel.org Cc: Michal Suchanek , Jonathan Corbet , Jens Axboe , "James E.J. Bottomley" , "Martin K. Petersen" , Alexander Viro , Eric Biggers , "J. Bruce Fields" , Mauro Carvalho Chehab , Benjamin Coddington , Ming Lei , Chaitanya Kulkarni , Bart Van Assche , Damien Le Moal , Hou Tao , Pavel Begunkov , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jan Kara , Hannes Reinecke , "Ewan D. Milne" , Christoph Hellwig , Matthew Wilcox Subject: [PATCH v4 01/10] cdrom: add poll_event_interruptible Date: Thu, 21 Nov 2019 18:13:08 +0100 Message-Id: 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