Skip to content

Commit

Permalink
Fix nasa#54, Remove unnecessary parentheses around return values.
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Sep 27, 2022
1 parent 952e494 commit dc15cca
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
60 changes: 30 additions & 30 deletions fsw/src/sc_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ int32 SC_AppInit(void)
if (Result != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("Event Services Register returned: 0x%08X\n", (unsigned int)Result);
return (Result);
return Result;
}

/* Must be able to create Software Bus message pipe */
Expand All @@ -183,7 +183,7 @@ int32 SC_AppInit(void)
{
CFE_EVS_SendEvent(SC_INIT_SB_CREATE_ERR_EID, CFE_EVS_EventType_ERROR,
"Software Bus Create Pipe returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Must be able to subscribe to HK request command */
Expand All @@ -192,7 +192,7 @@ int32 SC_AppInit(void)
{
CFE_EVS_SendEvent(SC_INIT_SB_SUBSCRIBE_HK_ERR_EID, CFE_EVS_EventType_ERROR,
"Software Bus subscribe to housekeeping returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Must be able to subscribe to 1Hz wakeup command */
Expand All @@ -201,7 +201,7 @@ int32 SC_AppInit(void)
{
CFE_EVS_SendEvent(SC_INIT_SB_SUBSCRIBE_1HZ_ERR_EID, CFE_EVS_EventType_ERROR,
"Software Bus subscribe to 1 Hz cycle returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Must be able to subscribe to SC commands */
Expand All @@ -210,21 +210,21 @@ int32 SC_AppInit(void)
{
CFE_EVS_SendEvent(SC_INIT_SB_SUBSCRIBE_CMD_ERR_EID, CFE_EVS_EventType_ERROR,
"Software Bus subscribe to command returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Must be able to create and initialize tables */
Result = SC_InitTables();
if (Result != CFE_SUCCESS)
{
return (Result);
return Result;
}

/* Send application startup event */
CFE_EVS_SendEvent(SC_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "SC Initialized. Version %d.%d.%d.%d",
SC_MAJOR_VERSION, SC_MINOR_VERSION, SC_REVISION, SC_MISSION_REV);

return (CFE_SUCCESS);
return CFE_SUCCESS;

} /* end SC_AppInit() */

Expand All @@ -244,14 +244,14 @@ int32 SC_InitTables(void)
Result = SC_RegisterAllTables();
if (Result != CFE_SUCCESS)
{
return (Result);
return Result;
}

/* Must be able to get dump only table pointers */
Result = SC_GetDumpTablePointers();
if (Result != CFE_SUCCESS)
{
return (Result);
return Result;
}

/* ATP control block status table */
Expand Down Expand Up @@ -288,13 +288,13 @@ int32 SC_InitTables(void)
Result = SC_GetLoadTablePointers();
if (Result != CFE_SUCCESS)
{
return (Result);
return Result;
}

/* Register for table update notification commands */
SC_RegisterManageCmds();

return (CFE_SUCCESS);
return CFE_SUCCESS;

} /* end SC_InitTables() */

Expand Down Expand Up @@ -322,7 +322,7 @@ int32 SC_RegisterAllTables(void)
{
CFE_EVS_SendEvent(SC_REGISTER_RTS_INFO_TABLE_ERR_EID, CFE_EVS_EventType_ERROR,
"RTS info table register failed, returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Register dump only RTP control block table */
Expand All @@ -332,7 +332,7 @@ int32 SC_RegisterAllTables(void)
{
CFE_EVS_SendEvent(SC_REGISTER_RTS_CTRL_BLK_TABLE_ERR_EID, CFE_EVS_EventType_ERROR,
"RTS control block table register failed, returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Register dump only ATS information table */
Expand All @@ -342,7 +342,7 @@ int32 SC_RegisterAllTables(void)
{
CFE_EVS_SendEvent(SC_REGISTER_ATS_INFO_TABLE_ERR_EID, CFE_EVS_EventType_ERROR,
"ATS Info table register failed, returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Register dump only ATP control block table */
Expand All @@ -352,7 +352,7 @@ int32 SC_RegisterAllTables(void)
{
CFE_EVS_SendEvent(SC_REGISTER_ATS_CTRL_BLK_TABLE_ERR_EID, CFE_EVS_EventType_ERROR,
"ATS control block table register failed, returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Register dump only ATS command status tables */
Expand All @@ -366,7 +366,7 @@ int32 SC_RegisterAllTables(void)
CFE_EVS_SendEvent(SC_REGISTER_ATS_CMD_STATUS_TABLE_ERR_EID, CFE_EVS_EventType_ERROR,
"ATS command status table register failed for ATS %d, returned: 0x%08X", i + 1,
(unsigned int)Result);
return (Result);
return Result;
}
}

Expand All @@ -382,7 +382,7 @@ int32 SC_RegisterAllTables(void)
CFE_EVS_SendEvent(SC_REGISTER_RTS_TBL_ERR_EID, CFE_EVS_EventType_ERROR,
"RTS Table Registration Failed for RTS %d, returned: 0x%08X", i + 1,
(unsigned int)Result);
return (Result);
return Result;
}
}

Expand All @@ -398,7 +398,7 @@ int32 SC_RegisterAllTables(void)
CFE_EVS_SendEvent(SC_REGISTER_ATS_TBL_ERR_EID, CFE_EVS_EventType_ERROR,
"ATS Table Registration Failed for ATS %d, returned: 0x%08X", i + 1,
(unsigned int)Result);
return (Result);
return Result;
}
}

Expand All @@ -411,10 +411,10 @@ int32 SC_RegisterAllTables(void)
{
CFE_EVS_SendEvent(SC_REGISTER_APPEND_TBL_ERR_EID, CFE_EVS_EventType_ERROR,
"Append ATS Table Registration Failed, returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

return (CFE_SUCCESS);
return CFE_SUCCESS;

} /* end SC_RegisterAllTables() */

Expand All @@ -435,7 +435,7 @@ int32 SC_GetDumpTablePointers(void)
{
CFE_EVS_SendEvent(SC_GET_ADDRESS_RTS_INFO_ERR_EID, CFE_EVS_EventType_ERROR,
"RTS Info table failed Getting Address, returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Get buffer address for dump only RTP control block table */
Expand All @@ -444,7 +444,7 @@ int32 SC_GetDumpTablePointers(void)
{
CFE_EVS_SendEvent(SC_GET_ADDRESS_RTS_CTRL_BLCK_ERR_EID, CFE_EVS_EventType_ERROR,
"RTS Ctrl Blck table failed Getting Address, returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Get buffer address for dump only ATS information table */
Expand All @@ -453,7 +453,7 @@ int32 SC_GetDumpTablePointers(void)
{
CFE_EVS_SendEvent(SC_GET_ADDRESS_ATS_INFO_ERR_EID, CFE_EVS_EventType_ERROR,
"ATS Info table failed Getting Address, returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Get buffer address for dump only ATP control block table */
Expand All @@ -462,7 +462,7 @@ int32 SC_GetDumpTablePointers(void)
{
CFE_EVS_SendEvent(SC_GET_ADDRESS_ATS_CTRL_BLCK_ERR_EID, CFE_EVS_EventType_ERROR,
"ATS Ctrl Blck table failed Getting Address, returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Get buffer address for dump only ATS command status tables */
Expand All @@ -474,11 +474,11 @@ int32 SC_GetDumpTablePointers(void)
CFE_EVS_SendEvent(SC_GET_ADDRESS_ATS_CMD_STAT_ERR_EID, CFE_EVS_EventType_ERROR,
"ATS Cmd Status table for ATS %d failed Getting Address, returned: 0x%08X", i + 1,
(unsigned int)Result);
return (Result);
return Result;
}
}

return (CFE_SUCCESS);
return CFE_SUCCESS;

} /* end SC_GetDumpTablePointers() */

Expand All @@ -502,7 +502,7 @@ int32 SC_GetLoadTablePointers(void)
{
CFE_EVS_SendEvent(SC_GET_ADDRESS_ATS_ERR_EID, CFE_EVS_EventType_ERROR,
"ATS table %d failed Getting Address, returned: 0x%08X", i + 1, (unsigned int)Result);
return (Result);
return Result;
}
}

Expand All @@ -513,7 +513,7 @@ int32 SC_GetLoadTablePointers(void)
{
CFE_EVS_SendEvent(SC_GET_ADDRESS_APPEND_ERR_EID, CFE_EVS_EventType_ERROR,
"Append ATS table failed Getting Address, returned: 0x%08X", (unsigned int)Result);
return (Result);
return Result;
}

/* Get buffer address for loadable RTS tables */
Expand All @@ -525,7 +525,7 @@ int32 SC_GetLoadTablePointers(void)
{
CFE_EVS_SendEvent(SC_GET_ADDRESS_RTS_ERR_EID, CFE_EVS_EventType_ERROR,
"RTS table %d failed Getting Address, returned: 0x%08X", i + 1, (unsigned int)Result);
return (Result);
return Result;
}

/* Process new RTS table data */
Expand All @@ -535,7 +535,7 @@ int32 SC_GetLoadTablePointers(void)
}
}

return (CFE_SUCCESS);
return CFE_SUCCESS;

} /* end SC_GetLoadTablePointers() */

Expand Down
4 changes: 2 additions & 2 deletions fsw/src/sc_atsrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ bool SC_BeginAts(uint16 AtsIndex, uint16 TimeOffset)

} /* end if */

return (ReturnCode);
return ReturnCode;

} /* end SC_BeginAts */

Expand Down Expand Up @@ -496,7 +496,7 @@ bool SC_InlineSwitch(void)
/* clear out the global ground-switch pend flag */
SC_OperData.AtsCtrlBlckAddr->SwitchPendFlag = false;

return (ReturnCode);
return ReturnCode;

} /* end function */

Expand Down
12 changes: 6 additions & 6 deletions fsw/src/sc_loads.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ int32 SC_ValidateAts(void *TableData)
/* Common ATS table verify function needs size of this table */
Result = SC_VerifyAtsTable((uint32 *)TableData, SC_ATS_BUFF_SIZE32);

return (Result);
return Result;

} /* end SC_ValidateAts */

Expand Down Expand Up @@ -487,7 +487,7 @@ bool SC_ParseRts(uint32 Buffer32[])
*/

/* If Error was true , then SC_ParseRts must return false */
return (!Error);
return !Error;

} /* end SC_ParseRts */

Expand All @@ -514,7 +514,7 @@ int32 SC_ValidateRts(void *TableData)
Result = SC_ERROR;
}

return (Result);
return Result;

} /* end SC_ValidateRts */

Expand All @@ -530,7 +530,7 @@ int32 SC_ValidateAppend(void *TableData)
/* Common ATS table verify function needs size of this table */
Result = SC_VerifyAtsTable((uint32 *)TableData, SC_APPEND_BUFF_SIZE32);

return (Result);
return Result;

} /* end SC_ValidateAppend */

Expand Down Expand Up @@ -746,7 +746,7 @@ int32 SC_VerifyAtsTable(uint32 *Buffer32, int32 BufferWords)
}
}

return (Result);
return Result;

} /* end SC_VerifyAtsTable */

Expand Down Expand Up @@ -855,7 +855,7 @@ int32 SC_VerifyAtsEntry(uint32 *Buffer32, int32 EntryIndex, int32 BufferWords)
}
}

return (Result);
return Result;

} /* End of SC_VerifyAtsEntry */

Expand Down
4 changes: 2 additions & 2 deletions fsw/src/sc_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ SC_AbsTimeTag_t SC_ComputeAbsTime(SC_RelTimeTag_t RelTime)
ResultTimeWSubs = CFE_TIME_Add(AbsoluteTimeWSubs, RelTimeWSubs);

/* We don't need subseconds */
return (ResultTimeWSubs.Seconds);
return ResultTimeWSubs.Seconds;

} /* end of SC_ComputeAbsTime */

Expand Down Expand Up @@ -176,7 +176,7 @@ bool SC_VerifyCmdLength(const CFE_MSG_Message_t *Msg, size_t ExpectedLength)
SC_OperData.HkPacket.CmdErrCtr++;
}
}
return (Result);
return Result;
} /* End of SC_VerifyCmdLength */

uint16 SC_ToggleAtsIndex(void)
Expand Down

0 comments on commit dc15cca

Please sign in to comment.