aboutsummaryrefslogtreecommitdiffstats
path: root/utils/rds-ctl/rds-ctl.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-07-30 13:35:01 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2013-07-30 13:35:01 +0200
commit4523472b2afe5169cba2b4205a6e805557ba687e (patch)
treed1e5c141ab6a1ea617a11c41d5b23d5089cf344f /utils/rds-ctl/rds-ctl.cpp
parent124167abedb32eb1d862bd50e5c14b50bfbfd097 (diff)
rds-ctl: fix coverity issues.
Fixed a number of obvious coding issues found by Coverity. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils/rds-ctl/rds-ctl.cpp')
-rw-r--r--utils/rds-ctl/rds-ctl.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp
index a9fe2a87..3db8de8b 100644
--- a/utils/rds-ctl/rds-ctl.cpp
+++ b/utils/rds-ctl/rds-ctl.cpp
@@ -68,7 +68,6 @@ enum Option {
OptHelp = 'h',
OptReadRds = 'R',
OptGetTuner = 'T',
- OptSetTuner = 't',
OptUseWrapper = 'w',
OptAll = 128,
OptFreqSeek,
@@ -397,8 +396,9 @@ static dev_vec list_devices(void)
continue;
}
/* remove device if it doesn't support rds block I/O */
- if (!vt.capability & V4L2_TUNER_CAP_RDS_BLOCK_IO)
+ if (!(vt.capability & V4L2_TUNER_CAP_RDS_BLOCK_IO))
iter = files.erase(iter);
+ close(fd);
}
return files;
}
@@ -665,7 +665,7 @@ static void print_rds_data(const struct v4l2_rds *handle, uint32_t updated_field
}
if (updated_fields & V4L2_RDS_AF && handle->valid_fields & V4L2_RDS_AF)
print_rds_af(&handle->rds_af);
- if (updated_fields & V4L2_RDS_TMC_TUNING && handle->valid_fields & V4L2_RDS_TMC_TUNING);
+ if (updated_fields & V4L2_RDS_TMC_TUNING && handle->valid_fields & V4L2_RDS_TMC_TUNING)
print_rds_tmc_tuning(handle, updated_fields);
if (params.options[OptPrintBlock])
printf("\n");
@@ -854,7 +854,6 @@ static void print_driver_info(const struct v4l2_capability *vcap)
static void set_options(const int fd, const int capabilities, struct v4l2_frequency *vf,
struct v4l2_tuner *tuner)
{
- int mode = -1; /* set audio mode */
double fac = 16; /* factor for frequency division */
if (params.options[OptSetFreq]) {
@@ -872,18 +871,6 @@ static void set_options(const int fd, const int capabilities, struct v4l2_freque
vf->tuner, vf->frequency, vf->frequency / fac);
}
- if (params.options[OptSetTuner]) {
- struct v4l2_tuner vt;
-
- memset(&vt, 0, sizeof(struct v4l2_tuner));
- vt.index = params.tuner_index;
- if (doioctl(fd, VIDIOC_G_TUNER, &vt) == 0) {
- if (mode != -1)
- vt.audmode = mode;
- doioctl(fd, VIDIOC_S_TUNER, &vt);
- }
- }
-
if (params.options[OptFreqSeek]) {
params.freq_seek.tuner = params.tuner_index;
params.freq_seek.type = V4L2_TUNER_RADIO;

Privacy Policy