From patchwork Wed Apr 22 00:37:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11502583 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D9A5B1392 for ; Wed, 22 Apr 2020 00:37:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD7C92071C for ; Wed, 22 Apr 2020 00:37:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TbaTvr6F" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726061AbgDVAhj (ORCPT ); Tue, 21 Apr 2020 20:37:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbgDVAhi (ORCPT ); Tue, 21 Apr 2020 20:37:38 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1993C0610D5 for ; Tue, 21 Apr 2020 17:37:38 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id x26so203956pgc.10 for ; Tue, 21 Apr 2020 17:37:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=b4qN33twK9Pm4HfbghORT03LplAOhJxJw2HuMucg0WI=; b=TbaTvr6FKclQFCewjuMuOdGQYyQjBBARHOhYyakRTZdGLUw/rBrwESkgkuOdfk0mxa ZANiGAs3m/rGV/zMr5D0/hokm4AioasfB9t9s5fXhzBjo9ciapkt3hTAWxR/y4bZtJ+V fSuOZpOnm6+e8TNN5b4wwPwpLapcDq0zw12WOnyHmKaKLJa4FKgMBi0gPFy186PXLrMm ttLgfnIxzC8I1bzHhCR6kLCazfq7cxtZMapAL2r7CLmM89HCrnap7TrdMcOw3TkslOFt 0XzIj/WkBlWQH7K2DL1My8bQh4kCSlwHZ/Pfkf5BF7Gf59QShPZXWyEaYsqq31tEzLFe 9X0w== 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:mime-version :content-transfer-encoding; bh=b4qN33twK9Pm4HfbghORT03LplAOhJxJw2HuMucg0WI=; b=DKg6EarwbvE5a2klzCEyJ83dL+XZQh68aBXU/lL24Iqql6rcQs1zbGou3kbfIJoyd7 9f6J0T7SMb7mQkmgQhZ29/xTd3zyza7tFm8exDhxPRJeCJG6dxr009Ke6Ciz/dlb17RQ AOOj49R7il8m3ggzVcZG530g82ROkZQt5OvAAS4rdwFQ8Z+hMph4OTvEvuxEc/yVfiRZ x1UfpuEA48hUcmcn0Gx2SwjWciT+9NLP++OnqihJ6a50ZZxVhu4RLybZ7INssrDikkz2 ioklI8ncoeTsJZ0+M6XkQusWwoOBb3us4LD6pXZXuagufs9jhEFhtuz7WOZarPJG+Wxq PxCw== X-Gm-Message-State: AGi0PuYA2MZSzOMXrQMbn112D1n7Hhcs5cQF4XYo6wG72shrOvMjRdgF tcVhj4ok8HkftNfSn0Lx/HJUYJ1F X-Google-Smtp-Source: APiQypKntyEfvElKLtkTqe0MkykBvlG0gwmhUuXztTtREq+3jmuZB6KGdWPczTuAfZR8hHE75c7VUw== X-Received: by 2002:a63:da10:: with SMTP id c16mr1879983pgh.208.1587515857878; Tue, 21 Apr 2020 17:37:37 -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.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 17:37:37 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 01/12] utils: fix compilation with C++98 Date: Tue, 21 Apr 2020 17:37:24 -0700 Message-Id: <20200422003735.3891-1-rosenp@gmail.com> X-Mailer: git-send-email 2.25.2 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Rosen Penev --- utils/cec-compliance/cec-test.cpp | 4 ++-- utils/rds-ctl/rds-ctl.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp index 032ff5ad..cc07998a 100644 --- a/utils/cec-compliance/cec-test.cpp +++ b/utils/cec-compliance/cec-test.cpp @@ -908,7 +908,7 @@ static int tuner_ctl_test(struct node *node, unsigned me, unsigned la, bool inte cec_msg_give_tuner_device_status(&msg, true, CEC_OP_STATUS_REQ_ONCE); fail_on_test(!transmit_timeout(node, &msg)); fail_on_test(timed_out_or_abort(&msg)); - info = {}; + memset(&info, 0, sizeof(info)); cec_ops_tuner_device_status(&msg, &info); if (!memcmp(&info, &info_vec[0], sizeof(info))) break; @@ -935,7 +935,7 @@ static int tuner_ctl_test(struct node *node, unsigned me, unsigned la, bool inte cec_msg_give_tuner_device_status(&msg, true, CEC_OP_STATUS_REQ_ONCE); fail_on_test(!transmit_timeout(node, &msg)); fail_on_test(timed_out_or_abort(&msg)); - info = {}; + memset(&info, 0, sizeof(info)); cec_ops_tuner_device_status(&msg, &info); if (memcmp(&info, &(*iter), sizeof(info))) { log_tuner_service(info); diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp index 0511fe5d..0e497b2a 100644 --- a/utils/rds-ctl/rds-ctl.cpp +++ b/utils/rds-ctl/rds-ctl.cpp @@ -918,7 +918,7 @@ static void get_options(const int fd, const int capabilities, struct v4l2_freque printf("\tFrequency range : %.1f MHz - %.1f MHz\n", vt.rangelow / 16.0, vt.rangehigh / 16.0); printf("\tSignal strength/AFC : %ld%%/%d\n", - std::lround(vt.signal / 655.35), vt.afc); + lround(vt.signal / 655.25), vt.afc); printf("\tCurrent audio mode : %s\n", audmode2s(vt.audmode)); printf("\tAvailable subchannels: %s\n", rxsubchans2s(vt.rxsubchans).c_str()); 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: 11502585 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC8D61392 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 A6F842074B 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:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11502587 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E4AA92C for ; Wed, 22 Apr 2020 00:37:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D0C82074B for ; Wed, 22 Apr 2020 00:37:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rKUHj8CS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726359AbgDVAhl (ORCPT ); Tue, 21 Apr 2020 20:37:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbgDVAhl (ORCPT ); Tue, 21 Apr 2020 20:37:41 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16948C0610D5 for ; Tue, 21 Apr 2020 17:37:41 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id r4so218583pgg.4 for ; Tue, 21 Apr 2020 17:37:41 -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=5PoFrS16GeUJcA8IoSCQPJL46iqD0Bx67xO3NpMV9Ms=; b=rKUHj8CSntW3SAbVdEHIMPBJmbb7lKiL79vRAjwEg498Px/pCPZwDaw7GiQvvOHdL+ aDYQ03TK4JwCTRiDXMqbYHp/JekwrwKlxK6mk0/dDgMHuUz6YK2cd1Jz0Fb9JT+2HNVE c1Wy78a+cHrqovFAjuOU+TQFTQBj55WrwSYV7ivBq8pG9IoY28mWbMJrwX+tSEQ2h19Y 3sC1MYiUrpo8icpoJwZDP+blyBOoYBVpI0nKJj196y8Bi1CM9HbO4QT+b3qip6iX0NKa lmPP4kpoczmxyF4WJ5NWSY1rn/dijdDDnzORbTwIbZnfIW4M1HFV0/CTu7e1iuvmprnR rREQ== 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=5PoFrS16GeUJcA8IoSCQPJL46iqD0Bx67xO3NpMV9Ms=; b=Pi2eufxRwz+9p9VLNKb5b81bAZPwI4QRaW52b5dBavG/106p+dnMETOQnI0tqVyDW9 oPgLKbicFjoTAQpgTdHEr54HORtcak7SWRZLIm7j8FbVN0GCZ1lAvNoyhIr1drdABkMs 1/444ISkQFOLu0Z92RQTIuvcbrt66CHBjYcXloRLdvTTlLgSegRPjInVq68dOeV6t/5z WgBr7Xg/U6XyRfVO6abTJHSUTRKCeBOBQkItaVPslnpM7KFsTcaiiuV6NkQ51aFAMQxD 7CSfC6FJeSERKF20IPM4UPSPTm9aYsZ2zX82A13oX5RINMZ7Q0tmKXWZJyUfPKREjnxS 6Jig== X-Gm-Message-State: AGi0PuZashVKcedWw7h8ebdzXa78oBEmhuBdLylwrx+ieOjn8zHwrHvZ Fyq6UQt3sUV5P6NSbDDAGs0oPOG5 X-Google-Smtp-Source: APiQypK+H9mDKpWWzO84qW80AOWNO0EDtsCLeNFRphdHfZB2YQAyKjp+WmzbaJTB2jxj1647X+4thQ== X-Received: by 2002:a63:1a1e:: with SMTP id a30mr23153562pga.368.1587515860326; Tue, 21 Apr 2020 17:37:40 -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.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 17:37:39 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 03/12] utils: fix float equal warning Date: Tue, 21 Apr 2020 17:37:26 -0700 Message-Id: <20200422003735.3891-3-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 -Wfloat-equal Signed-off-by: Rosen Penev --- utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index 663d0254..066a336a 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -154,7 +154,7 @@ void fps_timestamps::determine_field(int fd, unsigned type) bool fps_timestamps::add_ts(double ts_secs, unsigned sequence, unsigned field) { - if (ts_secs == 0) { + if (ts_secs <= 0) { struct timespec ts_cur; clock_gettime(CLOCK_MONOTONIC, &ts_cur); 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: 11502589 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8D4391392 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 765DC20747 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:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11502591 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC7D092C for ; Wed, 22 Apr 2020 00:37:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96F4F2071C for ; Wed, 22 Apr 2020 00:37:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ooxVtmj1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726385AbgDVAho (ORCPT ); Tue, 21 Apr 2020 20:37:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726379AbgDVAhn (ORCPT ); Tue, 21 Apr 2020 20:37:43 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74802C0610D5 for ; Tue, 21 Apr 2020 17:37:43 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id 145so158589pfw.13 for ; Tue, 21 Apr 2020 17:37:43 -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=WgMX4GY/VIemHiy8TcvV0K+VhOwT+3Lkg2y3ZP4ifUA=; b=ooxVtmj1KvZwcNn79SnVfPs7MP8gC4UHKJ6TwtTgkf0LybBb4VCiDW56XKQePx6j/x LqiVy8kXSjMNfSlH4wofw1+enFf2yaHF7b0luoKWwwm3PpiP4NGpqG7C1EaCmtU3Uh4n eU+35KcJz+DuUfOneV4u2ZmK+UcWAsLWSZjyho/ooNpXXuS0b1XA0INi1fLU1cLCim7M zu/gUbMEzYC2D19KKqQGK68zcvyH8787aXV+QTDQlpxzOZ4x4GEn2+2qa4gTLYvj85A1 PFkfnXTO4tgTd40zV29wLjhQc5xWSldbo3s5EJXOlMe9aQWDcbNljJ5wxwB8n1gvgFvg 607w== 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=WgMX4GY/VIemHiy8TcvV0K+VhOwT+3Lkg2y3ZP4ifUA=; b=Fmw56TZm99iYe0rBAzo2GWH5fREU0l1ljsAbAlCARibZlGtjhRgmn6TA3ML8HLzeoP GJ2s7x8pf5o3dp1802mD+eP9mPb5/6OMmKddvAlZkf27c8n3J7pLj39Ah0ja+OMqnd04 OF3qWDWudueCvE47sp8EmKvkr90xGkQfksH2XmzCtEgv2l/MegcGZUmttpeVLM5VVgwB y+Uv8hoAdvjSzLJ9vb5DcGcEWJ65G964mT6ypcbyU3G8v/gmuRr9Gl9JHMFns1e1t9HK k7yMsDhUzKgbiXTfat+PTr6CLermU9e8yfhGXNfSEJzBeQVYs3uGJVwb+n4I6ybVHgD5 3nYw== X-Gm-Message-State: AGi0Pub9i/qAP9XhAZI8Bagi9oW2JHAPjLHb5nU6d4cTinzj5lwPQbWV WpBV76sghxP4rvmCOzi9DU77UAyN X-Google-Smtp-Source: APiQypJKDVc8mBjvNaa5O/YY+ahnBBnGAxS/Av1kdkpZCg7ydviZoA5WKmGVD22S3+aE6QQ+iASN1w== X-Received: by 2002:a62:7cca:: with SMTP id x193mr4300796pfc.96.1587515862384; Tue, 21 Apr 2020 17:37:42 -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.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 17:37:41 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 05/12] utils: add copy assignment operator Date: Tue, 21 Apr 2020 17:37:28 -0700 Message-Id: <20200422003735.3891-5-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 -Wdeprecated Signed-off-by: Rosen Penev --- utils/common/cv4l-helpers.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/common/cv4l-helpers.h b/utils/common/cv4l-helpers.h index a8089930..9505e334 100644 --- a/utils/common/cv4l-helpers.h +++ b/utils/common/cv4l-helpers.h @@ -830,6 +830,10 @@ public: { init(b); } + cv4l_buffer operator= (const cv4l_buffer &b) + { + return *this; + } virtual ~cv4l_buffer() {} void init(unsigned type = 0, unsigned memory = 0, unsigned index = 0) 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: 11502593 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7DE2992C 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 65B862071E 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: 11502603 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 68CD192C 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 4FFE72071E 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: 11502597 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9DC0714DD 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 7A4872074B 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:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11502595 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75DB61392 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 57EFE2074B 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="aEI6j8uW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726415AbgDVAhs (ORCPT ); Tue, 21 Apr 2020 20:37:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726407AbgDVAhr (ORCPT ); Tue, 21 Apr 2020 20:37:47 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54502C0610D6 for ; Tue, 21 Apr 2020 17:37:47 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id a5so116052pjh.2 for ; Tue, 21 Apr 2020 17:37:47 -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=DDCReULhAZqwiOO+lYG2DBtAycE2eLUNBrl8041Cchc=; b=aEI6j8uWpieHod9mmtFnCSL3lD6L76uhGKQnrq7s2C08zj4qwqR6FzupJUijqMuhRc /FFlVOQXlCMuNn6oIvaaXtsXXEWYZw1YDm/G8OYeCD96XmM4oJPP5Mv2x5VMiBFBwsbT xMHrk/gTw23PcmgZJWzn55fQ3OZ1OhsAI07kUZv8z0UwY7PG/VhXN6PdVyiAvV78wH6T bdCuuVISSbBMiTBpRLPudsBWBlZUmkSQSV3BPhpX6N6MS/Pm/7ScdlSzbYzrUlA5627H qweVbOXoTgLsF/AMxn5VXKgs4480lWogRol31ORxACPRcX/+4wPta6n6Jj0RKIAY+tbb Hofw== 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=DDCReULhAZqwiOO+lYG2DBtAycE2eLUNBrl8041Cchc=; b=ewrSXiEl4+98eIkeABy8I5X5Ms2vPLyAROBKBDp3f1DzASDqjtx7RovbUsJTQyoX5u NV0RoN9giI5VTRC+PYABGiGcmR3p1veFJJJfBKw60BH9uMUS2sKSeCjNaW74itUAaAMW wDJkWUj2eM7VXYLj4ZSD/w2qQS2TZFhYyUFFXQ655YXajOtg68zLEviN94Gfw28TeeFO CSAhrlh/2tUV8KLaJzPfiCApgBYdgsfts3QmmFzbQZQ1E5Vs5PWvrRKqPS7CB7xPOA3C xujaEXA/6/xqON4KuMdiZFkOS/vdPlwwLtQz+7nFu84qhjwB8ZXVonSmSXFoyG+wHbeq Ea/Q== X-Gm-Message-State: AGi0PuZabeGbyHxzwL0REPrDQp2Yi92ng+A3eehAcOdfgUwsZA9w9HN4 SDTydZlYmThU6CO83NUHsEti84Bj X-Google-Smtp-Source: APiQypIAPhn8S8NtyCWpY/f34rHpUri8bRbR/UEZM5L3NKXN4wYDBYQhoNYTecC9F6whRcxJWfP01Q== X-Received: by 2002:a17:90a:a484:: with SMTP id z4mr8511578pjp.40.1587515866511; Tue, 21 Apr 2020 17:37:46 -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.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 17:37:46 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 09/12] utils: fix implicit float conversions Date: Tue, 21 Apr 2020 17:37:32 -0700 Message-Id: <20200422003735.3891-9-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 -Wfloat-conversion Signed-off-by: Rosen Penev --- utils/cec-ctl/cec-ctl.cpp | 4 ++-- utils/cec-ctl/cec-pin.cpp | 2 +- utils/v4l2-compliance/v4l2-test-buffers.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-misc.cpp | 4 ++-- utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-subdev.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index f4133494..f0e31aca 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -1507,8 +1507,8 @@ static void stress_test_power_cycle(struct node &node, unsigned cnt, srandom(seed); for (;;) { - unsigned usecs1 = mod_usleep ? random() % mod_usleep : sleep_before_on * 1000000; - unsigned usecs2 = mod_usleep ? random() % mod_usleep : sleep_before_off * 1000000; + unsigned usecs1 = mod_usleep ? random() % mod_usleep : (unsigned)(sleep_before_on * 1000000); + unsigned usecs2 = mod_usleep ? random() % mod_usleep : (unsigned)(sleep_before_off * 1000000); usecs1 += min_usleep; usecs2 += min_usleep; diff --git a/utils/cec-ctl/cec-pin.cpp b/utils/cec-ctl/cec-pin.cpp index 0322ad5e..10abea37 100644 --- a/utils/cec-ctl/cec-pin.cpp +++ b/utils/cec-ctl/cec-pin.cpp @@ -261,7 +261,7 @@ static void cec_pin_rx_data_bit_was_low(__u64 ev_ts, __u64 usecs, __u64 usecs_mi * If the low drive starts at the end of a 0 bit, then the actual * maximum time that the bus can be low is the two summed. */ - const unsigned max_low_drive = CEC_TIM_LOW_DRIVE_ERROR_MAX + + const unsigned max_low_drive = (unsigned)CEC_TIM_LOW_DRIVE_ERROR_MAX + CEC_TIM_DATA_BIT_0_LOW_MAX + CEC_TIM_MARGIN; low_usecs = usecs; diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp index 93df7034..87c2e523 100644 --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp @@ -2597,7 +2597,7 @@ static void streamFmt(struct node *node, __u32 pixelformat, __u32 w, __u32 h, char hz[32] = ""; if (!frame_count) - frame_count = f ? 1.0 / fract2f(f) : 10; + frame_count = f ? (unsigned)(1.0f / fract2f(f)) : 10; node->g_fmt(fmt); fmt.s_pixelformat(pixelformat); fmt.s_width(w); diff --git a/utils/v4l2-ctl/v4l2-ctl-misc.cpp b/utils/v4l2-ctl/v4l2-ctl-misc.cpp index cb933217..2851886a 100644 --- a/utils/v4l2-ctl/v4l2-ctl-misc.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-misc.cpp @@ -320,7 +320,7 @@ void misc_set(cv4l_fd &_fd) parm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; parm.parm.capture.timeperframe.numerator = 1000; parm.parm.capture.timeperframe.denominator = - fps * parm.parm.capture.timeperframe.numerator; + (uint32_t)(fps * parm.parm.capture.timeperframe.numerator); if (doioctl(fd, VIDIOC_S_PARM, &parm) == 0) { struct v4l2_fract *tf = &parm.parm.capture.timeperframe; @@ -338,7 +338,7 @@ void misc_set(cv4l_fd &_fd) parm.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; parm.parm.output.timeperframe.numerator = 1000; parm.parm.output.timeperframe.denominator = - output_fps * parm.parm.output.timeperframe.numerator; + (uint32_t)(output_fps * parm.parm.output.timeperframe.numerator); if (doioctl(fd, VIDIOC_S_PARM, &parm) == 0) { struct v4l2_fract *tf = &parm.parm.output.timeperframe; diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index 066a336a..6981a3cc 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -569,7 +569,7 @@ static void print_concise_buffer(FILE *f, cv4l_buffer &buf, cv4l_fmt &fmt, if (!skip_ts && (buf.g_flags() & V4L2_BUF_FLAG_TIMESTAMP_MASK) != V4L2_BUF_FLAG_TIMESTAMP_COPY) { double ts = buf.g_timestamp().tv_sec + buf.g_timestamp().tv_usec / 1000000.0; fprintf(f, " ts: %.06f", ts); - if (last_ts) + if (last_ts <= 0.0) fprintf(f, " delta: %.03f ms", (ts - last_ts) * 1000.0); last_ts = ts; diff --git a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp index 747f1699..f1223084 100644 --- a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp @@ -487,7 +487,7 @@ void subdev_set(cv4l_fd &_fd) exit(1); } fival.interval.numerator = 1000; - fival.interval.denominator = set_fps * fival.interval.numerator; + fival.interval.denominator = (uint32_t)(set_fps * fival.interval.numerator); printf("Note: --set-subdev-fps is only for testing.\n" "Normally media-ctl is used to configure the video pipeline.\n"); printf("ioctl: VIDIOC_SUBDEV_S_FRAME_INTERVAL (pad=%u)\n", fival.pad); From patchwork Wed Apr 22 00:37:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11502601 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF4DA14DD for ; Wed, 22 Apr 2020 00:37:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDB4B2076B for ; Wed, 22 Apr 2020 00:37:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NIR9QdXB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726424AbgDVAhv (ORCPT ); Tue, 21 Apr 2020 20:37:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726419AbgDVAhs (ORCPT ); Tue, 21 Apr 2020 20:37:48 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90046C0610D5 for ; Tue, 21 Apr 2020 17:37:48 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id k18so210171pll.6 for ; Tue, 21 Apr 2020 17:37:48 -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=5V14XMI4vTw32sO7sTaml7BEAlZlzY0dJx57nwDLMyM=; b=NIR9QdXBgxUv8Rz+7BoQqj4azqeFjDZHc0m/DXTaQc8z9p5Nai847+fomC3wZxoaT1 +1SuNrBuNVtmq/Sg73sXON/VVE5X+rUvzA9D6bbk7nqGEZhH+tNBIqdPH3eTgLfCPVnm 5z3wgftkdmPbQYcZz7/f5zIwWIdQKUVasTwgDMlx6roWa4uD3+cHbPRVJzrK/oE00h90 H+cvQOH8F9/WofK/Jx6xB21fI36sXBbpTvpOGOpt6i+ZH2amnDmidqLrn8PmwlN+LbWa JzYJFOSfOC8M5ZnTVh8zWe2zzjXS54Wqz5bqlaXn3IjeiHt+RFdyejEKb95JcuSM5+Fg tzWg== 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=5V14XMI4vTw32sO7sTaml7BEAlZlzY0dJx57nwDLMyM=; b=GP1ZMJvnywoqdUOIkdHoxiz8hHIJaehVGne1tXKjArb58EDQ47KTHKu3RrxAHiZNGo EjaKM/tZc9DfS+iWh8XxTuQbQnj1jOaHoqxQLBTd77N6GtKfPPTRP2JYMEKke6bo1BpK DNwyxUGjmJCOJmqsUsNPHAV2+dRpktkAIUcuyV9JHk1HVEG2yH482z6CXH50c5fhby2B pZht+T6/rxxneCAKb0RC56s01r05bqgjbJF2bX8aUaMc0rBQjpv1JESaFpQzq+fdos1c uTxDK6Ugdai3+1wfK4HrdZS4N+vX6RmZWfjC1jK8acuhd23onPhoQPr0M2KIwHdiB6aY iezw== X-Gm-Message-State: AGi0PuYagWdowqrUBsA2oisbuhbwHYXhjp3IrgGEVM0mKWziOUZZYUBq uapneVcKtbVRBv9TEgKLMV8Ny5Cz X-Google-Smtp-Source: APiQypIog+5egQnQGeqDBy3NCKsz9BYvszAjBue4qdu5luWjkm2XMZzYN9xz7kdxXCXWyYSrnFLPNQ== X-Received: by 2002:a17:90a:e608:: with SMTP id j8mr8835394pjy.44.1587515867495; Tue, 21 Apr 2020 17:37:47 -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.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 17:37:46 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 10/12] utils: fix fallthrough warnings Date: Tue, 21 Apr 2020 17:37:33 -0700 Message-Id: <20200422003735.3891-10-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 Comments are not enough for clang. Changed to use the C++ attribute. Found with -Wimplicit-fallthrough Signed-off-by: Rosen Penev --- utils/cec-compliance/cec-compliance.cpp | 7 +++++++ utils/cec-ctl/cec-ctl.cpp | 8 +++++++- utils/cec-follower/cec-follower.cpp | 7 +++++++ utils/cec-follower/cec-processing.cpp | 9 ++++++++- utils/cec-follower/cec-tuner.cpp | 12 +++++++++--- utils/libcecutil/cec-log.cpp | 8 +++++++- utils/v4l2-compliance/v4l2-test-colors.cpp | 16 +++++++++++----- utils/v4l2-compliance/v4l2-test-controls.cpp | 16 +++++++++++----- utils/v4l2-compliance/v4l2-test-formats.cpp | 10 ++++++++-- utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 10 ++++++++-- utils/v4l2-ctl/v4l2-ctl-vbi.cpp | 10 ++++++++-- 11 files changed, 91 insertions(+), 22 deletions(-) diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp index 1c62b5c9..e9fce337 100644 --- a/utils/cec-compliance/cec-compliance.cpp +++ b/utils/cec-compliance/cec-compliance.cpp @@ -24,6 +24,12 @@ #include "version.h" #endif +#ifdef __clang__ +#define FALLTHROUGH [[clang::fallthrough]] +#else +#define FALLTHROUGH [[gnu::fallthrough]] +#endif + /* Short option list Please keep in alphabetical order. @@ -486,6 +492,7 @@ void sad_decode(struct short_audio_desc *sad, __u32 descriptor) case SAD_EXT_TYPE_MPEG_H_3D_AUDIO: case SAD_EXT_TYPE_AC_4: sad->format_dependent = b3 & 0x07; + FALLTHROUGH; case SAD_EXT_TYPE_LPCM_3D_AUDIO: sad->bit_depth_mask = b3 & 0x07; break; diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index f0e31aca..a3698a67 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -37,6 +37,12 @@ #include "cec-ctl.h" +#ifdef __clang__ +#define FALLTHROUGH [[clang::fallthrough]] +#else +#define FALLTHROUGH [[gnu::fallthrough]] +#endif + static struct timespec start_monotonic; static struct timeval start_timeofday; static bool ignore_la[16]; @@ -1967,7 +1973,7 @@ int main(int argc, char **argv) break; case OptPhysAddrFromEDIDPoll: edid_path = optarg; - /* fall-through */ + FALLTHROUGH; case OptPhysAddrFromEDID: phys_addr = parse_phys_addr_from_edid(optarg); break; diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp index 1eeae2d4..2d61d5f9 100644 --- a/utils/cec-follower/cec-follower.cpp +++ b/utils/cec-follower/cec-follower.cpp @@ -23,6 +23,12 @@ #include "version.h" #endif +#ifdef __clang__ +#define FALLTHROUGH [[clang::fallthrough]] +#else +#define FALLTHROUGH [[gnu::fallthrough]] +#endif + /* Short option list Please keep in alphabetical order. @@ -142,6 +148,7 @@ void sad_encode(const struct short_audio_desc *sad, __u32 *descriptor) case SAD_EXT_TYPE_MPEG_H_3D_AUDIO: case SAD_EXT_TYPE_AC_4: b3 |= sad->format_dependent & 0x07; + FALLTHROUGH; case SAD_EXT_TYPE_LPCM_3D_AUDIO: b3 |= sad->bit_depth_mask & 0x07; break; diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp index 8e3a33a2..68bfdca3 100644 --- a/utils/cec-follower/cec-processing.cpp +++ b/utils/cec-follower/cec-processing.cpp @@ -19,6 +19,12 @@ #include "cec-follower.h" +#ifdef __clang__ +#define FALLTHROUGH [[clang::fallthrough]] +#else +#define FALLTHROUGH [[gnu::fallthrough]] +#endif + #define VOLUME_MAX 0x64 #define VOLUME_MIN 0 @@ -352,7 +358,7 @@ static void processMsg(struct node *node, struct cec_msg &msg, unsigned me) if (cec_has_tv(1 << la) && la_info[la].phys_addr == 0) warn("TV (0) at 0.0.0.0 sent Routing Information."); } - + FALLTHROUGH; /* System Information */ @@ -708,6 +714,7 @@ static void processMsg(struct node *node, struct cec_msg &msg, unsigned me) cec_msg_system_audio_mode_status(&msg, node->state.sac_active ? CEC_OP_SYS_AUD_STATUS_ON : CEC_OP_SYS_AUD_STATUS_OFF); transmit(node, &msg); + FALLTHROUGH; case CEC_MSG_GIVE_AUDIO_STATUS: if (!cec_has_audiosystem(1 << me)) break; diff --git a/utils/cec-follower/cec-tuner.cpp b/utils/cec-follower/cec-tuner.cpp index aa19f55d..af7c6437 100644 --- a/utils/cec-follower/cec-tuner.cpp +++ b/utils/cec-follower/cec-tuner.cpp @@ -8,6 +8,12 @@ #include "cec-follower.h" +#ifdef __clang__ +#define FALLTHROUGH [[clang::fallthrough]] +#else +#define FALLTHROUGH [[gnu::fallthrough]] +#endif + #define NUM_ANALOG_FREQS 3 #define NUM_DIGITAL_CHANS 3 #define TOT_ANALOG_FREQS (sizeof(analog_freqs_khz) / sizeof(analog_freqs_khz[0][0][0])) @@ -303,21 +309,21 @@ static int digital_get_service_idx(struct cec_op_digital_service_id *digital) switch (digital->dig_bcast_system) { case CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_T: is_terrestrial = true; - /* fall through */ + FALLTHROUGH; case CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_BS: info = &digital_arib_data[is_terrestrial][0]; offset = is_terrestrial * NUM_DIGITAL_CHANS; break; case CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_T: is_terrestrial = true; - /* fall through */ + FALLTHROUGH; case CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_SAT: info = &digital_atsc_data[is_terrestrial][0]; offset = (2 + is_terrestrial) * NUM_DIGITAL_CHANS; break; case CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_T: is_terrestrial = true; - /* fall through */ + FALLTHROUGH; case CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_S2: info = &digital_dvb_data[is_terrestrial][0]; offset = (4 + is_terrestrial) * NUM_DIGITAL_CHANS; diff --git a/utils/libcecutil/cec-log.cpp b/utils/libcecutil/cec-log.cpp index 28a1ecac..9844ac43 100644 --- a/utils/libcecutil/cec-log.cpp +++ b/utils/libcecutil/cec-log.cpp @@ -15,6 +15,12 @@ #include "cec-info.h" #include "cec-log.h" +#ifdef __clang__ +#define FALLTHROUGH [[clang::fallthrough]] +#else +#define FALLTHROUGH [[gnu::fallthrough]] +#endif + static const struct cec_arg arg_u8 = { CEC_ARG_TYPE_U8, }; @@ -44,7 +50,7 @@ static void log_arg(const struct cec_arg *arg, const char *arg_name, __u32 val) return; } } - /* fall through */ + FALLTHROUGH; case CEC_ARG_TYPE_U8: if (!strcmp(arg_name, "video-latency") || !strcmp(arg_name, "audio-out-delay")) { diff --git a/utils/v4l2-compliance/v4l2-test-colors.cpp b/utils/v4l2-compliance/v4l2-test-colors.cpp index 887b198b..d37300e9 100644 --- a/utils/v4l2-compliance/v4l2-test-colors.cpp +++ b/utils/v4l2-compliance/v4l2-test-colors.cpp @@ -30,6 +30,12 @@ #include #include "v4l2-compliance.h" +#ifdef __clang__ +#define FALLTHROUGH [[clang::fallthrough]] +#else +#define FALLTHROUGH [[gnu::fallthrough]] +#endif + static void setupPlanes(const cv4l_fmt &fmt, __u8 *planes[3]) { if (fmt.g_num_planes() > 1) @@ -328,7 +334,7 @@ static void getColor(const cv4l_fmt &fmt, __u8 * const planes[3], case V4L2_PIX_FMT_RGBA444: case V4L2_PIX_FMT_BGRA444: c.a = (v16 >> 12) / 15.0; - /* fall through */ + FALLTHROUGH; case V4L2_PIX_FMT_RGB444: case V4L2_PIX_FMT_XRGB444: case V4L2_PIX_FMT_XBGR444: @@ -345,7 +351,7 @@ static void getColor(const cv4l_fmt &fmt, __u8 * const planes[3], case V4L2_PIX_FMT_ABGR555: case V4L2_PIX_FMT_BGRA555: c.a = v16 >> 15; - /* fall through */ + FALLTHROUGH; case V4L2_PIX_FMT_YUV555: case V4L2_PIX_FMT_RGB555: case V4L2_PIX_FMT_XRGB555: @@ -376,7 +382,7 @@ static void getColor(const cv4l_fmt &fmt, __u8 * const planes[3], case V4L2_PIX_FMT_RGBA32: case V4L2_PIX_FMT_BGRA32: c.a = ((v32 >> 24) & 0xff) / 255.0; - /* fall through */ + FALLTHROUGH; default: c.r = ((v32 >> 16) & 0xff) / 255.0; c.g = ((v32 >> 8) & 0xff) / 255.0; @@ -444,7 +450,7 @@ static void getColor(const cv4l_fmt &fmt, __u8 * const planes[3], Y = (Y - 16.0 / 255.0) * 255.0 / 219.0; cb *= 255.0 / 224.0; cr *= 255.0 / 224.0; - /* fall through */ + FALLTHROUGH; case V4L2_YCBCR_ENC_601: default: ycbcr2rgb(bt601, Y, cb, cr, c); @@ -453,7 +459,7 @@ static void getColor(const cv4l_fmt &fmt, __u8 * const planes[3], Y = (Y - 16.0 / 255.0) * 255.0 / 219.0; cb *= 255.0 / 224.0; cr *= 255.0 / 224.0; - /* fall through */ + FALLTHROUGH; case V4L2_YCBCR_ENC_709: ycbcr2rgb(rec709, Y, cb, cr, c); break; diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp index 251a6049..2de888cf 100644 --- a/utils/v4l2-compliance/v4l2-test-controls.cpp +++ b/utils/v4l2-compliance/v4l2-test-controls.cpp @@ -34,6 +34,12 @@ #define V4L2_CTRL_CLASS_VIVID 0x00f00000 +#ifdef __clang__ +#define FALLTHROUGH [[clang::fallthrough]] +#else +#define FALLTHROUGH [[gnu::fallthrough]] +#endif + static int checkQCtrl(struct node *node, struct test_query_ext_ctrl &qctrl) { struct v4l2_querymenu qmenu; @@ -61,20 +67,20 @@ static int checkQCtrl(struct node *node, struct test_query_ext_ctrl &qctrl) case V4L2_CTRL_TYPE_BOOLEAN: if (qctrl.maximum > 1) return fail("invalid boolean max value\n"); - /* fall through */ + FALLTHROUGH; case V4L2_CTRL_TYPE_MENU: case V4L2_CTRL_TYPE_INTEGER_MENU: if (qctrl.step != 1) return fail("invalid step value %lld\n", qctrl.step); if (qctrl.minimum < 0) return fail("min < 0\n"); - /* fall through */ + FALLTHROUGH; case V4L2_CTRL_TYPE_INTEGER: case V4L2_CTRL_TYPE_INTEGER64: if (qctrl.default_value < qctrl.minimum || qctrl.default_value > qctrl.maximum) return fail("def < min || def > max\n"); - /* fall through */ + FALLTHROUGH; case V4L2_CTRL_TYPE_STRING: if (qctrl.minimum > qctrl.maximum) return fail("min > max\n"); @@ -116,7 +122,7 @@ static int checkQCtrl(struct node *node, struct test_query_ext_ctrl &qctrl) case V4L2_CTRL_TYPE_BUTTON: if ((fl & rw_mask) != V4L2_CTRL_FLAG_WRITE_ONLY) return fail("button control not write only\n"); - /* fall through */ + FALLTHROUGH; case V4L2_CTRL_TYPE_BOOLEAN: case V4L2_CTRL_TYPE_MENU: case V4L2_CTRL_TYPE_INTEGER_MENU: @@ -124,7 +130,7 @@ static int checkQCtrl(struct node *node, struct test_query_ext_ctrl &qctrl) case V4L2_CTRL_TYPE_BITMASK: if (fl & V4L2_CTRL_FLAG_SLIDER) return fail("slider makes only sense for integer controls\n"); - /* fall through */ + FALLTHROUGH; case V4L2_CTRL_TYPE_INTEGER64: case V4L2_CTRL_TYPE_INTEGER: if ((fl & rw_mask) == rw_mask) diff --git a/utils/v4l2-compliance/v4l2-test-formats.cpp b/utils/v4l2-compliance/v4l2-test-formats.cpp index 3fc87316..9e98cf99 100644 --- a/utils/v4l2-compliance/v4l2-test-formats.cpp +++ b/utils/v4l2-compliance/v4l2-test-formats.cpp @@ -32,6 +32,12 @@ #include #include "v4l2-compliance.h" +#ifdef __clang__ +#define FALLTHROUGH [[clang::fallthrough]] +#else +#define FALLTHROUGH [[gnu::fallthrough]] +#endif + static const __u32 buftype2cap[] = { 0, V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_M2M, @@ -97,7 +103,7 @@ static int testEnumFrameIntervals(struct node *node, __u32 pixfmt, case V4L2_FRMIVAL_TYPE_CONTINUOUS: if (sw->step.numerator != 1 || sw->step.denominator != 1) return fail("invalid step for continuous frameinterval\n"); - /* fallthrough */ + FALLTHROUGH; case V4L2_FRMIVAL_TYPE_STEPWISE: if (frmival.index) return fail("index must be 0 for stepwise/continuous frameintervals\n"); @@ -183,7 +189,7 @@ static int testEnumFrameSizes(struct node *node, __u32 pixfmt) case V4L2_FRMSIZE_TYPE_CONTINUOUS: if (frmsize.stepwise.step_width != 1 || frmsize.stepwise.step_height != 1) return fail("invalid step_width/height for continuous framesize\n"); - /* fallthrough */ + FALLTHROUGH; case V4L2_FRMSIZE_TYPE_STEPWISE: if (frmsize.index) return fail("index must be 0 for stepwise/continuous framesizes\n"); diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index 6981a3cc..bb464e99 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -24,6 +24,12 @@ #include #include +#ifdef __clang__ +#define FALLTHROUGH [[clang::fallthrough]] +#else +#define FALLTHROUGH [[gnu::fallthrough]] +#endif + extern "C" { #include "v4l2-tpg.h" } @@ -763,7 +769,7 @@ void streaming_cmd(int ch, char *optarg) break; case OptStreamUser: memory = V4L2_MEMORY_USERPTR; - /* fall through */ + FALLTHROUGH; case OptStreamMmap: if (optarg) { reqbufs_count_cap = strtoul(optarg, 0L, 0); @@ -776,7 +782,7 @@ void streaming_cmd(int ch, char *optarg) break; case OptStreamOutUser: out_memory = V4L2_MEMORY_USERPTR; - /* fall through */ + FALLTHROUGH; case OptStreamOutMmap: if (optarg) { reqbufs_count_out = strtoul(optarg, 0L, 0); diff --git a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp index c5960f78..82d01b58 100644 --- a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp @@ -16,6 +16,12 @@ #include "v4l2-ctl.h" +#ifdef __clang__ +#define FALLTHROUGH [[clang::fallthrough]] +#else +#define FALLTHROUGH [[gnu::fallthrough]] +#endif + static struct v4l2_format sliced_fmt; /* set_format/get_format for sliced VBI */ static struct v4l2_format sliced_fmt_out; /* set_format/get_format for sliced VBI output */ static struct v4l2_format raw_fmt; /* set_format/get_format for VBI */ @@ -87,7 +93,7 @@ void vbi_cmd(int ch, char *optarg) case OptSetSlicedVbiOutFormat: case OptTrySlicedVbiOutFormat: sliced = &sliced_fmt_out; - /* fall through */ + FALLTHROUGH; case OptSetSlicedVbiFormat: case OptTrySlicedVbiFormat: sliced->fmt.sliced.service_set = 0; @@ -130,7 +136,7 @@ void vbi_cmd(int ch, char *optarg) case OptSetVbiOutFormat: case OptTryVbiOutFormat: raw = &raw_fmt_out; - /* fall through */ + FALLTHROUGH; case OptSetVbiFormat: case OptTryVbiFormat: subs = optarg; From patchwork Wed Apr 22 00:37:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11502599 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5F72192C for ; Wed, 22 Apr 2020 00:37:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 469862071E for ; Wed, 22 Apr 2020 00:37:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Yajt77S1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726423AbgDVAhu (ORCPT ); Tue, 21 Apr 2020 20:37:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726420AbgDVAht (ORCPT ); Tue, 21 Apr 2020 20:37:49 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 129A0C0610D6 for ; Tue, 21 Apr 2020 17:37:49 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id a32so109268pje.5 for ; Tue, 21 Apr 2020 17:37:49 -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=miQ/fH2B66il6X0HrxWYtKaAyXX+ke6TTpDcvQf6v8Y=; b=Yajt77S1r8jsG4S1fYf79jhqNDpDlqchtOVR2r85rOUlj47bkAUHrglpY5L2+toSH9 PHcHjOpCB1+0EQuiqsSkZRLoJz0IW3AqKTCItjyn5QqOHNehh/49IJvtqxrhCY1vOqt6 BQgunLOfTRGRnQhoMCgu6bJSJPYxPfFO1jU0lvUssPPrlUku+v6u6v/OPhlEtw+iMrda nsS74QrBFjBZ3Y6VGEvVOCJHyYldOwfRjk0sSvDg8ZgvbRUo9Ct+uH0zX/k3ZPWw2ui6 zSz1u67vmynSzQaKUMIGetoACXD6zJxCUC6lnwBEuJVgK1u2dCLNDnzzMhX/rQDpRFp5 tm3w== 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=miQ/fH2B66il6X0HrxWYtKaAyXX+ke6TTpDcvQf6v8Y=; b=oFjiIj+z9zG9Dhg5IhiwU3BIzbMwOeZehcRlNZqrVJ1ZTIMxm7igLRXNfKEUqyaQAl TC0rTGiNmvcmLEnWU0fD4qCfmqjPFhBDZz9N6WIVmthUfCHqbNSm28JMjdI4//6STASZ f5bI8Q0zt6kPuk233T33UKkzupwqCXDv2/FmkSXAzTjfm3R7DeBiTr/ZE8QjUNQ4NdLH VWAwLfRy78Lec+DVEHZHIy8S3CVn7r9VYzxKfthEk4qwOYxhRoNtPcHIv5YCOhWpZh1V F371gOiFAU8p08IrVUtHKOc2Wd8Q7vq39oTyMMc4SHf+7ugijpPKiE33ucwSXIK0jtdD v38w== X-Gm-Message-State: AGi0PuZMdGq7rxdHT3hUdltHegS6opmGNLdI5aiUObtwZ9VDfniJ3tic p8972ZLfTWKeE5ecsXIzPzmWDrHa X-Google-Smtp-Source: APiQypLs+HTSKXyl5zlA9Fx1vWbUHdU4md6P4GpsP6Yan5X12/sxYYV5fA5VOhVEmlJyaSYfO12HFA== X-Received: by 2002:a17:90a:a2d:: with SMTP id o42mr8616040pjo.164.1587515868305; Tue, 21 Apr 2020 17:37:48 -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.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 17:37:47 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 11/12] utils: fix double promotions Date: Tue, 21 Apr 2020 17:37:34 -0700 Message-Id: <20200422003735.3891-11-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 -Wdouble-promotion Signed-off-by: Rosen Penev --- utils/rds-ctl/rds-ctl.cpp | 4 ++-- utils/v4l2-compliance/v4l2-test-buffers.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp index cc1d3bf7..cd6ece38 100644 --- a/utils/rds-ctl/rds-ctl.cpp +++ b/utils/rds-ctl/rds-ctl.cpp @@ -528,7 +528,7 @@ static void print_rds_statistics(const struct v4l2_rds_statistics *statistics) (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); + (double)block_error_percentage, statistics->group_error_cnt); float block_corrected_percentage = 0; @@ -536,7 +536,7 @@ static void print_rds_statistics(const struct v4l2_rds_statistics *statistics) block_corrected_percentage = ( 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); + statistics->block_corrected_cnt, (double)block_corrected_percentage); for (int i = 0; i < 16; i++) printf("Group %02d: %u\n", i, statistics->group_type_cnt[i]); } diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp index 87c2e523..abf39cc7 100644 --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp @@ -2597,7 +2597,7 @@ static void streamFmt(struct node *node, __u32 pixelformat, __u32 w, __u32 h, char hz[32] = ""; if (!frame_count) - frame_count = f ? (unsigned)(1.0f / fract2f(f)) : 10; + frame_count = f ? (unsigned)(1.0 / fract2f(f)) : 10; node->g_fmt(fmt); fmt.s_pixelformat(pixelformat); fmt.s_width(w); 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: 11502605 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E5651392 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 EA60A2071C 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: