Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp853882ybg; Wed, 23 Oct 2019 06:50:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaG/+tiKeco3iz76FaXsSxzXnExXHrHpaKbxp2iCT384tEPQrznmQhBNweMZ+hT4lR9dXS X-Received: by 2002:a50:aca5:: with SMTP id x34mr5901906edc.130.1571838646630; Wed, 23 Oct 2019 06:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571838646; cv=none; d=google.com; s=arc-20160816; b=FAf2Rm4DtLnASdz9baUY3NkLywOaHjRF9fEk8z86jOBTPe02xZwPh2cesAXMECAuDR yvbdzOD4Udo2svDaXGDyOdnW1MK7nJg8g1mnyO8q23oPs77axD/lYm5+rSUSR8FxIqLO xKmxSlDMFA7fHViqjUSBtdA7JuP5eISPHqty3ylTiHAzDX9ZHL+FLdLX+YPI3buolU2b W9PIjZuJCvfp1gkBYnnNAhTUny6EN+o7nVYFQBOvNvEeKOV6ziaNLM97ClH2drz3G6zI o8tFAO7TUvaXUv9iwmswBEVtowYChJbi9FDLHQTP3Ankfn40q6rg96PDfYBcJNAlwFli 24yg== 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=uhdk3MuQ7RsKP6Vo/7/ouyVlWJvfQVJ7ReeRxUiIO5trLUKqPP2FPP7Ya6XKy7S/Xk lB3pzp6Hbimo3IpPzlzWxQffdEPSoZJ8/8DQJD43c/ALs7emox4Xk219TOuA+N+KmoWg NXW/OgKjqi46Lw6JJnJzee7xMXcR8bMVBH0vHaSxQlzhyVqk93aJMjBIj3OUmDopIEzp DfeewYePL5bC83jaDdFDlm5xmYFgoHDBxsFAGwUiaoFQpHcGR3zb4OgbrvHn9LfmjzYp hLjnaayseJb8tmQjrllZ2cgc2ErYWO6w9Vyet90pjdG8hR2YXCvcyQP2kjjulbf5cMXE lRZA== 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 c26si15314914edx.353.2019.10.23.06.50.22; Wed, 23 Oct 2019 06:50:46 -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 S2391835AbfJWMxL (ORCPT + 99 others); Wed, 23 Oct 2019 08:53:11 -0400 Received: from mx2.suse.de ([195.135.220.15]:49286 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2391001AbfJWMxL (ORCPT ); Wed, 23 Oct 2019 08:53:11 -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 475E4B679; Wed, 23 Oct 2019 12:53:09 +0000 (UTC) From: Michal Suchanek To: linux-scsi@vger.kernel.org Cc: Michal Suchanek , Jonathan Corbet , Jens Axboe , "James E.J. Bottomley" , "Martin K. Petersen" , Alexander Viro , Mauro Carvalho Chehab , Eric Biggers , "J. Bruce Fields" , 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 v2 1/8] cdrom: add poll_event_interruptible Date: Wed, 23 Oct 2019 14:52:40 +0200 Message-Id: <7fc0315de16d99ba29b4ffc565996188d290fac9.1571834862.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