From 9dd3d63cc06ac027f375bafe172ccfed8b5c3253 Mon Sep 17 00:00:00 2001 From: Avi Date: Sun, 12 Mar 2023 15:15:53 +1000 Subject: [PATCH] Fix #54, Remove unnecessary parentheses around return values --- README.md | 2 +- fsw/inc/sc_platform_cfg.h | 2 +- fsw/src/sc_app.c | 54 +++++++++++++++++++-------------------- fsw/src/sc_atsrq.c | 4 +-- fsw/src/sc_loads.c | 12 ++++----- fsw/src/sc_rtsrq.c | 2 +- fsw/src/sc_utils.c | 4 +-- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index b77f53c..6fccd16 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ predetermined times. SC supports both Absolute Time tagged command Sequences (ATSs) and multiple Relative Time tagged command Sequences (RTSs). The purpose of ATS commands is to be able to specify commands to be executed at a specific time. The purpose of Relative Time Sequence commands is to be able -to specify commands to be executed at a relative times. +to specify commands to be executed at a relative time. The SC application is written in C and depends on the cFS Operating System Abstraction Layer (OSAL) and cFE components. There is additional SC application diff --git a/fsw/inc/sc_platform_cfg.h b/fsw/inc/sc_platform_cfg.h index 42a5927..d014e8a 100644 --- a/fsw/inc/sc_platform_cfg.h +++ b/fsw/inc/sc_platform_cfg.h @@ -52,7 +52,7 @@ * The number of RTS's allowed in the system * * \par Limits: - * This parameter can't be larger than 999.This parameter will dicate the size of + * This parameter can't be larger than 999.This parameter will dictate the size of * The RTS Info Table. */ #define SC_NUMBER_OF_RTS 64 diff --git a/fsw/src/sc_app.c b/fsw/src/sc_app.c index c92d9db..1bb2745 100644 --- a/fsw/src/sc_app.c +++ b/fsw/src/sc_app.c @@ -173,7 +173,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 */ @@ -182,7 +182,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 */ @@ -191,7 +191,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 */ @@ -200,7 +200,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 */ @@ -209,21 +209,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; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -242,14 +242,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 */ @@ -286,13 +286,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; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -308,16 +308,16 @@ int32 SC_RegisterAllTables(void) Result = SC_RegisterDumpOnlyTables(); if (Result != CFE_SUCCESS) { - return (Result); + return Result; } Result = SC_RegisterLoadableTables(); if (Result != CFE_SUCCESS) { - return (Result); + return Result; } - return (CFE_SUCCESS); + return CFE_SUCCESS; } int32 SC_RegisterDumpOnlyTables(void) @@ -345,7 +345,7 @@ int32 SC_RegisterDumpOnlyTables(void) { CFE_EVS_SendEvent(EventID[i], CFE_EVS_EventType_ERROR, "%s table register failed, returned: 0x%08X", Spec[i], (unsigned int)Result); - return (Result); + return Result; } } @@ -361,11 +361,11 @@ int32 SC_RegisterDumpOnlyTables(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; } } - return (CFE_SUCCESS); + return CFE_SUCCESS; } int32 SC_RegisterLoadableTables(void) @@ -397,7 +397,7 @@ int32 SC_RegisterLoadableTables(void) CFE_EVS_SendEvent(EventID[i], CFE_EVS_EventType_ERROR, "Table Registration Failed for %s %d, returned: 0x%08X", Spec[i], j + 1, (unsigned int)Result); - return (Result); + return Result; } } } @@ -409,10 +409,10 @@ int32 SC_RegisterLoadableTables(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; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -440,7 +440,7 @@ int32 SC_GetDumpTablePointers(void) { CFE_EVS_SendEvent(EventID[i], CFE_EVS_EventType_ERROR, "Table failed Getting Address, returned: 0x%08X", (unsigned int)Result); - return (Result); + return Result; } } @@ -453,11 +453,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; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -480,7 +480,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; } } @@ -491,7 +491,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 */ @@ -503,7 +503,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 */ @@ -513,7 +513,7 @@ int32 SC_GetLoadTablePointers(void) } } - return (CFE_SUCCESS); + return CFE_SUCCESS; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/fsw/src/sc_atsrq.c b/fsw/src/sc_atsrq.c index efbbf2a..7b033c5 100644 --- a/fsw/src/sc_atsrq.c +++ b/fsw/src/sc_atsrq.c @@ -268,7 +268,7 @@ bool SC_BeginAts(uint16 AtsIndex, uint16 TimeOffset) } /* end if */ - return (ReturnCode); + return ReturnCode; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -483,7 +483,7 @@ bool SC_InlineSwitch(void) /* clear out the global ground-switch pend flag */ SC_OperData.AtsCtrlBlckAddr->SwitchPendFlag = false; - return (ReturnCode); + return ReturnCode; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/fsw/src/sc_loads.c b/fsw/src/sc_loads.c index f17baa0..a968053 100644 --- a/fsw/src/sc_loads.c +++ b/fsw/src/sc_loads.c @@ -370,7 +370,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; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -480,7 +480,7 @@ bool SC_ParseRts(uint32 Buffer32[]) */ /* If Error was true , then SC_ParseRts must return false */ - return (!Error); + return !Error; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -505,7 +505,7 @@ int32 SC_ValidateRts(void *TableData) Result = SC_ERROR; } - return (Result); + return Result; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -520,7 +520,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; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -730,7 +730,7 @@ int32 SC_VerifyAtsTable(uint32 *Buffer32, int32 BufferWords) } } - return (Result); + return Result; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -838,5 +838,5 @@ int32 SC_VerifyAtsEntry(uint32 *Buffer32, int32 EntryIndex, int32 BufferWords) } } - return (Result); + return Result; } diff --git a/fsw/src/sc_rtsrq.c b/fsw/src/sc_rtsrq.c index 83a8a43..1f16934 100644 --- a/fsw/src/sc_rtsrq.c +++ b/fsw/src/sc_rtsrq.c @@ -578,7 +578,7 @@ void SC_KillRts(uint16 RtsIndex) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ -/* Start an RTS on initilization */ +/* Start an RTS on Initialization */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ void SC_AutoStartRts(uint16 RtsNumber) diff --git a/fsw/src/sc_utils.c b/fsw/src/sc_utils.c index 1984fc7..ca52568 100644 --- a/fsw/src/sc_utils.c +++ b/fsw/src/sc_utils.c @@ -107,7 +107,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; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -172,7 +172,7 @@ bool SC_VerifyCmdLength(const CFE_MSG_Message_t *Msg, size_t ExpectedLength) SC_OperData.HkPacket.CmdErrCtr++; } } - return (Result); + return Result; } uint16 SC_ToggleAtsIndex(void)