diff --git a/src/drivers/device/vdev.cpp b/src/drivers/device/vdev.cpp index 37c4234ab8..5f3ba95fd3 100644 --- a/src/drivers/device/vdev.cpp +++ b/src/drivers/device/vdev.cpp @@ -435,10 +435,11 @@ VDev::poll_notify(pollevent_t events) /* lock against poll() as well as other wakeups */ lock(); - for (unsigned i = 0; i < _max_pollwaiters; i++) + for (unsigned i = 0; i < _max_pollwaiters; i++) { if (nullptr != _pollset[i]) { poll_notify_one(_pollset[i], events); } + } unlock(); } @@ -621,20 +622,22 @@ void VDev::showFiles() const char *VDev::topicList(unsigned int *next) { - for (; *next < PX4_MAX_DEV; (*next)++) + for (; *next < PX4_MAX_DEV; (*next)++) { if (devmap[*next] && strncmp(devmap[(*next)]->name, "/obj/", 5) == 0) { return devmap[(*next)++]->name; } + } return NULL; } const char *VDev::devList(unsigned int *next) { - for (; *next < PX4_MAX_DEV; (*next)++) + for (; *next < PX4_MAX_DEV; (*next)++) { if (devmap[*next] && strncmp(devmap[(*next)]->name, "/dev/", 5) == 0) { return devmap[(*next)++]->name; } + } return NULL; } diff --git a/src/drivers/pwm_out_sim/pwm_out_sim.cpp b/src/drivers/pwm_out_sim/pwm_out_sim.cpp index 6b01d09110..b16b18070f 100644 --- a/src/drivers/pwm_out_sim/pwm_out_sim.cpp +++ b/src/drivers/pwm_out_sim/pwm_out_sim.cpp @@ -793,9 +793,10 @@ PWMSim::pwm_ioctl(device::file_t *filp, int cmd, unsigned long arg) ret = -EINVAL; } else { - if (_mixers == nullptr) + if (_mixers == nullptr) { _mixers = new MixerGroup(control_callback, (uintptr_t)&_controls); + } _mixers->add_mixer(mixer); _mixers->groups_required(_groups_required); diff --git a/src/modules/dataman/dataman.c b/src/modules/dataman/dataman.c index 29a6de791a..c998a41482 100644 --- a/src/modules/dataman/dataman.c +++ b/src/modules/dataman/dataman.c @@ -453,10 +453,11 @@ _file_write(dm_item_t item, unsigned char index, dm_persitence_t persistence, co len = -1; /* Seek to the right spot in the data manager file and write the data item */ - if (lseek(g_task_fd, offset, SEEK_SET) == offset) + if (lseek(g_task_fd, offset, SEEK_SET) == offset) { if ((len = write(g_task_fd, buffer, count)) == count) { fsync(g_task_fd); /* Make sure data is written to physical media */ } + } /* Make sure the write succeeded */ if (len != count) {