From patchwork Wed Apr 22 00:37:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 210091 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C710EC55186 for ; Wed, 22 Apr 2020 00:37:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A51E120747 for ; Wed, 22 Apr 2020 00:37:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kT5z8MPz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726115AbgDVAhk (ORCPT ); Tue, 21 Apr 2020 20:37:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbgDVAhj (ORCPT ); Tue, 21 Apr 2020 20:37:39 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2EC8C0610D5 for ; Tue, 21 Apr 2020 17:37:39 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id v63so166150pfb.10 for ; Tue, 21 Apr 2020 17:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=wKo55od9beo7o7gDVJSr1DBakN6Dlvd9g9Cm58NQzcY=; b=kT5z8MPzDIMrMTppzCuf3HzfzJrXbdmuz0uLLoRTyNEqgv3kAIgXzGyDNWeF+nxtCd gmCdgcTj+iPOt1TXjVoenmrSdalNukOcuk/yFO7tUfHRmVVXg34XTQ6BfZ9etyrTuKfq dE3y/sWs8blnl/v/VjRj/dx9auR+2o9ByAWt7CUq89XVDgfbji9mY93Ux+UFTyqaQ3Ne n5r/+LB5WRVwOTIg0+sLntalVMYcBN734hGpQuqWmtg9UB7sS+75pyWSnVXvRXvfcXvz /H9KexrYF5N8wS5jxIBDX7LwBTLYuWy0NccnAuA3Qa4hfY1iRIAtsL2cLE0258jQ2NvH U7UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wKo55od9beo7o7gDVJSr1DBakN6Dlvd9g9Cm58NQzcY=; b=OTLosdlJgNl6JpluaK2OWa7JRdGBIQ8ipD1Tz8NWe5BlL0rifoPCWJFncttct7qui9 O6+qrr24X7F/vLcafKH0WX1Y1WZDOzaqcqd6wZafB7Q7i6gQSE7tVsYki2vHlEutPh4N U/YFCXk5xlYkAels76chwP1fW8/em2i1BP74KzH+ZCcupZI5JFpFpBXYfgPWcyh/WMrC T5lfkvy6d1pgeSbTUnOBp9N2847RnxbKHJTU5fxu1/bJ3sHEjC6LEDbIm2YaUPywVSpg uqouNN41JeWIRMtXyJ5yT9N8+KTNYt2EJ+6KvmyOIGJN6X2UaUtLDHxtOAWHVO8hp9yt PwtA== X-Gm-Message-State: AGi0PuanWe1rI+T6dALpIQLTyXMjePASWPhPDfG+4YkLeiWYDUolIFhL OmsUL+fWhYWQKdTfMOcVRnSI/mIt X-Google-Smtp-Source: APiQypL/M7Q6rKy9AfkHd99uKkCv0+A1qLE7QNxJLZ8vZpbzJvpJmDb6Lb+opgGWhp6/VfFGQh4TEQ== X-Received: by 2002:a63:1820:: with SMTP id y32mr22934444pgl.182.1587515858925; Tue, 21 Apr 2020 17:37:38 -0700 (PDT) Received: from localhost.localdomain (76-14-109-232.rk.wavecable.com. [76.14.109.232]) by smtp.gmail.com with ESMTPSA id y16sm1359676pfp.45.2020.04.21.17.37.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 17:37:38 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 02/12] utils: remove extra commas Date: Tue, 21 Apr 2020 17:37:25 -0700 Message-Id: <20200422003735.3891-2-rosenp@gmail.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200422003735.3891-1-rosenp@gmail.com> References: <20200422003735.3891-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with -Wextra-semi-stmt Signed-off-by: Rosen Penev --- utils/cec-compliance/cec-compliance.cpp | 2 +- utils/cec-follower/cec-follower.cpp | 2 +- utils/v4l2-compliance/v4l2-test-buffers.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp index 713e2a58..1c62b5c9 100644 --- a/utils/cec-compliance/cec-compliance.cpp +++ b/utils/cec-compliance/cec-compliance.cpp @@ -336,7 +336,7 @@ static std::string audio_format_code2s(__u8 format_code) return "Extended"; default: return "Illegal"; - }; + } } std::string extension_type_code2s(__u8 type_code) diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp index 36bd2fbb..1eeae2d4 100644 --- a/utils/cec-follower/cec-follower.cpp +++ b/utils/cec-follower/cec-follower.cpp @@ -189,7 +189,7 @@ static std::string audio_format_code2s(__u8 format_code) return "Extended"; default: return "Illegal"; - }; + } } std::string extension_type_code2s(__u8 type_code) diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp index 3b45711d..93df7034 100644 --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp @@ -1752,7 +1752,7 @@ static int setupDmaBuf(struct node *expbuf_node, struct node *node, fail_on_test(buf.qbuf(node, false)); for (unsigned p = 0; p < buf.g_num_planes(); p++) { - fail_on_test(buf.g_fd(p) != q.g_fd(i, p));; + fail_on_test(buf.g_fd(p) != q.g_fd(i, p)); fail_on_test(buf.g_length(p) != q.g_length(p)); if (v4l_type_is_output(q.g_type())) fail_on_test(!buf.g_bytesused(p)); From patchwork Wed Apr 22 00:37:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 210090 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97914C2BA19 for ; Wed, 22 Apr 2020 00:37:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75D7A2071E for ; Wed, 22 Apr 2020 00:37:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qxXp/xkD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726378AbgDVAhm (ORCPT ); Tue, 21 Apr 2020 20:37:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726377AbgDVAhm (ORCPT ); Tue, 21 Apr 2020 20:37:42 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0454DC0610D5 for ; Tue, 21 Apr 2020 17:37:42 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id r14so185867pfg.2 for ; Tue, 21 Apr 2020 17:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=MaMnXEhvCiHisZ+3swQRFXUzrnMfvh2Y085bklTdxKI=; b=qxXp/xkDiBIqHMqowZiE1WQBDZx6HtZZG8WM/t+0l8EY+MYT5RrJGvib54tqoC/Y6y gIk34ddR2qfZVufgaHl6htOp9ubamggFBRzJHneUJgh3pDu1NO93J8zUD6f4n+4JF0EX hgeesC36qYICtr+sytTbj9ExEmJg6R11gMlojk0C9eFZmcGoz5nETOuIrKs5VWZkRn8I Mvm3nW2zJz6nTFuiNlZe5RyDhfHdupFxBlLWz//OlvBWiSYR3aWA0JwVy9EJ7cIVKJeQ 6Jz025YpjuroOfBaN+VJQ8RBeiLKfyhdg9AoSdIUh9nASq/GSaBkFKvaR4oRgV9bb/DU +a1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MaMnXEhvCiHisZ+3swQRFXUzrnMfvh2Y085bklTdxKI=; b=t9HcRS9sA1UtR28XV//w2M3qh9lNxhcvXn8Ay3fU8rcI/oHWAM82uI9szClEGiBJK6 UW5OQZ1LjhVsAI6y5FFoWYdLAwVbSlpUL4EnpdRltIST6DOONlTkADjGDRNEP305mg+L UwR03TlTIZR+Lummt+9xO50FxV9qgicmin+GIlEv0EcHar9o4YupLoebpeDSbJKB/sal G1A3zM2+8UzgZpXO1xY3QVwLCmApbeNPDfCnfDrvq9cP+R46fgfwSiFEhD/X1cEtPPcn KN+GqXFOiTpKxZd97QE3azliC3oIk64OxCWeP/K5s4nhDSwuMD448qHdx1ZtuFDsTBX5 Amlw== X-Gm-Message-State: AGi0PuZ8uyOvcypCcKfKtyQsD+NT7cxcQzQdg8EZl944Totu9xnCopHZ goXNt7D2uLVv1c+fGIAfn0PaeHyg X-Google-Smtp-Source: APiQypLATzhkQHzHBkTiIPGVBfLDGJ+lZGi2GTWTGn/dMS0bZ0mSbzh+WIexlpABAtqpPUo5EB1mXA== X-Received: by 2002:aa7:84cd:: with SMTP id x13mr23696394pfn.41.1587515861260; Tue, 21 Apr 2020 17:37:41 -0700 (PDT) Received: from localhost.localdomain (76-14-109-232.rk.wavecable.com. [76.14.109.232]) by smtp.gmail.com with ESMTPSA id y16sm1359676pfp.45.2020.04.21.17.37.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 17:37:40 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 04/12] utils: don't check unsigned for < 0. Date: Tue, 21 Apr 2020 17:37:27 -0700 Message-Id: <20200422003735.3891-4-rosenp@gmail.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200422003735.3891-1-rosenp@gmail.com> References: <20200422003735.3891-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with -Wtautological-unsigned-zero-compare Signed-off-by: Rosen Penev --- utils/v4l2-compliance/v4l2-test-controls.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp index 8c4480be..251a6049 100644 --- a/utils/v4l2-compliance/v4l2-test-controls.cpp +++ b/utils/v4l2-compliance/v4l2-test-controls.cpp @@ -80,8 +80,6 @@ static int checkQCtrl(struct node *node, struct test_query_ext_ctrl &qctrl) return fail("min > max\n"); if (qctrl.step == 0) return fail("step == 0\n"); - if (qctrl.step < 0) - return fail("step < 0\n"); if (static_cast(qctrl.step) > static_cast(qctrl.maximum - qctrl.minimum) && qctrl.maximum != qctrl.minimum) return fail("step > max - min\n"); From patchwork Wed Apr 22 00:37:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 210089 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 891A2C54FD0 for ; Wed, 22 Apr 2020 00:37:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60E3A2071C for ; Wed, 22 Apr 2020 00:37:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rgzyFpWU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726389AbgDVAhp (ORCPT ); Tue, 21 Apr 2020 20:37:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726379AbgDVAho (ORCPT ); Tue, 21 Apr 2020 20:37:44 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 938D5C0610D5 for ; Tue, 21 Apr 2020 17:37:44 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id p8so216456pgi.5 for ; Tue, 21 Apr 2020 17:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=aEM5+kfsmk4vdTVE3Cb72MGS4DrfvD/7ptZGfPBt9b8=; b=rgzyFpWU0SGdhhmLLNFQp4+kUHR6vy14vrtLiJjl6OUS56pO7E6FNysHVp7MD1T0e5 iIsIJ6gEFDFrt5bpLU5G9v4Z1Id3CjEmUfrMK9njeGbtERzrVM6ph109ZgfsAVniy8Nf m00bL4jezGF7FDJyeQLAJrISTV1xSSrarKR9drtHfog3GIfqEp50gJaIujD2d94NeFdr DgA920TxvfE/t7+fD75Q32iIMMyQB0hLpTdDJRRi+rEBNd3IJ3IbjzeM8AR7qzhtfFBH RAJeksTRu9sXkHbPJPVjz3FnCj61KtZZsMP5mejayI7aucbrTyDoH+tf8qpg3R6Q7mZ1 r0BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aEM5+kfsmk4vdTVE3Cb72MGS4DrfvD/7ptZGfPBt9b8=; b=KDjmLQ6q8ezcn78SdwHzh+NccdauZL0JRopyooC904pJ8TB4emdRxxRmb2zArNnMcU j/8XtGcjlxsDSxgUyFrOQ7Sf37DVmTbwkZ9nUBtYkwThxFp0q2L11fcmyHKSd72sUva3 nMZedN8lvz3w/rZbaE1u8HHEfOhSZVcOdxcZHw1SGbqYPs7ql1N/Ryk0yo+ENJ5PQ+r6 w1/jniHMovSAUCkY9gTXOCWyDOso7T4Qc2Isr0BSgMrbBn90few/4u4OXi4ZAzQ2gkX1 yJB4Pn7nmFwvbb0s91kfq37lbw+cXQ3gAOHeyjiNBOU/tVdd4zjL7UI2UI55zoOTnZvh 2mCg== X-Gm-Message-State: AGi0PubEzgg2JkIw2OGhbRLIMn18wfkPNa8wDt9Ir34sTQhAE0PvUomB mx4NsIomyIq8ao+m3mk4f8zioXmH X-Google-Smtp-Source: APiQypKrJkgl/1PXq0ZELJIbjorXz7sXND/EV3Ccg0lhhZwHFXxDU/+BozVGsd8QRJDWZ7/BJ/ULIQ== X-Received: by 2002:aa7:8429:: with SMTP id q9mr23944509pfn.205.1587515863774; Tue, 21 Apr 2020 17:37:43 -0700 (PDT) Received: from localhost.localdomain (76-14-109-232.rk.wavecable.com. [76.14.109.232]) by smtp.gmail.com with ESMTPSA id y16sm1359676pfp.45.2020.04.21.17.37.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 17:37:43 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 06/12] utils: add noreturn attribute and remove dead code Date: Tue, 21 Apr 2020 17:37:29 -0700 Message-Id: <20200422003735.3891-6-rosenp@gmail.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200422003735.3891-1-rosenp@gmail.com> References: <20200422003735.3891-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with -Wmissing-noreturn and -Wunreachable-code-return Signed-off-by: Rosen Penev --- utils/v4l2-compliance/v4l2-compliance.cpp | 9 ++------- utils/v4l2-dbg/v4l2-dbg.cpp | 7 +------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index b3a18492..fbf34914 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -155,6 +155,7 @@ static struct option long_options[] = { {0, 0, 0, 0} }; +__attribute__((noreturn)) static void usage() { printf("Usage:\n"); @@ -482,6 +483,7 @@ static void restoreState() node->reopen(); } +__attribute__((noreturn)) static void signal_handler_interrupt(int signum) { restoreState(); @@ -1544,7 +1546,6 @@ int main(int argc, char **argv) switch (ch) { case OptHelp: usage(); - return 0; case OptSetDevice: device = make_devname(optarg, "video", media_bus_info); break; @@ -1619,7 +1620,6 @@ int main(int argc, char **argv) color_component = 2; else { usage(); - exit(1); } break; case 1: @@ -1634,7 +1634,6 @@ int main(int argc, char **argv) break; default: usage(); - exit(1); } } break; @@ -1647,7 +1646,6 @@ int main(int argc, char **argv) show_colors = isatty(STDOUT_FILENO); else { usage(); - exit(1); } break; case OptNoWarnings: @@ -1669,13 +1667,11 @@ int main(int argc, char **argv) fprintf(stderr, "Option `%s' requires a value\n", argv[optind]); usage(); - return 1; case '?': if (argv[optind]) fprintf(stderr, "Unknown argument `%s'\n", argv[optind]); usage(); - return 1; } } if (optind < argc) { @@ -1684,7 +1680,6 @@ int main(int argc, char **argv) fprintf(stderr, "%s ", argv[optind++]); fprintf(stderr, "\n"); usage(); - return 1; } bool direct = !options[OptUseWrapper]; int fd; diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp index cd387d1d..7b986a50 100644 --- a/utils/v4l2-dbg/v4l2-dbg.cpp +++ b/utils/v4l2-dbg/v4l2-dbg.cpp @@ -162,6 +162,7 @@ static struct option long_options[] = { {0, 0, 0, 0} }; +__attribute__((noreturn)) static void usage() { printf("Usage: v4l2-dbg [options] [values]\n" @@ -387,13 +388,11 @@ static int parse_subopt(char **subs, const char * const *subopts, char **value) if (opt == -1) { fprintf(stderr, "Invalid suboptions specified\n"); usage(); - exit(1); } if (*value == NULL) { fprintf(stderr, "No value given to suboption <%s>\n", subopts[opt]); usage(); - exit(1); } return opt; } @@ -429,7 +428,6 @@ int main(int argc, char **argv) if (argc == 1) { usage(); - return 0; } for (i = 0; long_options[i].name; i++) { if (!isalpha(long_options[i].val)) @@ -467,7 +465,6 @@ int main(int argc, char **argv) switch (ch) { case OptHelp: usage(); - return 0; case OptSetDevice: device = optarg; @@ -538,13 +535,11 @@ int main(int argc, char **argv) fprintf(stderr, "Option `%s' requires a value\n", argv[optind]); usage(); - return 1; case '?': fprintf(stderr, "Unknown argument `%s'\n", argv[optind]); usage(); - return 1; } } From patchwork Wed Apr 22 00:37:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 210087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72573C5518B for ; Wed, 22 Apr 2020 00:37:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F4752071C for ; Wed, 22 Apr 2020 00:37:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HlFVi1fZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726379AbgDVAhq (ORCPT ); Tue, 21 Apr 2020 20:37:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726398AbgDVAhp (ORCPT ); Tue, 21 Apr 2020 20:37:45 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E4CAC0610D5 for ; Tue, 21 Apr 2020 17:37:45 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id d17so230497pgo.0 for ; Tue, 21 Apr 2020 17:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=VUyUxdZMp9MG1RdHKiRpf2SfXiWcM2Xk3kgdF713aYg=; b=HlFVi1fZP+RzQrlTe/TjrKtT0vVcq260bZ62/R94iA6QPK+hyyFlgYkYYbtVDQlo2t iWIwrvHDavYCcenjPsmj7GcahUgd2Fk+JuzUTT1OGtW/dz+Fqz7fpeLZMehN/jZJgY36 F/14KwFvzBlttI8+zJdWMAYJdBcLBotcfzbJ3Ib+IOSFiuVeE+PxoaVMtnf502gopEUD qc8hHMmLOpcZPY+H/hUi/SdeIPuPNLaqiLMR0JttsxnQmmRZfE5xqdF95s929IFno84m r0Q4q3J/0LvOEvOX89LjiKWBO8v1UwHg4mhvoPQGWauw3ZsF2le+k5gyMl0/NiTT/ldU ogLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VUyUxdZMp9MG1RdHKiRpf2SfXiWcM2Xk3kgdF713aYg=; b=P4YUd7XUYrCNZF4VeHIxvP58HIPwafvHW9KUCg8lO1tIBkZqZVJjHA7P5Ff7iK2aR3 lrNJLlKIq2KjHitusOpIMqP8UqKm9+m8d/APyUtz+tnh+smzq4vvwUP0Vllgh62/Ijfu OpTnXKyOTM+pfRjys2Nl52YkI4ClelKw8MnmQpSZOEr5ymRH6er3Gwyb2gGFrvmnJJAK z/BixEnn2e6Nnv5mzn26y9tTmWDJ9GmxWbQeZZ0IgHFrBf3xowA/BrdV3xvAKcFEnIep Nrhi6FSjCfvd30LrJJPn9+BReAUotQXj1Ea1BHn4ZfU/UREt1LOAuORGyj1r999EGEK0 RCjA== X-Gm-Message-State: AGi0PuZT7Q0QpuXX2auURkgjty9Tecbuwe1RGjt3P8MFE83v4WxkoRrg qmDDBxV2K1AZzOi1rXYYLI/IDUGh X-Google-Smtp-Source: APiQypLnzzNScCQBRXOQL86qQCNh5SotHZ1MwwSPUfG3gSRV3d3jASSbXduDqqxlEmIYgm13U2c/dg== X-Received: by 2002:a62:4e88:: with SMTP id c130mr2805930pfb.122.1587515864676; Tue, 21 Apr 2020 17:37:44 -0700 (PDT) Received: from localhost.localdomain (76-14-109-232.rk.wavecable.com. [76.14.109.232]) by smtp.gmail.com with ESMTPSA id y16sm1359676pfp.45.2020.04.21.17.37.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 17:37:44 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 07/12] utils: fix implicit double promotion Date: Tue, 21 Apr 2020 17:37:30 -0700 Message-Id: <20200422003735.3891-7-rosenp@gmail.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200422003735.3891-1-rosenp@gmail.com> References: <20200422003735.3891-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with -Wimplicit-float-conversion Signed-off-by: Rosen Penev --- utils/rds-ctl/rds-ctl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp index 0e497b2a..cc1d3bf7 100644 --- a/utils/rds-ctl/rds-ctl.cpp +++ b/utils/rds-ctl/rds-ctl.cpp @@ -525,7 +525,7 @@ static void print_rds_statistics(const struct v4l2_rds_statistics *statistics) if (statistics->block_cnt) block_error_percentage = - (static_cast(statistics->block_error_cnt) / statistics->block_cnt) * 100.0; + (static_cast(statistics->block_error_cnt) / statistics->block_cnt) * 100.0f; printf("block errors / group errors: %u (%3.2f%%) / %u \n", statistics->block_error_cnt, block_error_percentage, statistics->group_error_cnt); @@ -534,7 +534,7 @@ static void print_rds_statistics(const struct v4l2_rds_statistics *statistics) if (statistics->block_cnt) block_corrected_percentage = ( - static_cast(statistics->block_corrected_cnt) / statistics->block_cnt) * 100.0; + static_cast(statistics->block_corrected_cnt) / statistics->block_cnt) * 100.0f; printf("corrected blocks: %u (%3.2f%%)\n", statistics->block_corrected_cnt, block_corrected_percentage); for (int i = 0; i < 16; i++) From patchwork Wed Apr 22 00:37:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 210088 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 813C4C54FD0 for ; Wed, 22 Apr 2020 00:37:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E8EF20747 for ; Wed, 22 Apr 2020 00:37:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZMum0XlN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726421AbgDVAht (ORCPT ); Tue, 21 Apr 2020 20:37:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726409AbgDVAhr (ORCPT ); Tue, 21 Apr 2020 20:37:47 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41ACBC0610D5 for ; Tue, 21 Apr 2020 17:37:46 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id x15so190535pfa.1 for ; Tue, 21 Apr 2020 17:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=HjkNxBUCJzhuspL3b+E82EInDzSfGD1DDbs06ExUmdA=; b=ZMum0XlNk4nU/6Cn9OHAvmf/EKvLMDzzKvXqupmRy/pkP2KuE+c4biFkC9+QNAjzVW YeJNkBX2QPAU2JoslTrCHOcrIiAbmZTftgTMlX+Bewn/ULInmwI8fK2dEBNNJ2d47MTS 0QoIhqk/YXiPJ1GPzSLBXypD7bxBP16fSh/JymkFtIjYQ1QcuOb1GoAYR8puF5ei02zC X9y+yJpTblMOx8quHGKFwlKwxtUjsV81WE9WmhOTGj6yS5ZaldSBjhTe6pchRXbXhbXd 0vigYXv86yH8DItKW0Bf6ctwd7psi20nMcfG2DghLEQdQj0kYk8aZqK9prqCzJ73PjBr gfHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HjkNxBUCJzhuspL3b+E82EInDzSfGD1DDbs06ExUmdA=; b=lZrkEOE8ze6zK+kfptfI+0yEyOQ+Lv+In5NBgwlu8/WcBybqCXU6eV4J3aFOrmvCcd PhZy6/SSl8prd/pLGh+EhdbVQnx7uUy+CBfJeTKkaRG3w271LqRSqx140qp7oSzTCBUV Plc7LiLsWVwTqAVPodgeYRPt6F0Vk6oOMBG2A6JkGyHswomf1F2UsgpBMNjtDtA3p/Vy YAD90jA0FLluSS57TtclOkNsiuVQmDPzXCPUY4IZX+rQWKpusyIrRkMrWWpPjOpDNErO 5rA1HjoVBBIOIJLxxbwn859wmHrcFSWjFuDzM2IUfZkrTEro15mWxMoNBUVody3dCJkJ 3NDA== X-Gm-Message-State: AGi0Puak9hIqOxIx+e43W3P/aUX35vDfD0mnBztrqfMnTDTkyw/u9QqX ZcFITYgJT5Gtrw+WfRMQsgwO+49o X-Google-Smtp-Source: APiQypJ0pZW6p/ektGyxhfwywTHefm0b+a2Ixu+dqhrTxpGIY4dotfwP4s509WuweXNGH6sXcmVtiA== X-Received: by 2002:a63:257:: with SMTP id 84mr17207773pgc.284.1587515865610; Tue, 21 Apr 2020 17:37:45 -0700 (PDT) Received: from localhost.localdomain (76-14-109-232.rk.wavecable.com. [76.14.109.232]) by smtp.gmail.com with ESMTPSA id y16sm1359676pfp.45.2020.04.21.17.37.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 17:37:45 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 08/12] utils: initialize variable Date: Tue, 21 Apr 2020 17:37:31 -0700 Message-Id: <20200422003735.3891-8-rosenp@gmail.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200422003735.3891-1-rosenp@gmail.com> References: <20200422003735.3891-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org clang is too stupid to figure out that this depends on the bool. Fixes -Wconditional-uninitialized Signed-off-by: Rosen Penev --- utils/cec-ctl/cec-ctl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index 3acfe0b2..f4133494 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -2091,7 +2091,7 @@ int main(int argc, char **argv) }; char *value, *endptr, *subs = optarg; bool have_cmd = false; - __u8 cmd; + __u8 cmd = 0; __u8 size = 0; __u8 bytes[14]; From patchwork Wed Apr 22 00:37:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 210086 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17A79C55186 for ; Wed, 22 Apr 2020 00:37:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA73E2071E for ; Wed, 22 Apr 2020 00:37:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nFoXvso1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726328AbgDVAhw (ORCPT ); Tue, 21 Apr 2020 20:37:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726409AbgDVAhu (ORCPT ); Tue, 21 Apr 2020 20:37:50 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 122F5C0610D5 for ; Tue, 21 Apr 2020 17:37:50 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id t4so197825plq.12 for ; Tue, 21 Apr 2020 17:37:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=YGJ8/DZCc9FFoo5IGFrlESNs8sn6Q6EVkv7cKPznHe0=; b=nFoXvso18amYPZqijC7+lEsfcLCzsf4DQwwyB8rNeb68YCiffcbhYtBOVDjE6WhBuG 3Sa6N4Y/X2rtzs4IiZicaiEHlQDVM84nhBxdhKFAkyhDEnNY9lh+729W3OEk+VwoOL63 m+Y5cArI48Zt4+gqCfAxj9ItlIY/Gm06lnbts6CdOtgB8Kjl2Rk6jFS+CJKK+d+LfkNc 7zkoGyj6fRg6rGEqh5gA0lQ8dh2sFmRdKUqTzj7yt/LdCprgirEWFTngAvFFaXYzcIxm qwkEO2WvNfkdTPqIyF2PJXNX3oOG43fmndTtFGnG0N4xb7RZ7qHUUiznfnEnCeBezt/2 Y0Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YGJ8/DZCc9FFoo5IGFrlESNs8sn6Q6EVkv7cKPznHe0=; b=HLbYBrxo/kC9bM40RMNcBDVhfvZOs/v/sfgFBEd+PxbmsC4YZeJgom3o4+D4CYg0wu Go7jucMX9Ud61bmoLmGRvTWRnKJakjYg4rhy/oF/MTC16S3sDSIOI6h8G4/ZahYlmzYX 6SClVtarx5mIJ18ipdWKh2A/3+4kQQ0ihJOL3L67LYx9hmxqH1LHa1TuLUoP37iMDwnS UYrG3ei5VvB64XIVm1CKhZvO5RfC6fHIzzUF7r3oiwdFMFqfUTf6RBan5nh1tUgipJr/ fntYy/lDrlHlIxw7ETj+g8azg8GN7NDskjSkukNY/tUJvyFXWGlPhfRoP6OhZrrq1zGI oYyw== X-Gm-Message-State: AGi0PuYmDw6DUjkyE4PPKCHM/fo2LaGpyyGvR6Ld2Lff6O0npSoq/h/W jTyV1Z4gG2tT4Psh5xvszdGWcLmx X-Google-Smtp-Source: APiQypKGw2Vz9Tvxffcn3c5XyxQUukZ7A5RihXihbDzYqSg/nIK9SbAF1N/+rVjYXWToAQk6f6rlzg== X-Received: by 2002:a17:90a:6403:: with SMTP id g3mr7628389pjj.99.1587515869181; Tue, 21 Apr 2020 17:37:49 -0700 (PDT) Received: from localhost.localdomain (76-14-109-232.rk.wavecable.com. [76.14.109.232]) by smtp.gmail.com with ESMTPSA id y16sm1359676pfp.45.2020.04.21.17.37.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 17:37:48 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 12/12] utils: fix wrong format Date: Tue, 21 Apr 2020 17:37:35 -0700 Message-Id: <20200422003735.3891-12-rosenp@gmail.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200422003735.3891-1-rosenp@gmail.com> References: <20200422003735.3891-1-rosenp@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Found with -Wformat-pedantic Signed-off-by: Rosen Penev --- utils/v4l2-compliance/v4l2-test-formats.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp index 9e98cf99..390702bc 100644 --- a/utils/v4l2-compliance/v4l2-test-formats.cpp +++ b/utils/v4l2-compliance/v4l2-test-formats.cpp @@ -664,10 +664,10 @@ static bool matchFormats(const struct v4l2_format &f1, const struct v4l2_format return true; printf("\t\tG_FMT: %dx%d@%dx%d, %d, %x, %p, %d, %p, %x\n", win1.w.width, win1.w.height, win1.w.left, win1.w.top, win1.field, - win1.chromakey, win1.clips, win1.clipcount, win1.bitmap, win1.global_alpha); + win1.chromakey, (void *)win1.clips, win1.clipcount, win1.bitmap, win1.global_alpha); printf("\t\tTRY/S_FMT: %dx%d@%dx%d, %d, %x, %p, %d, %p, %x\n", win2.w.width, win2.w.height, win2.w.left, win2.w.top, win2.field, - win2.chromakey, win2.clips, win2.clipcount, win2.bitmap, win2.global_alpha); + win2.chromakey, (void *)win2.clips, win2.clipcount, win2.bitmap, win2.global_alpha); return false; case V4L2_BUF_TYPE_VBI_CAPTURE: case V4L2_BUF_TYPE_VBI_OUTPUT: