Skip to content

Commit

Permalink
Reducing slave variable scope
Browse files Browse the repository at this point in the history
  • Loading branch information
preston-rogers committed Oct 17, 2024
1 parent 4c77785 commit 2870e66
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/jsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ bool jsd_init(jsd_t* self, const char* ifname, uint8_t enable_autorecovery, int
WARNING("Failed OP transition attempt %d of %d", attempt,
JSD_PO2OP_MAX_ATTEMPTS);

WARNING("Performing inspect context in jsd init.");
jsd_inspect_context(self);

if (attempt >= JSD_PO2OP_MAX_ATTEMPTS) {
Expand Down Expand Up @@ -248,11 +247,10 @@ bool jsd_init(jsd_t* self, const char* ifname, uint8_t enable_autorecovery, int
}

bool jsd_all_slaves_operational(jsd_t* self) {
int slave;
bool all_slaves_operational = true;
uint8_t currentgroup = 0; // only 1 rate group in JSD currently
/* one or more slaves may not be responding */
for (slave = 1; slave <= *self->ecx_context.slavecount; slave++) {
for (int slave = 1; slave <= *self->ecx_context.slavecount; slave++) {
if (self->ecx_context.slavelist[slave].group != currentgroup) continue;
/* re-check bad slave individually */
ecx_statecheck(&self->ecx_context, slave, EC_STATE_OPERATIONAL, EC_TIMEOUTRET);
Expand Down

0 comments on commit 2870e66

Please sign in to comment.