From patchwork Mon Apr 20 18:46:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 210106 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 2CBAEC3815B for ; Mon, 20 Apr 2020 18:46:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 02C3A206E9 for ; Mon, 20 Apr 2020 18:46:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WHIwiCWE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728126AbgDTSq4 (ORCPT ); Mon, 20 Apr 2020 14:46:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbgDTSqz (ORCPT ); Mon, 20 Apr 2020 14:46:55 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55D67C061A0C for ; Mon, 20 Apr 2020 11:46:55 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id h69so5509959pgc.8 for ; Mon, 20 Apr 2020 11:46:55 -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=9kZyrpoILwGtiw85vGBttiJNgt55hwAV1pgsqDbFCQs=; b=WHIwiCWExIKI07uceS4v/j8VPWBGIF6FgeiOlXYlIEL1+HCFhonY0exaDq98AmCiyJ opcKNpxPa42im3chQkHmXsbTgtNLKUnvWZVKsQlIV0zktIU0Bc0CWJAdqm0Q1KYNhAfd pnxx82MmSq/uii9OsjsLxSoJSOSywiJ/W6tX2ZoBZOyLbc7l2m6QBTGcNmt1u/kuaT3L ZK2NTUs9Wl91oGkcvLWulEMoLeuaBoSLW5abEecJrP475f7ZaexxKaJlQKI0zgnCtc6E SQzhemp/LUN/fCPrJ7YAOUdXCMYYEG26RxBUoIFFExDuOHal9M/+z61W4z19Xhk7QWcd nsZQ== 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=9kZyrpoILwGtiw85vGBttiJNgt55hwAV1pgsqDbFCQs=; b=HyDmCm3Qz7nf+A+rwagjFK91oMryAiRBIb2thp2ii7xg3KDs+WlmN4KvFmsWlpsX67 sGXn+HrisykUBCNpcjHEFjnZzD4QHFzL7XE879qlFV9Zv3avB+2ERmviATunPfg7GwAh T7l4wJmlxBlqjR5Q9TdKVjF958uok1Ra9LfAfdwPOGlJEb3xHsxeJAcyEpWRaILXuHeF lMsftR2/f/m06aRu1LZmynkTzGwSllj8RJi31zbjD3l8OaGkGmykcpYNC8VF7Jpn1AFH r4CBrESAOkxorrn5PyZ4xSLnY72eBiu8k+4cYXIAkEEhLi+t30mZFB6wy+k5KSJg2vtR US1g== X-Gm-Message-State: AGi0PuZ64SpG7HbRCnmdogT/P+azfmJlLw/Le1VV7ad9LRcmUXYdbwlA St5ia+dK7KYGuJq2SKwlS1vfplc0 X-Google-Smtp-Source: APiQypLv3Oj3O0za1qVNPfFcq9JG86gS3jr3+3E9k6GeZKiyFgvKVVtf+R6vt4uHDHB+4uq2FRP83w== X-Received: by 2002:a63:ef02:: with SMTP id u2mr17741543pgh.21.1587408413915; Mon, 20 Apr 2020 11:46:53 -0700 (PDT) Received: from localhost.localdomain (76-14-109-232.rk.wavecable.com. [76.14.109.232]) by smtp.gmail.com with ESMTPSA id n8sm182443pfq.213.2020.04.20.11.46.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 11:46:53 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 3/7] treewide: fix wrong *cmp function usage Date: Mon, 20 Apr 2020 11:46:45 -0700 Message-Id: <20200420184649.4202-3-rosenp@gmail.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200420184649.4202-1-rosenp@gmail.com> References: <20200420184649.4202-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 bugprone-suspicious-string-compare Signed-off-by: Rosen Penev --- lib/libdvbv5/countries.c | 2 +- lib/libdvbv5/dvb-dev-remote.c | 4 ++-- lib/libdvbv5/parse_string.c | 4 ++-- lib/libv4l2rds/libv4l2rds.c | 6 +++--- utils/cec-compliance/cec-test-adapter.cpp | 2 +- utils/cec-compliance/cec-test.cpp | 8 ++++---- utils/cec-ctl/cec-ctl.cpp | 2 +- utils/common/media-info.cpp | 4 ++-- utils/dvb/dvbv5-daemon.c | 2 +- utils/dvb/dvbv5-scan.c | 2 +- utils/ir-ctl/ir-ctl.c | 4 ++-- utils/keytable/keytable.c | 6 +++--- utils/libmedia_dev/get_media_devices.c | 4 ++-- utils/media-ctl/libmediactl.c | 2 +- utils/media-ctl/libv4l2subdev.c | 2 +- utils/v4l2-compliance/v4l2-compliance.cpp | 18 +++++++++--------- utils/v4l2-compliance/v4l2-test-buffers.cpp | 4 ++-- utils/v4l2-compliance/v4l2-test-media.cpp | 16 ++++++++-------- utils/v4l2-compliance/v4l2-test-subdevs.cpp | 4 ++-- utils/v4l2-ctl/v4l2-ctl-common.cpp | 2 +- 20 files changed, 49 insertions(+), 49 deletions(-) diff --git a/lib/libdvbv5/countries.c b/lib/libdvbv5/countries.c index 609add0b..c5682365 100644 --- a/lib/libdvbv5/countries.c +++ b/lib/libdvbv5/countries.c @@ -395,7 +395,7 @@ enum dvb_country_t dvb_guess_user_country(void) continue; if (! strncmp(buf, "POSIX", MIN(strlen(buf), 5)) || - ! (strncmp(buf, "en", MIN(strlen(buf), 2)) && !isalpha(buf[2])) ) + ! (strncmp(buf, "en", MIN(strlen(buf), 2)) != 0 && !isalpha(buf[2])) ) continue; buf = strdup(buf); diff --git a/lib/libdvbv5/dvb-dev-remote.c b/lib/libdvbv5/dvb-dev-remote.c index ebb1bdb7..643ca559 100644 --- a/lib/libdvbv5/dvb-dev-remote.c +++ b/lib/libdvbv5/dvb-dev-remote.c @@ -733,7 +733,7 @@ static void *receive_data(void *privdata) handled = 1; - if (strcmp(msg->cmd, cmd)) { + if (strcmp(msg->cmd, cmd) != 0) { dvb_logerr("msg #%d: Expecting '%s', got '%s'", seq, msg->cmd, cmd); free_msg(dvb, msg); @@ -792,7 +792,7 @@ static int dvb_remote_get_version(struct dvb_device_priv *dvb) goto error; } - if (strcmp(version, daemon_version)) { + if (strcmp(version, daemon_version) != 0) { dvb_logerr("Wrong version. Expecting '%s', received '%s'", daemon_version, version); ret = 0; diff --git a/lib/libdvbv5/parse_string.c b/lib/libdvbv5/parse_string.c index d354f497..b3518291 100644 --- a/lib/libdvbv5/parse_string.c +++ b/lib/libdvbv5/parse_string.c @@ -348,7 +348,7 @@ static void charset_conversion(struct dvb_v5_fe_parms *parms, char **dest, const *p = '\0'; /* If desired charset is not UTF-8, prepare for conversion */ - if (strcasecmp(parms->output_charset, "UTF-8")) { + if (strcasecmp(parms->output_charset, "UTF-8") != 0) { tmp = (unsigned char *)*dest; len = p - *dest; @@ -391,7 +391,7 @@ void dvb_parse_string(struct dvb_v5_fe_parms *parms, char **dest, char **emph, * Strings in ISDB-S/T(JP) do not start with a charset identifier, * and can start with a control character (< 0x20). */ - if (strcasecmp(type, "ARIB-STD-B24") && *src < 0x20) { + if (strcasecmp(type, "ARIB-STD-B24") != 0 && *src < 0x20) { switch (*src) { case 0x00: type = "ISO-6937"; break; case 0x01: type = "ISO-8859-5"; break; diff --git a/lib/libv4l2rds/libv4l2rds.c b/lib/libv4l2rds/libv4l2rds.c index 2e67d060..a053adea 100644 --- a/lib/libv4l2rds/libv4l2rds.c +++ b/lib/libv4l2rds/libv4l2rds.c @@ -920,7 +920,7 @@ static uint32_t rds_decode_group2(struct rds_private_state *priv_state) if (segment == 0x0f) { handle->rt_length = 64; handle->valid_fields |= V4L2_RDS_RT; - if (memcmp(handle->rt, priv_state->new_rt, 64)) { + if (memcmp(handle->rt, priv_state->new_rt, 64) != 0) { memcpy(handle->rt, priv_state->new_rt, 64); updated_fields |= V4L2_RDS_RT; } @@ -937,7 +937,7 @@ static uint32_t rds_decode_group2(struct rds_private_state *priv_state) handle->rt_length = 32; handle->valid_fields |= V4L2_RDS_RT; updated_fields |= V4L2_RDS_RT; - if (memcmp(handle->rt, priv_state->new_rt, 32)) { + if (memcmp(handle->rt, priv_state->new_rt, 32) != 0) { memcpy(handle->rt, priv_state->new_rt, 32); updated_fields |= V4L2_RDS_RT; } @@ -954,7 +954,7 @@ static uint32_t rds_decode_group2(struct rds_private_state *priv_state) priv_state->new_rt[i] = '\0'; handle->rt_length = i; handle->valid_fields |= V4L2_RDS_RT; - if (memcmp(handle->rt, priv_state->new_rt, handle->rt_length)) { + if (memcmp(handle->rt, priv_state->new_rt, handle->rt_length) != 0) { memcpy(handle->rt, priv_state->new_rt, handle->rt_length); updated_fields |= V4L2_RDS_RT; diff --git a/utils/cec-compliance/cec-test-adapter.cpp b/utils/cec-compliance/cec-test-adapter.cpp index 0675ccb7..27c742b3 100644 --- a/utils/cec-compliance/cec-test-adapter.cpp +++ b/utils/cec-compliance/cec-test-adapter.cpp @@ -193,7 +193,7 @@ static int testAdapLogAddrs(struct node *node) fail_on_test(laddrs.log_addr_mask == 0); for (unsigned i = 0; i < laddrs.num_log_addrs; i++) { fail_on_test(laddrs.log_addr[i] == CEC_LOG_ADDR_INVALID); - fail_on_test(memcmp(laddrs.features[i], features, 4)); + fail_on_test(memcmp(laddrs.features[i], features, 4) != 0); fail_on_test(check_0(laddrs.features[i] + 4, 8)); } for (unsigned i = laddrs.num_log_addrs; i < CEC_MAX_LOG_ADDRS; i++) { diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp index 9a08f54b..4aa54afc 100644 --- a/utils/cec-compliance/cec-test.cpp +++ b/utils/cec-compliance/cec-test.cpp @@ -116,7 +116,7 @@ int system_info_get_menu_lang(struct node *node, unsigned me, unsigned la, bool if (cec_msg_status_is_abort(&msg)) return OK_PRESUMED; cec_ops_set_menu_language(&msg, language); - fail_on_test(strcmp(node->remote[la].language, language)); + fail_on_test(strcmp(node->remote[la].language, language) != 0); return 0; } @@ -319,7 +319,7 @@ int device_osd_transfer_give(struct node *node, unsigned me, unsigned la, bool i char osd_name[15]; cec_ops_set_osd_name(&msg, osd_name); fail_on_test(!osd_name[0]); - fail_on_test(strcmp(node->remote[la].osd_name, osd_name)); + fail_on_test(strcmp(node->remote[la].osd_name, osd_name) != 0); fail_on_test(msg.len != strlen(osd_name) + 2); return 0; @@ -937,11 +937,11 @@ static int tuner_ctl_test(struct node *node, unsigned me, unsigned la, bool inte fail_on_test(timed_out_or_abort(&msg)); info = {}; cec_ops_tuner_device_status(&msg, &info); - if (memcmp(&info, &(*iter), sizeof(info))) { + if (memcmp(&info, &(*iter), sizeof(info)) != 0) { log_tuner_service(info); log_tuner_service(*iter); } - fail_on_test(memcmp(&info, &(*iter), sizeof(info))); + fail_on_test(memcmp(&info, &(*iter), sizeof(info)) != 0); } printf("\t Finished Channel Test\n"); diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index 3495883e..be37ae3c 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -975,7 +975,7 @@ static void analyze(const char *analyze_pin) exit(1); } if (!fgets(s, sizeof(s), fanalyze) || - strcmp(s, "# cec-ctl --store-pin\n")) + strcmp(s, "# cec-ctl --store-pin\n") != 0) goto err; line++; if (!fgets(s, sizeof(s), fanalyze) || diff --git a/utils/common/media-info.cpp b/utils/common/media-info.cpp index a5b429a0..b0f0bc41 100644 --- a/utils/common/media-info.cpp +++ b/utils/common/media-info.cpp @@ -187,7 +187,7 @@ std::string mi_get_devpath_from_dev_t(dev_t dev) if (bytes <= 0) break; line[bytes - 1] = 0; - if (memcmp(line, "DEVNAME=", 8) || !line[8]) + if ((memcmp(line, "DEVNAME=", 8) != 0) || !line[8]) continue; devpath = "/dev/"; devpath += line + 8; @@ -229,7 +229,7 @@ int mi_get_media_fd(int fd, const char *bus_info) if (bus_info && (ioctl(media_fd, MEDIA_IOC_DEVICE_INFO, &mdinfo) || - strcmp(mdinfo.bus_info, bus_info))) { + (strcmp(mdinfo.bus_info, bus_info) != 0))) { close(media_fd); continue; } diff --git a/utils/dvb/dvbv5-daemon.c b/utils/dvb/dvbv5-daemon.c index ad1197b7..a17233b2 100644 --- a/utils/dvb/dvbv5-daemon.c +++ b/utils/dvb/dvbv5-daemon.c @@ -1203,7 +1203,7 @@ static int dev_set_parms(uint32_t seq, char *cmd, int fd, if (!*new_lnb) { par->lnb = NULL; - } else if (strcmp(old_lnb, new_lnb)) { + } else if (strcmp(old_lnb, new_lnb) != 0) { int lnb = dvb_sat_search_lnb(new_lnb); if (lnb < 0) { diff --git a/utils/dvb/dvbv5-scan.c b/utils/dvb/dvbv5-scan.c index 0a522433..30f8385f 100644 --- a/utils/dvb/dvbv5-scan.c +++ b/utils/dvb/dvbv5-scan.c @@ -288,7 +288,7 @@ static int run_scan(struct arguments *args, struct dvb_device *dvb) * to avoid linear search of LNB types for every entries. */ if (!args->lnb_name && entry->lnb && - (!parms->lnb || strcasecmp(entry->lnb, parms->lnb->alias))) + (!parms->lnb || strcasecmp(entry->lnb, parms->lnb->alias) != 0)) parms->lnb = dvb_sat_get_lnb(dvb_sat_search_lnb(entry->lnb)); /* diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c index ba454619..9f8c1c5d 100644 --- a/utils/ir-ctl/ir-ctl.c +++ b/utils/ir-ctl/ir-ctl.c @@ -739,7 +739,7 @@ static struct send* convert_keycode(struct keymap *map, const char *keycode) struct raw_entry *re; for (re = map->raw; re; re = re->next) { - if (strcmp(re->keycode, keycode)) + if (strcmp(re->keycode, keycode) != 0) continue; count++; @@ -760,7 +760,7 @@ static struct send* convert_keycode(struct keymap *map, const char *keycode) const char *proto_str; enum rc_proto proto; - if (strcmp(se->keycode, keycode)) + if (strcmp(se->keycode, keycode) != 0) continue; count++; diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c index 4db91267..2c76f52b 100644 --- a/utils/keytable/keytable.c +++ b/utils/keytable/keytable.c @@ -360,7 +360,7 @@ static void add_bpf_protocol(struct bpf_protocol *new) struct bpf_protocol *a; for (a = bpf_protocol; a; a = a->next) { - if (strcmp(a->name, new->name)) + if (strcmp(a->name, new->name) != 0) continue; if (compare_parameters(a->param, new->param) && @@ -2075,9 +2075,9 @@ int main(int argc, char *argv[]) int matches = 0; for (cur = &cfg; cur->next; cur = cur->next) { - if ((!rc_dev.drv_name || strcasecmp(cur->driver, rc_dev.drv_name)) && strcasecmp(cur->driver, "*")) + if ((!rc_dev.drv_name || strcasecmp(cur->driver, rc_dev.drv_name) != 0) && strcasecmp(cur->driver, "*") != 0) continue; - if ((!rc_dev.keytable_name || strcasecmp(cur->table, rc_dev.keytable_name)) && strcasecmp(cur->table, "*")) + if ((!rc_dev.keytable_name || strcasecmp(cur->table, rc_dev.keytable_name) != 0) && strcasecmp(cur->table, "*") != 0) continue; if (debug) diff --git a/utils/libmedia_dev/get_media_devices.c b/utils/libmedia_dev/get_media_devices.c index 491a94da..462b8b97 100644 --- a/utils/libmedia_dev/get_media_devices.c +++ b/utils/libmedia_dev/get_media_devices.c @@ -431,7 +431,7 @@ void display_media_devices(void *opaque) char *prev = ""; for (i = 0; i < md->md_size; i++) { - if (strcmp(prev, md_ptr->device)) { + if (strcmp(prev, md_ptr->device) != 0) { printf("\nDevice %s:\n\t", md_ptr->device); prev = md_ptr->device; } @@ -584,7 +584,7 @@ const char *get_not_associated_device(void *opaque, } if (last_seek && !found) continue; - if (strcmp(prev, md_ptr->device)) { + if (strcmp(prev, md_ptr->device) != 0) { if (!skip && result) break; prev = md_ptr->device; diff --git a/utils/media-ctl/libmediactl.c b/utils/media-ctl/libmediactl.c index 1fd6525b..6ef9a3f5 100644 --- a/utils/media-ctl/libmediactl.c +++ b/utils/media-ctl/libmediactl.c @@ -475,7 +475,7 @@ static int media_get_devname_sysfs(struct media_entity *entity) if (strstr(p + 1, "dvb")) { char *s = p + 1; - if (strncmp(s, "dvb", 3)) + if (strncmp(s, "dvb", 3) != 0) return -EINVAL; s += 3; p = strchr(s, '.'); diff --git a/utils/media-ctl/libv4l2subdev.c b/utils/media-ctl/libv4l2subdev.c index 0d0afbe7..3b4490aa 100644 --- a/utils/media-ctl/libv4l2subdev.c +++ b/utils/media-ctl/libv4l2subdev.c @@ -433,7 +433,7 @@ static bool strhazit(const char *str, const char **p) { int len = strlen(str); - if (strncmp(str, *p, len)) + if (strncmp(str, *p, len) != 0) return false; for (*p += len; isspace(**p); ++*p); diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index 938c7c35..0c3af294 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -620,14 +620,14 @@ static int testCap(struct node *node) fail_on_test(check_ustring(vcap.card, sizeof(vcap.card))); fail_on_test(check_ustring(vcap.bus_info, sizeof(vcap.bus_info))); // Check for valid prefixes - if (memcmp(vcap.bus_info, "usb-", 4) && - memcmp(vcap.bus_info, "PCI:", 4) && - memcmp(vcap.bus_info, "PCIe:", 5) && - memcmp(vcap.bus_info, "ISA:", 4) && - memcmp(vcap.bus_info, "I2C:", 4) && - memcmp(vcap.bus_info, "parport", 7) && - memcmp(vcap.bus_info, "platform:", 9) && - memcmp(vcap.bus_info, "rmi4:", 5)) + if (memcmp(vcap.bus_info, "usb-", 4) != 0 && + memcmp(vcap.bus_info, "PCI:", 4) != 0 && + memcmp(vcap.bus_info, "PCIe:", 5) != 0 && + memcmp(vcap.bus_info, "ISA:", 4) != 0 && + memcmp(vcap.bus_info, "I2C:", 4) != 0 && + memcmp(vcap.bus_info, "parport", 7) != 0 && + memcmp(vcap.bus_info, "platform:", 9) != 0 && + memcmp(vcap.bus_info, "rmi4:", 5) != 0) return fail("missing bus_info prefix ('%s')\n", vcap.bus_info); if (!node->media_bus_info.empty() && node->media_bus_info != std::string(reinterpret_cast(vcap.bus_info))) @@ -834,7 +834,7 @@ static int open_media_bus_info(const std::string &bus_info, std::string &media_d while ((ep = readdir(dp))) { const char *name = ep->d_name; - if (!memcmp(name, "media", 5) && isdigit(name[5])) { + if ((!memcmp(name, "media", 5) != 0) && isdigit(name[5])) { struct media_device_info mdi; media_devname = std::string("/dev/") + name; diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp index 3b45711d..004de314 100644 --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp @@ -1011,7 +1011,7 @@ static int captureBufs(struct node *node, struct node *node_m2m_cap, const cv4l_ (orig_buf.flags & valid_output_flags)); if (buf.g_flags() & V4L2_BUF_FLAG_TIMECODE) fail_on_test(memcmp(&buf.g_timecode(), &orig_buf.timecode, - sizeof(orig_buf.timecode))); + sizeof(orig_buf.timecode)) != 0); } fail_on_test(buf.g_flags() & V4L2_BUF_FLAG_DONE); @@ -1085,7 +1085,7 @@ static int captureBufs(struct node *node, struct node *node_m2m_cap, const cv4l_ (orig_buf.flags & valid_output_flags)); if (buf.g_flags() & V4L2_BUF_FLAG_TIMECODE) fail_on_test(memcmp(&buf.g_timecode(), &orig_buf.timecode, - sizeof(orig_buf.timecode))); + sizeof(orig_buf.timecode)) != 0); } fail_on_test(buf.g_flags() & V4L2_BUF_FLAG_DONE); if (!count || stopped) { diff --git a/utils/v4l2-compliance/v4l2-test-media.cpp b/utils/v4l2-compliance/v4l2-test-media.cpp index bcd8a725..bcba3b15 100644 --- a/utils/v4l2-compliance/v4l2-test-media.cpp +++ b/utils/v4l2-compliance/v4l2-test-media.cpp @@ -53,14 +53,14 @@ int testMediaDeviceInfo(struct node *node) } else { fail_on_test(check_string(mdinfo.bus_info, sizeof(mdinfo.bus_info))); // Check for valid prefixes - if (memcmp(mdinfo.bus_info, "usb-", 4) && - memcmp(mdinfo.bus_info, "PCI:", 4) && - memcmp(mdinfo.bus_info, "PCIe:", 5) && - memcmp(mdinfo.bus_info, "ISA:", 4) && - memcmp(mdinfo.bus_info, "I2C:", 4) && - memcmp(mdinfo.bus_info, "parport", 7) && - memcmp(mdinfo.bus_info, "platform:", 9) && - memcmp(mdinfo.bus_info, "rmi4:", 5)) + if (memcmp(mdinfo.bus_info, "usb-", 4) != 0 && + memcmp(mdinfo.bus_info, "PCI:", 4) != 0 && + memcmp(mdinfo.bus_info, "PCIe:", 5) != 0 && + memcmp(mdinfo.bus_info, "ISA:", 4) != 0 && + memcmp(mdinfo.bus_info, "I2C:", 4) != 0 && + memcmp(mdinfo.bus_info, "parport", 7) != 0 && + memcmp(mdinfo.bus_info, "platform:", 9) != 0 && + memcmp(mdinfo.bus_info, "rmi4:", 5) != 0) return fail("missing bus_info prefix ('%s')\n", mdinfo.bus_info); } fail_on_test(mdinfo.media_version == 0); diff --git a/utils/v4l2-compliance/v4l2-test-subdevs.cpp b/utils/v4l2-compliance/v4l2-test-subdevs.cpp index 489639fb..998f63be 100644 --- a/utils/v4l2-compliance/v4l2-test-subdevs.cpp +++ b/utils/v4l2-compliance/v4l2-test-subdevs.cpp @@ -433,7 +433,7 @@ int testSubDevSelection(struct node *node, unsigned which, unsigned pad) fail_on_test(check_0(crop.reserved, sizeof(crop.reserved))); fail_on_test(crop.which != which); fail_on_test(crop.pad != pad); - fail_on_test(memcmp(&crop.rect, &sel.r, sizeof(sel.r))); + fail_on_test(memcmp(&crop.rect, &sel.r, sizeof(sel.r)) != 0); for (unsigned tgt = 0; targets[tgt].target != ~0U; tgt++) { targets[tgt].found = false; @@ -476,7 +476,7 @@ int testSubDevSelection(struct node *node, unsigned which, unsigned pad) fail_on_test(check_0(crop.reserved, sizeof(crop.reserved))); fail_on_test(crop.which != which); fail_on_test(crop.pad != pad); - fail_on_test(memcmp(&crop.rect, &sel.r, sizeof(sel.r))); + fail_on_test(memcmp(&crop.rect, &sel.r, sizeof(sel.r)) != 0); } } fail_on_test(!ret && targets[tgt].readonly); diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index f2997951..5dde39b9 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -190,7 +190,7 @@ static void list_media_devices(const std::string &media_bus_info) std::string s("/dev/"); s += ep->d_name; - if (memcmp(ep->d_name, "media", 5)) { + if (memcmp(ep->d_name, "media", 5) != 0) { if (!is_v4l_dev(ep->d_name)) continue; struct stat st; From patchwork Mon Apr 20 18:46:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 210105 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 CBF1EC54FCF for ; Mon, 20 Apr 2020 18:46:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A7F962078C for ; Mon, 20 Apr 2020 18:46:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IPjH7gfz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728130AbgDTSq4 (ORCPT ); Mon, 20 Apr 2020 14:46:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728118AbgDTSqz (ORCPT ); Mon, 20 Apr 2020 14:46:55 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A883C061A10 for ; Mon, 20 Apr 2020 11:46:55 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id x3so5371462pfp.7 for ; Mon, 20 Apr 2020 11:46:55 -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=YMKCiBqOo3NYeVY2TxxXAO5i0dheV6Bw/cbrfxZRXk8=; b=IPjH7gfz8PHBS2a1xbaP/i5y0daI/qVxVqctG0H95pcgdvmeJbcUVfVhWw84lEFjn2 fcqczc7S+RoT+jH0ZeQMJ8yFuD4nB8X6KP68/2x/dxljriXRU1Jbag7hpZ5WswNJ+EWW 979q1bXJc5ydByFX8NpXS0nO2WHj2Kasis0MMGl0a2JSTFEx9H1/YXyOjJR3sKDMRqYy J0zUgM+aGCjxkki8FcAyHcpKofrrYuTuaPHnYrpgzK+6u7/YO5O052C8fgwT68/4kxAJ hZxpBPahfRpmzP3PseXOXYalDNGYiywKlxr1Q7AeoqcR4Q39NgLbS/YHHmieAVH6GGoR vAzw== 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=YMKCiBqOo3NYeVY2TxxXAO5i0dheV6Bw/cbrfxZRXk8=; b=Y9QBiyWZ+sbI8F4zbB/a8LIac2i7dNAAQVUuJjaXjp+moiJMY69ML1mKRfD8ixsdnq bddkAvSxlBmPPNhtayLXXQYoKyB21cZahy0aKe8knOOQz22EVZ6tdWlPs6EKi+5BPgfJ teZUZ1ZQwjL/8eOnjOQjXbqtYF30EFPROQ5/n1FxmazwYvQ2cfGlCtjJ9nJmlkSY3i0S y4SFR/7pHdPUQgqWsB4XW1sULkNQnmwhBzunAk4iiPoX/XSQSCwnCuNorTUUjJnpwWiG d3uzbPpYGZ7kJuFPpbYNM3bmP1ZTxTF7yTYFKKNHFbxlQDStDOF8K+SQHxnQuP2nskIs 1fGQ== X-Gm-Message-State: AGi0PubocgKdAyZyf8Nt6Id4FEFV7ER6wx2qP/+20ACzBMG6J4NhLFPM Sy5wwEZg/DY2p7TznvYY74UZpefL X-Google-Smtp-Source: APiQypIAk/Na4lvV5wIF+8hRm8zaguXIOnrdZZV6YIugM+bCIOyZbMOE9GMif5CrW5Wv+bbVd+8m9A== X-Received: by 2002:a63:5fd0:: with SMTP id t199mr18145536pgb.207.1587408414717; Mon, 20 Apr 2020 11:46:54 -0700 (PDT) Received: from localhost.localdomain (76-14-109-232.rk.wavecable.com. [76.14.109.232]) by smtp.gmail.com with ESMTPSA id n8sm182443pfq.213.2020.04.20.11.46.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 11:46:54 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 4/7] treewide: apply performance fixes Date: Mon, 20 Apr 2020 11:46:46 -0700 Message-Id: <20200420184649.4202-4-rosenp@gmail.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200420184649.4202-1-rosenp@gmail.com> References: <20200420184649.4202-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 performance* Signed-off-by: Rosen Penev --- utils/v4l2-compliance/v4l2-compliance.cpp | 2 +- utils/v4l2-compliance/v4l2-compliance.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index 0c3af294..bb32bae6 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -301,7 +301,7 @@ int check_0(const void *p, int len) static std::map stream_from_map; static std::map stream_hdr_map; -std::string stream_from(std::string pixelformat, bool &use_hdr) +std::string stream_from(const std::string& pixelformat, bool &use_hdr) { if (stream_from_map.find(pixelformat) == stream_from_map.end()) { if (pixelformat.empty()) diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h index 43754519..921e15be 100644 --- a/utils/v4l2-compliance/v4l2-compliance.h +++ b/utils/v4l2-compliance/v4l2-compliance.h @@ -263,7 +263,7 @@ int check_0(const void *p, int len); int restoreFormat(struct node *node); void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_node, media_type type, unsigned frame_count, unsigned all_fmt_frame_count); -std::string stream_from(std::string pixelformat, bool &use_hdr); +std::string stream_from(const std::string& pixelformat, bool &use_hdr); // Media Controller ioctl tests int testMediaDeviceInfo(struct node *node); From patchwork Mon Apr 20 18:46:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 210104 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 517E1C3815B for ; Mon, 20 Apr 2020 18:47:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23E07206E9 for ; Mon, 20 Apr 2020 18:47:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b3kin/z+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728152AbgDTSrA (ORCPT ); Mon, 20 Apr 2020 14:47:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728151AbgDTSq7 (ORCPT ); Mon, 20 Apr 2020 14:46:59 -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 E0978C061A0C for ; Mon, 20 Apr 2020 11:46:58 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id ay1so4288058plb.0 for ; Mon, 20 Apr 2020 11:46:58 -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=pmXgVfrCaEJM4XqVQF1wL6sqq2+r90tusGJ6s4f3xzY=; b=b3kin/z+Cvl+1rYfGzrN3EvGx9pjv2rXI+SI71Jc/n9f9F4/yz0UIEVatY2EIMDnSu Gjyvzt7Vvqs8U1xwpVAdCw4G6teI7EcJKQrvWUhKiJM7JbidCDRMQL6+msZblINEDFwm iAmXn17f2JA1NkAD5OCendXgE7H4KelxAkuaLOgB8SiRxxxUVRJjNxxU2aTIS3PgvCEQ KdO5c83inIyQDEh7tAw9epuNwhhSNutG3KUskXx8M6u1i08v34oO9Gvu5+HAP7Zd3P4/ CNXYX3aVAZyYGwMPYaaRQgft8Drnn0bjT398lQWYr2RZB6aRcm/PsKjvFPPqUmhzv5xi 26ow== 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=pmXgVfrCaEJM4XqVQF1wL6sqq2+r90tusGJ6s4f3xzY=; b=JjqPKCfEwsBk61KLpk9oHwLVap+xLvxYSd9eBA4SC/yD9yv7Gytmi8miluFkaxIpdh NwMfeD1wNzZn2d4yUyzSHVnoFfYkmXpiJVndL86+//kL32nNpIsbO+PAHgWW/VUZiD27 FYx88eCJAXShLiEDGKWhIDa3BgaNj0YEyEfS12gG9oBT87bOyG3XElfZO3eFIW3UK8Lq b0msiNwOTTbmtaxw2zIq/QhpKzKwiaQLFO/k7AETFnomeBvgTND4z9NLp2b3Hsm1k+IW nB9BxUcs3fWFLKFdlY8dgBBdl/9+eBid41Dhcx0wXKmi71LvTzoGxhxpMA/4DBI70Inb /FRg== X-Gm-Message-State: AGi0PuY3EuI7Esmd4p/JVcJqw8MJXoiU7VpbpZdMUXJH7LLmUzNbe0z5 onDMGEe8fNdNZ/K6hND0yuuRCYJE X-Google-Smtp-Source: APiQypLh5xDWTcNC0FCOjy1erKlUez/CbmwK/di55CAAGf8+D4NLmymaB+rTe9nHxsoqFs4wvfv9Mw== X-Received: by 2002:a17:902:bd8f:: with SMTP id q15mr1489840pls.76.1587408417937; Mon, 20 Apr 2020 11:46:57 -0700 (PDT) Received: from localhost.localdomain (76-14-109-232.rk.wavecable.com. [76.14.109.232]) by smtp.gmail.com with ESMTPSA id n8sm182443pfq.213.2020.04.20.11.46.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 11:46:57 -0700 (PDT) From: Rosen Penev To: linux-media@vger.kernel.org Subject: [PATCH 7/7] utils: do not use empty void with C++ Date: Mon, 20 Apr 2020 11:46:49 -0700 Message-Id: <20200420184649.4202-7-rosenp@gmail.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200420184649.4202-1-rosenp@gmail.com> References: <20200420184649.4202-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 clang-tidy's modernize-redundant-void-arg Signed-off-by: Rosen Penev --- utils/cec-compliance/cec-compliance.cpp | 2 +- utils/cec-compliance/cec-test.cpp | 4 ++-- utils/cec-ctl/cec-ctl.cpp | 2 +- utils/cec-follower/cec-follower.cpp | 2 +- utils/rds-ctl/rds-ctl.cpp | 12 ++++++------ utils/v4l2-compliance/v4l2-compliance.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-common.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-edid.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-io.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-meta.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-misc.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-overlay.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-sdr.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-selection.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-stds.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-subdev.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-tuner.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-vbi.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-vidcap.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl-vidout.cpp | 2 +- utils/v4l2-ctl/v4l2-ctl.cpp | 2 +- utils/v4l2-dbg/v4l2-dbg.cpp | 2 +- 23 files changed, 29 insertions(+), 29 deletions(-) diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp index 6d07bfc9..713e2a58 100644 --- a/utils/cec-compliance/cec-compliance.cpp +++ b/utils/cec-compliance/cec-compliance.cpp @@ -178,7 +178,7 @@ static struct option long_options[] = { {0, 0, 0, 0} }; -static void usage(void) +static void usage() { printf("Usage:\n" " -d, --device Use device instead of /dev/cec0\n" diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp index a82069ad..af9f3d38 100644 --- a/utils/cec-compliance/cec-test.cpp +++ b/utils/cec-compliance/cec-test.cpp @@ -1494,7 +1494,7 @@ static const unsigned num_tests = sizeof(tests) / sizeof(struct remote_test); static std::map mapTests; static std::map mapTestsNoWarnings; -void collectTests(void) +void collectTests() { std::map mapTestFuncs; @@ -1516,7 +1516,7 @@ void collectTests(void) } } -void listTests(void) +void listTests() { for (unsigned i = 0; i < num_tests; i++) { printf("%s:\n", tests[i].name); diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index 46cfcd80..929928e2 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -229,7 +229,7 @@ static struct option long_options[] = { { 0, 0, 0, 0 } }; -static void usage(void) +static void usage() { printf("Usage:\n" " -d, --device Use device instead of /dev/cec0\n" diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp index ab3113b6..36bd2fbb 100644 --- a/utils/cec-follower/cec-follower.cpp +++ b/utils/cec-follower/cec-follower.cpp @@ -71,7 +71,7 @@ static struct option long_options[] = { { 0, 0, 0, 0 } }; -static void usage(void) +static void usage() { printf("Usage:\n" " -d, --device Use device instead of /dev/cec0\n" diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp index fef2a3f1..0511fe5d 100644 --- a/utils/rds-ctl/rds-ctl.cpp +++ b/utils/rds-ctl/rds-ctl.cpp @@ -108,12 +108,12 @@ static struct option long_options[] = { {0, 0, 0, 0} }; -static void usage_hint(void) +static void usage_hint() { fprintf(stderr, "Try 'rds-ctl --help' for more information.\n"); } -static void usage_common(void) +static void usage_common() { printf("\nGeneral/Common options:\n" " --all display all device information available\n" @@ -127,7 +127,7 @@ static void usage_common(void) ); } -static void usage_tuner(void) +static void usage_tuner() { printf("\nTuner/Modulator options:\n" " -F, --get-freq query the frequency [VIDIOC_G_FREQUENCY]\n" @@ -145,7 +145,7 @@ static void usage_tuner(void) ); } -static void usage_rds(void) +static void usage_rds() { printf("\nRDS options: \n" " -b, --rbds parse the RDS data according to the RBDS standard\n" @@ -164,7 +164,7 @@ static void usage_rds(void) ); } -static void usage(void) +static void usage() { printf("Usage:\n"); usage_common(); @@ -326,7 +326,7 @@ static void print_devices(dev_vec files) printf("%s\n", iter->second.c_str()); } } -static dev_vec list_devices(void) +static dev_vec list_devices() { DIR *dp; struct dirent *ep; diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index 39dd1aec..3211b492 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -155,7 +155,7 @@ static struct option long_options[] = { {0, 0, 0, 0} }; -static void usage(void) +static void usage() { printf("Usage:\n"); printf("Common options:\n"); diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index 5dde39b9..3ca02087 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -55,7 +55,7 @@ static enum v4l2_priority prio = V4L2_PRIORITY_UNSET; static bool have_query_ext_ctrl; -void common_usage(void) +void common_usage() { printf("\nGeneral/Common options:\n" " --all display all information available\n" diff --git a/utils/v4l2-ctl/v4l2-ctl-edid.cpp b/utils/v4l2-ctl/v4l2-ctl-edid.cpp index 366e6522..9c7c6bc4 100644 --- a/utils/v4l2-ctl/v4l2-ctl-edid.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-edid.cpp @@ -122,7 +122,7 @@ static __u8 toggle_hdr_md_flags; #define HDR_MD_SMPTE_2084 (1 << 2) #define HDR_MD_HLG (1 << 3) -void edid_usage(void) +void edid_usage() { printf("\nEDID options:\n" " --set-edid pad=[,type=|file=][,format=][modifiers]\n" diff --git a/utils/v4l2-ctl/v4l2-ctl-io.cpp b/utils/v4l2-ctl/v4l2-ctl-io.cpp index 1130fdc0..9e83c03a 100644 --- a/utils/v4l2-ctl/v4l2-ctl-io.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-io.cpp @@ -21,7 +21,7 @@ static struct v4l2_audioout vaudout; /* audio outputs */ static int input; /* set_input/get_input */ static int output; /* set_output/get_output */ -void io_usage(void) +void io_usage() { printf("\nInput/Output options:\n" " -I, --get-input query the video input [VIDIOC_G_INPUT]\n" diff --git a/utils/v4l2-ctl/v4l2-ctl-meta.cpp b/utils/v4l2-ctl/v4l2-ctl-meta.cpp index 0e1071b0..76d4b1dd 100644 --- a/utils/v4l2-ctl/v4l2-ctl-meta.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-meta.cpp @@ -18,7 +18,7 @@ static struct v4l2_format vfmt; /* set_format/get_format */ -void meta_usage(void) +void meta_usage() { printf("\nMetadata Formats options:\n" " --list-formats-meta display supported metadata capture formats [VIDIOC_ENUM_FMT]\n" diff --git a/utils/v4l2-ctl/v4l2-ctl-misc.cpp b/utils/v4l2-ctl/v4l2-ctl-misc.cpp index 23a0fd38..cb933217 100644 --- a/utils/v4l2-ctl/v4l2-ctl-misc.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-misc.cpp @@ -23,7 +23,7 @@ static struct v4l2_streamparm parm; /* get/set parm */ static double fps = 0; /* set framerate speed, in fps */ static double output_fps = 0; /* set framerate speed, in fps */ -void misc_usage(void) +void misc_usage() { printf("\nMiscellaneous options:\n" " --wait-for-event \n" diff --git a/utils/v4l2-ctl/v4l2-ctl-overlay.cpp b/utils/v4l2-ctl/v4l2-ctl-overlay.cpp index 4c9609d6..16344a15 100644 --- a/utils/v4l2-ctl/v4l2-ctl-overlay.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-overlay.cpp @@ -28,7 +28,7 @@ static const char *fb_device; static std::vector clips; static std::vector bitmap_rects; -void overlay_usage(void) +void overlay_usage() { printf("\nVideo Overlay options:\n" " --list-formats-overlay\n" diff --git a/utils/v4l2-ctl/v4l2-ctl-sdr.cpp b/utils/v4l2-ctl/v4l2-ctl-sdr.cpp index d13f5c76..0b7c4cdc 100644 --- a/utils/v4l2-ctl/v4l2-ctl-sdr.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-sdr.cpp @@ -18,7 +18,7 @@ static struct v4l2_format vfmt; /* set_format/get_format */ -void sdr_usage(void) +void sdr_usage() { printf("\nSDR Formats options:\n" " --list-formats-sdr display supported SDR capture formats [VIDIOC_ENUM_FMT]\n" diff --git a/utils/v4l2-ctl/v4l2-ctl-selection.cpp b/utils/v4l2-ctl/v4l2-ctl-selection.cpp index c35d0536..ac5a1d7b 100644 --- a/utils/v4l2-ctl/v4l2-ctl-selection.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-selection.cpp @@ -44,7 +44,7 @@ static struct v4l2_rect vcrop_out_overlay; /* crop rect */ static struct v4l2_selection vselection; /* capture selection */ static struct v4l2_selection vselection_out; /* output selection */ -void selection_usage(void) +void selection_usage() { printf("\nSelection/Cropping options:\n" " --get-cropcap query the crop capabilities [VIDIOC_CROPCAP]\n" diff --git a/utils/v4l2-ctl/v4l2-ctl-stds.cpp b/utils/v4l2-ctl/v4l2-ctl-stds.cpp index 7ba44ae3..62f57a44 100644 --- a/utils/v4l2-ctl/v4l2-ctl-stds.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-stds.cpp @@ -25,7 +25,7 @@ static unsigned set_dv_timing_opts; static __u32 list_dv_timings_pad; static __u32 dv_timings_cap_pad; -void stds_usage(void) +void stds_usage() { printf("\nStandards/Timings options:\n" " --list-standards display supported video standards [VIDIOC_ENUMSTD]\n" diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index 833263b6..663d0254 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -257,7 +257,7 @@ double fps_timestamps::fps() return fps; }; -void streaming_usage(void) +void streaming_usage() { printf("\nVideo Streaming options:\n" " --stream-count \n" diff --git a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp index 17532d5e..747f1699 100644 --- a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp @@ -49,7 +49,7 @@ static struct v4l2_subdev_frame_interval_enum frmival; static __u32 set_fps_pad; static double set_fps; -void subdev_usage(void) +void subdev_usage() { printf("\nSub-Device options:\n" " --list-subdev-mbus-codes \n" diff --git a/utils/v4l2-ctl/v4l2-ctl-tuner.cpp b/utils/v4l2-ctl/v4l2-ctl-tuner.cpp index 4c291eb3..bc397ec2 100644 --- a/utils/v4l2-ctl/v4l2-ctl-tuner.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-tuner.cpp @@ -26,7 +26,7 @@ static struct v4l2_hw_freq_seek freq_seek; /* freq-seek */ static double low, high; /* freq-seek frequency range */ static int mode = V4L2_TUNER_MODE_STEREO; /* set audio mode */ -void tuner_usage(void) +void tuner_usage() { printf("\nTuner/Modulator options:\n" " -F, --get-freq query the frequency [VIDIOC_G_FREQUENCY]\n" diff --git a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp index 148c9e65..c5960f78 100644 --- a/utils/v4l2-ctl/v4l2-ctl-vbi.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-vbi.cpp @@ -21,7 +21,7 @@ static struct v4l2_format sliced_fmt_out; /* set_format/get_format for sliced VB static struct v4l2_format raw_fmt; /* set_format/get_format for VBI */ static struct v4l2_format raw_fmt_out; /* set_format/get_format for VBI output */ -void vbi_usage(void) +void vbi_usage() { printf("\nVBI Formats options:\n" " --get-sliced-vbi-cap\n" diff --git a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp index a9ef8eed..49c20200 100644 --- a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp @@ -23,7 +23,7 @@ static __u32 width, height, pixfmt, field, flags; static __u32 bytesperline[VIDEO_MAX_PLANES]; static __u32 sizeimage[VIDEO_MAX_PLANES]; -void vidcap_usage(void) +void vidcap_usage() { printf("\nVideo Capture Formats options:\n" " --list-formats display supported video formats [VIDIOC_ENUM_FMT]\n" diff --git a/utils/v4l2-ctl/v4l2-ctl-vidout.cpp b/utils/v4l2-ctl/v4l2-ctl-vidout.cpp index 227d624f..955b2c50 100644 --- a/utils/v4l2-ctl/v4l2-ctl-vidout.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-vidout.cpp @@ -21,7 +21,7 @@ static __u32 width, height, pixfmt, field, colorspace, xfer_func, ycbcr, quantiz static __u32 bytesperline[VIDEO_MAX_PLANES]; static __u32 sizeimage[VIDEO_MAX_PLANES]; -void vidout_usage(void) +void vidout_usage() { printf("\nVideo Output Formats options:\n" " --list-formats-out display supported video output formats [VIDIOC_ENUM_FMT]\n" diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp index c0097203..f6e90f51 100644 --- a/utils/v4l2-ctl/v4l2-ctl.cpp +++ b/utils/v4l2-ctl/v4l2-ctl.cpp @@ -287,7 +287,7 @@ static struct option long_options[] = { {0, 0, 0, 0} }; -static void usage_all(void) +static void usage_all() { common_usage(); tuner_usage(); diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp index dcf8200a..cd387d1d 100644 --- a/utils/v4l2-dbg/v4l2-dbg.cpp +++ b/utils/v4l2-dbg/v4l2-dbg.cpp @@ -162,7 +162,7 @@ static struct option long_options[] = { {0, 0, 0, 0} }; -static void usage(void) +static void usage() { printf("Usage: v4l2-dbg [options] [values]\n" " -D, --info Show driver info [VIDIOC_QUERYCAP]\n"