From patchwork Wed Aug 8 14:52:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10560151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 846411390 for ; Wed, 8 Aug 2018 14:53:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7325D29EBB for ; Wed, 8 Aug 2018 14:53:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 676672A17E; Wed, 8 Aug 2018 14:53:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D07529EBB for ; Wed, 8 Aug 2018 14:53:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727537AbeHHRND (ORCPT ); Wed, 8 Aug 2018 13:13:03 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34334 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727523AbeHHRNB (ORCPT ); Wed, 8 Aug 2018 13:13:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/G2udI7ET4TP7NCpkWh9pFncVAvnIFobI2W7tMfNQyc=; b=MF5pg6uAafz3xtORuIkEfQR8W 6q3SZFjaXqubaQp2prnAc5OjZaBu1nPSqHESMuodVsKuQsdl+dzGJC4bCQLdnjZhWmYAgJE8g3I80 GYn60EBsB6ioJGkm7Vj82M+qVCFiymW/BtNWG4yrYVgDlN2oQOcRz3gAL8Mu7poHZcAQPVacf21ec KeCcT6kLg1pQ/3/QjGYVMT7052F85lfGmVpjcdWUNk7wwmYub95PunAqePNkbO9P69XmqcUd6TisZ HB9zgZs8gEbxu+mM43Qrftezx0uFu03s+Pq/Lgsq44rdIqpJKz+wO5hFW4j+lxxz4N2No8KkqN7Z+ kCDsP4iJw==; Received: from [179.95.6.4] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fnPpb-0002bN-FX; Wed, 08 Aug 2018 14:52:59 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fnPpY-0000N7-Po; Wed, 08 Aug 2018 10:52:56 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Al Viro Subject: [PATCH 2/6] media: saa7164: fix return codes for the polling routine Date: Wed, 8 Aug 2018 10:52:52 -0400 Message-Id: <899042a97eedf25c7d648d80f8b6d5dfbcb837e5.1533739965.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <577a6299b1881c011bb82adb8a321ce72599a33c.1533739965.git.mchehab+samsung@kernel.org> References: <577a6299b1881c011bb82adb8a321ce72599a33c.1533739965.git.mchehab+samsung@kernel.org> In-Reply-To: <577a6299b1881c011bb82adb8a321ce72599a33c.1533739965.git.mchehab+samsung@kernel.org> References: <577a6299b1881c011bb82adb8a321ce72599a33c.1533739965.git.mchehab+samsung@kernel.org> To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All poll handlers should return a poll flag, and not error codes. So, instead of returning an error, do the right thing at saa7164, e. g. to return EPOLERR on errors, just like the V4L2 VB2 code. Solves the following sparse warnings: drivers/media/pci/saa7164/saa7164-vbi.c:632:24: warning: incorrect type in return expression (different base types) drivers/media/pci/saa7164/saa7164-vbi.c:632:24: expected restricted __poll_t drivers/media/pci/saa7164/saa7164-vbi.c:632:24: got int drivers/media/pci/saa7164/saa7164-vbi.c:637:40: warning: incorrect type in return expression (different base types) drivers/media/pci/saa7164/saa7164-vbi.c:637:40: expected restricted __poll_t drivers/media/pci/saa7164/saa7164-vbi.c:637:40: got int drivers/media/pci/saa7164/saa7164-vbi.c:647:40: warning: incorrect type in return expression (different base types) drivers/media/pci/saa7164/saa7164-vbi.c:647:40: expected restricted __poll_t drivers/media/pci/saa7164/saa7164-vbi.c:647:40: got int Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/saa7164/saa7164-vbi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c index 64ab91c24c18..221de91a8bae 100644 --- a/drivers/media/pci/saa7164/saa7164-vbi.c +++ b/drivers/media/pci/saa7164/saa7164-vbi.c @@ -629,12 +629,12 @@ static __poll_t fops_poll(struct file *file, poll_table *wait) port->last_poll_msecs_diff); if (!video_is_registered(port->v4l_device)) - return -EIO; + return EPOLLERR; if (atomic_cmpxchg(&fh->v4l_reading, 0, 1) == 0) { if (atomic_inc_return(&port->v4l_reader_count) == 1) { if (saa7164_vbi_initialize(port) < 0) - return -EINVAL; + return EPOLLERR; saa7164_vbi_start_streaming(port); msleep(200); } @@ -644,7 +644,7 @@ static __poll_t fops_poll(struct file *file, poll_table *wait) if ((file->f_flags & O_NONBLOCK) == 0) { if (wait_event_interruptible(port->wait_read, saa7164_vbi_next_buf(port))) { - return -ERESTARTSYS; + return EPOLLERR; } }