From patchwork Wed Aug 8 14:52:51 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: 10560153 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 BFFB596FA 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 AF99F29EBB for ; Wed, 8 Aug 2018 14:53:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3EAC2A129; 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 5870A2A543 for ; Wed, 8 Aug 2018 14:53:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727591AbeHHRNE (ORCPT ); Wed, 8 Aug 2018 13:13:04 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34362 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727523AbeHHRND (ORCPT ); Wed, 8 Aug 2018 13:13:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZyLwI4sgvja+0Ycu3vAV26ibNU7Uv/4nQC9cLsBjj64=; b=secgVkqQBA6u88MjCoUxATCklS oIkcISCvI+70OECn+FRkJr0iq98sA3sElBymFQHB6KCKbRknBtErq7Obeq2impHroJ4clBiE55q0Y PKDwpKpcTXa1j5xUNyEzDHpTQCWhqtm0tbCMOY2WkNuGLAbCp2m6ZwJK4DIhbE8QU8BUbEX8FxbHa OYvsck8XSf1ibTSxajK/Im02IKoC7z9/EaGh2aZrsDjIu4HT3lYLG6IcyoDrOA4FKVlr3o87ktFwu 4EH+3oV5fSx2/83uIkpmbSXG4sDDQmdpaApOj0ppMmoqP+fBBRwLxofgwZ9RrBfMWW6Wcoj3I6XM3 sA/tb0OQ==; 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-0002bV-Ii; Wed, 08 Aug 2018 14:52:59 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fnPpY-0000N4-Op; Wed, 08 Aug 2018 10:52:56 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Kukjin Kim , Krzysztof Kozlowski , Sylwester Nawrocki , Hans Verkuil , Al Viro , Marek Szyprowski , Julia Lawall , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 1/6] media: exynos-gsc: fix return code if mutex was interrupted Date: Wed, 8 Aug 2018 10:52:51 -0400 Message-Id: <577a6299b1881c011bb82adb8a321ce72599a33c.1533739965.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.17.1 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 routines expect a poll flag, and not error codes. So, instead of returning -ERESTARTSYS if the mutex got interrupted, return EPOLERR, just like the V4L2 VB2 code. Solves this sparce warning: drivers/media/platform/exynos-gsc/gsc-m2m.c:716:24: warning: incorrect type in return expression (different base types) drivers/media/platform/exynos-gsc/gsc-m2m.c:716:24: expected restricted __poll_t drivers/media/platform/exynos-gsc/gsc-m2m.c:716:24: got int Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/exynos-gsc/gsc-m2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c index e9ff27949a91..c9d2f6c5311a 100644 --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c @@ -713,7 +713,7 @@ static __poll_t gsc_m2m_poll(struct file *file, __poll_t ret; if (mutex_lock_interruptible(&gsc->lock)) - return -ERESTARTSYS; + return EPOLLERR; ret = v4l2_m2m_poll(file, ctx->m2m_ctx, wait); mutex_unlock(&gsc->lock); 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; } } From patchwork Wed Aug 8 14:52:53 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: 10560143 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 DF77296FA for ; Wed, 8 Aug 2018 14:53:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAECE2A071 for ; Wed, 8 Aug 2018 14:53:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEE812A129; Wed, 8 Aug 2018 14:53:01 +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 71AB42A543 for ; Wed, 8 Aug 2018 14:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727544AbeHHRNB (ORCPT ); Wed, 8 Aug 2018 13:13:01 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34318 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727516AbeHHRNB (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=x8KsiKAP/0C/BDbxDnTptWL8h/E1DPhGkTbv2vZgKVQ=; b=nWHg7wjpbvEYDhc6j1MO9923o CsM7Ihf31SzAzTo66oFrITK5JnjI3K01cHPws2/47XA2kgq9Osc766yui2vZOJdZeivaN86Ssl/wq kDGwUQSuBsDVPum9LABHzFO2qNWjIcKVJ7OGgo+xJtbiylbpYm2yRNxbxSJVsnIYRVHBk0bp33Dxq oN6/gGY+1riue/FrQbjEwUu2kDvOezUMZMeHhFBwRSMi1q9ayybU5U0B0oVgkOD15XH1CUxylWSGq UiJkABwYbXXKcq9LBhaVcKvc6igNs/jCDCcSJmk0olMzf3xgBZG0ZCTB+mxIl5mbkKTpSgO333qN2 shoiAtExw==; 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-0002bO-GR; Wed, 08 Aug 2018 14:52:59 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fnPpY-0000NB-Qm; Wed, 08 Aug 2018 10:52:56 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Sylwester Nawrocki , linux-samsung-soc@vger.kernel.org Subject: [PATCH 3/6] media: s3c-camif: fix return code for the polling routine Date: Wed, 8 Aug 2018 10:52:53 -0400 Message-Id: <5840115d72dcbf018f48f180a13e87212cc76ca3.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 here, e. g. to return EPOLERR on errors, just like the V4L2 VB2 code. Solves the following sparse warning: drivers/media/platform/s3c-camif/camif-capture.c:604:21: warning: incorrect type in assignment (different base types) drivers/media/platform/s3c-camif/camif-capture.c:604:21: expected restricted __poll_t [usertype] ret drivers/media/platform/s3c-camif/camif-capture.c:604:21: got int Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/s3c-camif/camif-capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c index b1d9f3857d3d..c02dce8b4c6c 100644 --- a/drivers/media/platform/s3c-camif/camif-capture.c +++ b/drivers/media/platform/s3c-camif/camif-capture.c @@ -601,7 +601,7 @@ static __poll_t s3c_camif_poll(struct file *file, mutex_lock(&camif->lock); if (vp->owner && vp->owner != file->private_data) - ret = -EBUSY; + ret = EPOLLERR; else ret = vb2_poll(&vp->vb_queue, file, wait); From patchwork Wed Aug 8 14:52:54 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: 10560147 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 ED22A13BB for ; Wed, 8 Aug 2018 14:53:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAC2829EBB for ; Wed, 8 Aug 2018 14:53:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEC2B2A17E; Wed, 8 Aug 2018 14:53:03 +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 13E4229EBB for ; Wed, 8 Aug 2018 14:53:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727548AbeHHRNB (ORCPT ); Wed, 8 Aug 2018 13:13:01 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34336 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727522AbeHHRNB (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=xWP6db8fUMCUU7QLu2/Z+Rbj4oN2Dq90t1H229KvlPA=; b=KjMLblqulaDmiK20D2zd2UUpd PQHhJl55pFyQuUUJAOsbGTDWu7pqi1r8VY6Fe43fnK0Hbcg3QbELdgkDxlneCpWSYgPcy5RH5IEtU 4SlDOF7j/SIZcp26dq7TNmKEmv4B+/QbPwZXUaxdgb8gQ0YJVYiqz8z7G3HVCn1OnytiG/ZXh3bIl dY9/YAeJceKIJxC2qJ773jFDip4Kwe0TlwfnHC/TxeDQIBC6Mw5+IxIuT5EhZ+hZ3CqJPCSDlq2xY xincvwsJlbUKOHFXSBzqZiOV3ScboYNPouwzbKmlYGFra30QdYipLqTM5EcKgaDhlQmyhWS1IHp9/ kSg23BAPw==; 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-0002bR-HD; Wed, 08 Aug 2018 14:52:59 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fnPpY-0000NF-Rl; 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 , Bhumika Goyal , Alexey Klimov , Markus Elfring Subject: [PATCH 4/6] media: radio-wl1273: fix return code for the polling routine Date: Wed, 8 Aug 2018 10:52:54 -0400 Message-Id: <0d8ff43fefdef24efba952540c557b8f2b418ac3.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 here, e. g. to return EPOLERR on errors, just like the V4L2 VB2 code. Solves the following sparse warning: drivers/media/radio/radio-wl1273.c:1099:24: warning: incorrect type in return expression (different base types) drivers/media/radio/radio-wl1273.c:1099:24: expected restricted __poll_t drivers/media/radio/radio-wl1273.c:1099:24: got int Signed-off-by: Mauro Carvalho Chehab --- drivers/media/radio/radio-wl1273.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c index 8f9f8dfc3497..11aa94f189cb 100644 --- a/drivers/media/radio/radio-wl1273.c +++ b/drivers/media/radio/radio-wl1273.c @@ -1096,7 +1096,7 @@ static __poll_t wl1273_fm_fops_poll(struct file *file, struct wl1273_core *core = radio->core; if (radio->owner && radio->owner != file) - return -EBUSY; + return EPOLLERR; radio->owner = file; From patchwork Wed Aug 8 14:52:55 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: 10560141 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 9AA1C90E3 for ; Wed, 8 Aug 2018 14:53:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 894582A071 for ; Wed, 8 Aug 2018 14:53:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D4A62A1A8; Wed, 8 Aug 2018 14:53:01 +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 2EB612A129 for ; Wed, 8 Aug 2018 14:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727535AbeHHRNB (ORCPT ); Wed, 8 Aug 2018 13:13:01 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34324 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727493AbeHHRNA (ORCPT ); Wed, 8 Aug 2018 13:13:00 -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=g08Dc4tL2bpIIBNdM6UZ00K3zk8oMnmEjdRm1nqKAHo=; b=dYwycVb/7fbrvXuP5OSNxmZHT DfqMkjZmlM1s3F4c1QfTZOsk9wvpAjir5caMcgJTliCW6eJh20ej8YMww8/CY+9kJtgli3fnTlqLG cMuHlVDNr9bGgnk7UpYRFRh22goP5RiKoL2JL2Al3f1AAAyns5Bt+n1mINXodd41caNOLQ/K6egCO 3bNNzcOf1pX4Nbq1uZwVKOE+Zi4MvqKe3nDoCI02QjjMiNtgWAVOTSq9h4Ry2wlLEsF33+ZLAv8qA S/odNJrvP4hE1UsJNwH4a43PguVPjQqS1r5skGml31M5stO00m1EVapit8j/2WDP8yWMDyYr1s133 N+WF9VD3Q==; 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-0002bQ-H3; Wed, 08 Aug 2018 14:52:59 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fnPpY-0000NJ-Sk; Wed, 08 Aug 2018 10:52:56 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Laurent Pinchart Subject: [PATCH 5/6] media: isp: fix a warning about a wrong struct initializer Date: Wed, 8 Aug 2018 10:52:55 -0400 Message-Id: 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 As sparse complains: drivers/media/platform/omap3isp/isp.c:303:39: warning: Using plain integer as NULL pointer when a struct is initialized with { 0 }, actually the first element of the struct is initialized with zeros, initializing the other elements recursively. That can even generate gcc warnings on nested structs. So, instead, use the gcc-specific syntax for that (with is used broadly inside the Kernel), initializing it with {}; Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/omap3isp/isp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index 03354d513311..842e2235047d 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -300,7 +300,7 @@ static struct clk *isp_xclk_src_get(struct of_phandle_args *clkspec, void *data) static int isp_xclk_init(struct isp_device *isp) { struct device_node *np = isp->dev->of_node; - struct clk_init_data init = { 0 }; + struct clk_init_data init = {}; unsigned int i; for (i = 0; i < ARRAY_SIZE(isp->xclks); ++i) From patchwork Wed Aug 8 14:52:56 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: 10560145 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 5F02213BB for ; Wed, 8 Aug 2018 14:53:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C6B82A071 for ; Wed, 8 Aug 2018 14:53:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40CD32A1A8; Wed, 8 Aug 2018 14:53:02 +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 DC4982A129 for ; Wed, 8 Aug 2018 14:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727562AbeHHRNB (ORCPT ); Wed, 8 Aug 2018 13:13:01 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34328 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727521AbeHHRNB (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=iGCfU3xzTYftxEErLEPJAXgdoHYLCLpLSzQ6xtRlA8s=; b=tPo6Ng/nNseChPYjHPEOB4/sp cxTzhXJXZzBkWOELWQ3o25LknyLUGKo6oftLZqLaCpC7nlvKZ4InXSYF3AYX/4V/ik7cyn6kZSy4t XvAickVFowwaZ86pI/uq5/uAC2c8Hv7YF5TLS//CqM72ANB9gSyw57yKYzYZH5X1ggem7MGEav2Q+ pFo3btHCYROdNRpQiaoz3FUPPoLoXOsVXrxZX+0rHFn6euszHh1cIsO7d8tnaBbwjRLDG101Ufu1l +TgPbSew6vmdgA/Fz2T1tQIuUigNqnvSUmcHmZCNbK9ZjDWvRQcCylSL4iHgH2QcXV0Yn1gG2cY1u xSxxVMDkQ==; 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-0002bP-H7; Wed, 08 Aug 2018 14:52:59 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fnPpY-0000NN-TQ; 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 6/6] siano: get rid of an unused return code for debugfs register Date: Wed, 8 Aug 2018 10:52:56 -0400 Message-Id: <76af93fcc30cb20d9560d897bd0999c5434ee9f5.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 The siano's debugfs register logic is optional: it should be ok if it fails. So, no need to check if debufs register succeeded. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/common/siano/smsdvb-debugfs.c | 10 +++++----- drivers/media/common/siano/smsdvb.h | 7 ++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c index 40891f4f842b..c95d4583498e 100644 --- a/drivers/media/common/siano/smsdvb-debugfs.c +++ b/drivers/media/common/siano/smsdvb-debugfs.c @@ -500,7 +500,7 @@ void smsdvb_debugfs_release(struct smsdvb_client_t *client) client->debugfs = NULL; } -int smsdvb_debugfs_register(void) +void smsdvb_debugfs_register(void) { struct dentry *d; @@ -517,15 +517,15 @@ int smsdvb_debugfs_register(void) d = debugfs_create_dir("smsdvb", usb_debug_root); if (IS_ERR_OR_NULL(d)) { pr_err("Couldn't create sysfs node for smsdvb\n"); - return PTR_ERR(d); - } else { - smsdvb_debugfs_usb_root = d; + return; } - return 0; + smsdvb_debugfs_usb_root = d; } void smsdvb_debugfs_unregister(void) { + if (!smsdvb_debugfs_usb_root) + return; debugfs_remove_recursive(smsdvb_debugfs_usb_root); smsdvb_debugfs_usb_root = NULL; } diff --git a/drivers/media/common/siano/smsdvb.h b/drivers/media/common/siano/smsdvb.h index b15754d95ec0..befeb9817e54 100644 --- a/drivers/media/common/siano/smsdvb.h +++ b/drivers/media/common/siano/smsdvb.h @@ -107,7 +107,7 @@ struct RECEPTION_STATISTICS_PER_SLICES_S { int smsdvb_debugfs_create(struct smsdvb_client_t *client); void smsdvb_debugfs_release(struct smsdvb_client_t *client); -int smsdvb_debugfs_register(void); +void smsdvb_debugfs_register(void); void smsdvb_debugfs_unregister(void); #else @@ -119,10 +119,7 @@ static inline int smsdvb_debugfs_create(struct smsdvb_client_t *client) static inline void smsdvb_debugfs_release(struct smsdvb_client_t *client) {} -static inline int smsdvb_debugfs_register(void) -{ - return 0; -}; +static inline void smsdvb_debugfs_register(void) {} static inline void smsdvb_debugfs_unregister(void) {};