From patchwork Thu Jan 3 18:01:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 10747703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 19DC8746 for ; Thu, 3 Jan 2019 18:41:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EE1E28CF5 for ; Thu, 3 Jan 2019 18:41:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0378028D04; Thu, 3 Jan 2019 18:41:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F5C528CF5 for ; Thu, 3 Jan 2019 18:41:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726080AbfACSlD (ORCPT ); Thu, 3 Jan 2019 13:41:03 -0500 Received: from mail.ao2.it ([92.243.12.208]:58434 "EHLO ao2.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbfACSlC (ORCPT ); Thu, 3 Jan 2019 13:41:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ao2.it; s=20180927; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=FA1bQexyPoAn/vJg/TbwdBpgeZJJFuRc5mq1L8pu8EA=; b=q8xAfoYdwfHPXyVlYwihVxv5EDNj7v4T6skxhJyAMR967lemIXLbKMypFaYTFlF4rZlm0gGhrdERiiGp8rVQtanZnafZ/rk/+xsbPH9WxaFY/v+2vDOM1+7D3gB69Y4k9w2dah0OzAdpSCw/hFLRD1Igjkne1KWHovK+SWFRbGBszReSiTVjlUBBwvUDFJ3y6bWcgX4AQl6sqXEipNWEWhFA6fFJMaeb5tKaAON9hjmb8FEx7nZbMP1MTAolwOi9TnwKUrdsfx9+KNwniFZeM5pz1lchhwUH+95dEiBabDOHqsgtzm9YD5fmyoRBNCh69PT4438XoxcHwMcF2bnJpw==; Received: from localhost ([::1] helo=jcn) by ao2.it with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1gf7Hq-0002wN-5q; Thu, 03 Jan 2019 19:00:06 +0100 Received: from ao2 by jcn with local (Exim 4.92-RC3) (envelope-from ) id 1gf7Io-0003D2-Re; Thu, 03 Jan 2019 19:01:06 +0100 From: Antonio Ospite To: linux-media@vger.kernel.org Cc: Antonio Ospite Subject: [RFC PATCH 3/5] v4l2-ctl: use a dedicated function to print the control class name Date: Thu, 3 Jan 2019 19:01:00 +0100 Message-Id: <20190103180102.12282-4-ao2@ao2.it> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190103180102.12282-1-ao2@ao2.it> References: <20181124185256.74dc969bdb8f7ab79cf03d5d@ao2.it> <20190103180102.12282-1-ao2@ao2.it> MIME-Version: 1.0 X-Face: z*RaLf`X<@C75u6Ig9}{oW$H;1_\2t5)({*|jhM/Vb;]yA5\I~93>J<_`<4)A{':UrE Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All the details about the controls are printed in the dedicated function print_qctrl(), use a new dedicated function named print_class_name() to print the control class name as well, this is for symmetry but it is also in preparation for a change which aims to abstract how the controls are printed. Signed-off-by: Antonio Ospite --- utils/v4l2-ctl/v4l2-ctl-common.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index e2710335..5d41d720 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -403,6 +403,11 @@ static void print_qctrl(int fd, struct v4l2_query_ext_ctrl *queryctrl, } } +static void print_class_name(const char *name) +{ + printf("\n%s\n\n", name); +} + static int print_control(int fd, struct v4l2_query_ext_ctrl &qctrl, int show_menus) { struct v4l2_control ctrl; @@ -415,7 +420,7 @@ static int print_control(int fd, struct v4l2_query_ext_ctrl &qctrl, int show_men if (qctrl.flags & V4L2_CTRL_FLAG_DISABLED) return 1; if (qctrl.type == V4L2_CTRL_TYPE_CTRL_CLASS) { - printf("\n%s\n\n", qctrl.name); + print_class_name(qctrl.name); return 1; } ext_ctrl.id = qctrl.id;