diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/cec-compliance/cec-test-audio.cpp | 8 | ||||
-rw-r--r-- | utils/cec-compliance/cec-test-power.cpp | 8 | ||||
-rw-r--r-- | utils/cec-compliance/cec-test.cpp | 31 | ||||
-rw-r--r-- | utils/cec-follower/cec-follower.cpp | 2 | ||||
-rw-r--r-- | utils/cec-follower/cec-processing.cpp | 4 | ||||
-rw-r--r-- | utils/common/keymap.c | 4 | ||||
-rw-r--r-- | utils/common/toml.c | 6 | ||||
-rw-r--r-- | utils/common/v4l-stream.c | 3 | ||||
-rw-r--r-- | utils/ir-ctl/ir-ctl.c | 3 | ||||
-rw-r--r-- | utils/keytable/bpf_load.c | 8 | ||||
-rw-r--r-- | utils/libmedia_dev/get_media_devices.c | 3 | ||||
-rw-r--r-- | utils/libv4l2util/v4l2_driver.c | 3 | ||||
-rw-r--r-- | utils/rds-ctl/rds-ctl.cpp | 3 | ||||
-rw-r--r-- | utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 6 | ||||
-rw-r--r-- | utils/v4l2-dbg/v4l2-dbg.cpp | 3 |
15 files changed, 50 insertions, 45 deletions
diff --git a/utils/cec-compliance/cec-test-audio.cpp b/utils/cec-compliance/cec-test-audio.cpp index af472bf4..576d59c6 100644 --- a/utils/cec-compliance/cec-test-audio.cpp +++ b/utils/cec-compliance/cec-test-audio.cpp @@ -224,11 +224,11 @@ static int arc_initiate_rx(struct node *node, unsigned me, unsigned la, bool int announce("The device supports ARC but is not ready to initiate."); return 0; } - else { - warn("Device responded Feature Abort with unexpected abort reason. Assuming no ARC support.\n"); - unsupported = true; - } + + warn("Device responded Feature Abort with unexpected abort reason. Assuming no ARC support.\n"); + unsupported = true; } + if (unsupported) { fail_on_test_v2(node->remote[la].cec_version, node->remote[la].source_has_arc_rx); return OK_NOT_SUPPORTED; diff --git a/utils/cec-compliance/cec-test-power.cpp b/utils/cec-compliance/cec-test-power.cpp index 90a62ddc..2758c36d 100644 --- a/utils/cec-compliance/cec-test-power.cpp +++ b/utils/cec-compliance/cec-test-power.cpp @@ -166,8 +166,8 @@ static int one_touch_play_view_on_wakeup(struct node *node, unsigned me, unsigne if (interactive) return 0; - else - return OK_PRESUMED; + + return OK_PRESUMED; } static int one_touch_play_image_view_on_wakeup(struct node *node, unsigned me, unsigned la, bool interactive) @@ -203,8 +203,8 @@ static int one_touch_play_view_on_change(struct node *node, unsigned me, unsigne if (interactive) return 0; - else - return OK_PRESUMED; + + return OK_PRESUMED; } static int one_touch_play_image_view_on_change(struct node *node, unsigned me, unsigned la, bool interactive) diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp index 16e81bdb..0ac43afe 100644 --- a/utils/cec-compliance/cec-test.cpp +++ b/utils/cec-compliance/cec-test.cpp @@ -352,9 +352,9 @@ static int osd_string_set_default(struct node *node, unsigned me, unsigned la, b (node->remote[la].dev_features & CEC_OP_FEAT_DEV_HAS_SET_OSD_STRING)); if (unrecognized_op(&msg)) return OK_NOT_SUPPORTED; - else if (refused(&msg)) + if (refused(&msg)) return OK_REFUSED; - else if (cec_msg_status_is_abort(&msg)) { + if (cec_msg_status_is_abort(&msg)) { warn("The device is in an unsuitable state or cannot display the complete message.\n"); unsuitable = true; } @@ -402,8 +402,8 @@ static int osd_string_set_until_clear(struct node *node, unsigned me, unsigned l if (interactive) return 0; - else - return OK_PRESUMED; + + return OK_PRESUMED; } static int osd_string_invalid(struct node *node, unsigned me, unsigned la, bool interactive) @@ -480,8 +480,8 @@ static int routing_control_active_source(struct node *node, unsigned me, unsigne if (interactive) return 0; - else - return OK_PRESUMED; + + return OK_PRESUMED; } static int routing_control_req_active_source(struct node *node, unsigned me, unsigned la, bool interactive) @@ -529,9 +529,8 @@ static int routing_control_set_stream_path(struct node *node, unsigned me, unsig if (interactive || node->remote[la].cec_version >= CEC_OP_CEC_VERSION_2_0) return 0; - else - return OK_PRESUMED; - return 0; + + return OK_PRESUMED; } static struct remote_subtest routing_control_subtests[] = { @@ -900,10 +899,10 @@ static int tuner_ctl_test(struct node *node, unsigned me, unsigned la, bool inte if (abort_reason(&msg) == CEC_OP_ABORT_REFUSED) { warn("Tuner step increment does not wrap.\n"); break; - } else { - warn("Tuner at end of service list did not receive feature abort refused.\n"); - break; } + + warn("Tuner at end of service list did not receive feature abort refused.\n"); + break; } cec_msg_init(&msg, me, la); cec_msg_give_tuner_device_status(&msg, true, CEC_OP_STATUS_REQ_ONCE); @@ -1050,8 +1049,8 @@ static int one_touch_rec_off(struct node *node, unsigned me, unsigned la, bool i return OK_PRESUMED; if (timed_out(&msg)) return OK_PRESUMED; - else - return 0; + + return 0; } static int one_touch_rec_status(struct node *node, unsigned me, unsigned la, bool interactive) @@ -1332,8 +1331,8 @@ static int cdc_hec_discover(struct node *node, unsigned me, unsigned la, bool pr if (msg.msg[1] == CEC_MSG_FEATURE_ABORT) { if (from == la) return fail("Device replied Feature Abort to broadcast message\n"); - else - warn("Device %d replied Feature Abort to broadcast message\n", cec_msg_initiator(&msg)); + + warn("Device %d replied Feature Abort to broadcast message\n", cec_msg_initiator(&msg)); } if (msg.msg[1] != CEC_MSG_CDC_MESSAGE) continue; diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp index c9cd18d1..6ccd2ae2 100644 --- a/utils/cec-follower/cec-follower.cpp +++ b/utils/cec-follower/cec-follower.cpp @@ -227,7 +227,7 @@ std::string audio_format_id_code2s(__u8 audio_format_id, __u8 audio_format_code) { if (audio_format_id == 0) return audio_format_code2s(audio_format_code); - else if (audio_format_id == 1) + if (audio_format_id == 1) return extension_type_code2s(audio_format_code); return "Invalid"; } diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp index 373519fc..511b3ba7 100644 --- a/utils/cec-follower/cec-processing.cpp +++ b/utils/cec-follower/cec-processing.cpp @@ -692,8 +692,8 @@ static void processMsg(struct node *node, struct cec_msg &msg, unsigned me) signalize that we support SAC. */ if (cec_has_tv(1 << me)) return; - else - break; + + break; } cec_ops_set_system_audio_mode(&msg, &system_audio_status); if (system_audio_status == CEC_OP_SYS_AUD_STATUS_ON) diff --git a/utils/common/keymap.c b/utils/common/keymap.c index fa8f256f..47d36152 100644 --- a/utils/common/keymap.c +++ b/utils/common/keymap.c @@ -527,8 +527,8 @@ error_t parse_keymap(char *fname, struct keymap **keymap, bool verbose) if (len >= 5 && strcasecmp(fname + len - 5, ".toml") == 0) return parse_toml_keymap(fname, keymap, verbose); - else - return parse_plain_keymap(fname, keymap, verbose); + + return parse_plain_keymap(fname, keymap, verbose); } int keymap_param(struct keymap *map, const char *name, int fallback) diff --git a/utils/common/toml.c b/utils/common/toml.c index 2a9f3dac..68cebef9 100644 --- a/utils/common/toml.c +++ b/utils/common/toml.c @@ -1697,7 +1697,8 @@ int toml_rtots(const char* src_, toml_timestamp_t* ret) for (i = 0; i < 10; i++, p++) { int xx = *p; if (xx == '-') { - if (i == 4 || i == 7) continue; else return -1; + if (i == 4 || i == 7) continue; + return -1; } if (! ('0' <= xx && xx <= '9')) return -1; val = val * 10 + (xx - '0'); @@ -1724,7 +1725,8 @@ int toml_rtots(const char* src_, toml_timestamp_t* ret) for (i = 0; i < 8; i++, p++) { int xx = *p; if (xx == ':') { - if (i == 2 || i == 5) continue; else return -1; + if (i == 2 || i == 5) continue; + return -1; } if (! ('0' <= xx && xx <= '9')) return -1; val = val * 10 + (xx - '0'); diff --git a/utils/common/v4l-stream.c b/utils/common/v4l-stream.c index c2f2abce..44ee137e 100644 --- a/utils/common/v4l-stream.c +++ b/utils/common/v4l-stream.c @@ -88,7 +88,8 @@ void rle_decompress(__u8 *b, unsigned size, unsigned rle_size, unsigned bpl) i += 4; next_line = dst + bpl / 4; continue; - } else if (v == magic_x) { + } + if (v == magic_x) { v = *++p; n = ntohl(*++p); i += 8; diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c index ef399808..ba454619 100644 --- a/utils/ir-ctl/ir-ctl.c +++ b/utils/ir-ctl/ir-ctl.c @@ -1159,9 +1159,8 @@ int lirc_receive(struct arguments *args, int fd, unsigned features) // is meaningless, maybe fix the kernel? if (leading_space && msg == LIRC_MODE2_SPACE) continue; - else - leading_space = false; + leading_space = false; if (args->oneshot && (msg == LIRC_MODE2_TIMEOUT || (msg == LIRC_MODE2_SPACE && val > 19000))) { diff --git a/utils/keytable/bpf_load.c b/utils/keytable/bpf_load.c index 818dedef..9f64cf4e 100644 --- a/utils/keytable/bpf_load.c +++ b/utils/keytable/bpf_load.c @@ -266,7 +266,7 @@ static int parse_relo_and_apply(struct bpf_file *bpf_file, GElf_Shdr *shdr, insn_idx); return 1; } - else if (sym.st_shndx == bpf_file->dataidx || sym.st_shndx == bpf_file->bssidx) { + if (sym.st_shndx == bpf_file->dataidx || sym.st_shndx == bpf_file->bssidx) { const char *raw = NULL; int value = 0; @@ -310,10 +310,10 @@ static int cmp_symbols(const void *l, const void *r) if (lsym->st_value < rsym->st_value) return -1; - else if (lsym->st_value > rsym->st_value) + if (lsym->st_value > rsym->st_value) return 1; - else - return 0; + + return 0; } static int load_elf_maps_section(struct bpf_file *bpf_file) diff --git a/utils/libmedia_dev/get_media_devices.c b/utils/libmedia_dev/get_media_devices.c index be2532d5..491a94da 100644 --- a/utils/libmedia_dev/get_media_devices.c +++ b/utils/libmedia_dev/get_media_devices.c @@ -240,7 +240,8 @@ static int add_snd_class(struct media_device_entry *md) if (strstr(md->node, "timer")) { md->type = MEDIA_SND_TIMER; return 0; - } else if (strstr(md->node, "seq")) { + } + if (strstr(md->node, "seq")) { md->type = MEDIA_SND_SEQ; return 0; } if (strstr(md->node, "card")) { diff --git a/utils/libv4l2util/v4l2_driver.c b/utils/libv4l2util/v4l2_driver.c index 67982047..e21e85d8 100644 --- a/utils/libv4l2util/v4l2_driver.c +++ b/utils/libv4l2util/v4l2_driver.c @@ -436,7 +436,8 @@ int v4l2_gettryset_fmt_cap (struct v4l2_driver *drv, enum v4l2_direction dir, perror("VIDIOC_G_FMT failed\n"); } return ret; - } else if (dir & (~(V4L2_TRY|V4L2_SET)) ) { + } + if (dir & (~(V4L2_TRY | V4L2_SET)) ) { perror ("Invalid direction\n"); return EINVAL; } diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp index f6b34a7a..93e314c2 100644 --- a/utils/rds-ctl/rds-ctl.cpp +++ b/utils/rds-ctl/rds-ctl.cpp @@ -691,7 +691,8 @@ static void read_rds(struct v4l2_rds *handle, const int fd, const int wait_limit if (byte_cnt == 0) { printf("\nEnd of input file reached \n"); break; - } else if(++error_cnt > 2) { + } + if (++error_cnt > 2) { fprintf(stderr, "\nError reading from " "device (no RDS data available)\n"); break; diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index 00affd1a..d9a307f9 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -2490,7 +2490,8 @@ static void stateless_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out, if (rc == 0) { fprintf(stderr, "Timeout when waiting for media request\n"); return; - } else if (rc < 0) { + } + if (rc < 0) { fprintf(stderr, "Unable to select media request: %s\n", strerror(errno)); return; @@ -2654,7 +2655,8 @@ static void streaming_set_cap2out(cv4l_fd &fd, cv4l_fd &out_fd) V4L2_CAP_VIDEO_M2M_MPLANE))) { fprintf(stderr, "unsupported capture stream type\n"); return; - } else if (!(out_capabilities & (V4L2_CAP_VIDEO_OUTPUT | + } + if (!(out_capabilities & (V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_VIDEO_OUTPUT_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_CAP_VIDEO_M2M_MPLANE))) { diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp index 41f94fff..8fb70775 100644 --- a/utils/v4l2-dbg/v4l2-dbg.cpp +++ b/utils/v4l2-dbg/v4l2-dbg.cpp @@ -287,9 +287,8 @@ static void print_regs(int fd, struct v4l2_dbg_register *reg, unsigned long min, if (ioctl(fd, VIDIOC_DBG_G_REGISTER, reg) < 0) { perror("ioctl: VIDIOC_DBG_G_REGISTER failed\n"); break; - } else { - printf("%0*llx ", 2 * stride, reg->val); } + printf("%0*llx ", 2 * stride, reg->val); usleep(1); } printf("\n"); |