Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #467, Simplify CF_CFDP_ProcessPollingDirectories() #468

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions fsw/src/cf_cfdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1479,21 +1479,19 @@
*-----------------------------------------------------------------*/
void CF_CFDP_ProcessPollingDirectories(CF_Channel_t *chan)
{
CF_Poll_t * poll;
CF_Poll_t *poll;
CF_ChannelConfig_t *cc;
CF_PollDir_t * pd;
CF_PollDir_t *pd;
int i;
int chan_index;
int count_check;
int ret;

chan_index = (chan - CF_AppData.engine.channels);
cc = &CF_AppData.config_table->chan[chan_index];

for (i = 0; i < CF_MAX_POLLING_DIR_PER_CHAN; ++i)
{
poll = &chan->poll[i];
chan_index = (chan - CF_AppData.engine.channels);
cc = &CF_AppData.config_table->chan[chan_index];
pd = &cc->polldir[i];
count_check = 0;
poll = &chan->poll[i];
pd = &cc->polldir[i];

if (pd->enabled)
{
Expand All @@ -1508,9 +1506,8 @@
else if (CF_Timer_Expired(&poll->interval_timer))
{
/* the timer has expired */
ret = CF_CFDP_PlaybackDir_Initiate(&poll->pb, pd->src_dir, pd->dst_dir, pd->cfdp_class, 0,
chan_index, pd->priority, pd->dest_eid);
if (!ret)
if (!CF_CFDP_PlaybackDir_Initiate(&poll->pb, pd->src_dir, pd->dst_dir, pd->cfdp_class, 0,
chan_index, pd->priority, pd->dest_eid))
Comment on lines +1509 to +1510

Check warning

Code scanning / CodeQL

Side effect in a Boolean expression Warning

This Boolean expression is not side-effect free.
{
poll->timer_set = 0;
}
Expand All @@ -1532,11 +1529,9 @@
/* playback is active, so step it */
CF_CFDP_ProcessPlaybackDirectory(chan, &poll->pb);
}

count_check = 1;
}

CF_CFDP_UpdatePollPbCounted(&poll->pb, count_check, &CF_AppData.hk.Payload.channel_hk[chan_index].poll_counter);
CF_CFDP_UpdatePollPbCounted(&poll->pb, pd->enabled, &CF_AppData.hk.Payload.channel_hk[chan_index].poll_counter);
}
}

Expand Down Expand Up @@ -1902,4 +1897,4 @@
{
OS_remove(src);
}
}
}
Loading