Skip to content

Commit 93990ef

Browse files
committed
Update nasa#158, Minor fixes for cppcheck issues
1 parent fe5e019 commit 93990ef

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

fsw/pc-linux/src/cfe_psp_start.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ void OS_Application_Startup(void)
251251
*/
252252
CFE_PSP_SpacecraftId = CommandData.SpacecraftId;
253253
CFE_PSP_CpuId = CommandData.CpuId;
254-
strncpy(CFE_PSP_CpuName, CommandData.CpuName, CFE_PSP_CPU_NAME_LENGTH);
254+
strncpy(CFE_PSP_CpuName, CommandData.CpuName, sizeof(CFE_PSP_CpuName)-1);
255+
CFE_PSP_CpuName[sizeof(CFE_PSP_CpuName)-1] = 0;
255256

256257
/*
257258
** Set the reset subtype

fsw/pc-rtems/src/cfe_psp_memory.c

+7
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,13 @@ void CFE_PSP_SetupReservedMemoryMap(void)
420420
CFE_PSP_ReservedMemoryMap.UserReservedMemory.BlockSize = CFE_PSP_USER_RESERVED_SIZE;
421421
ReservedMemoryAddr += UserReservedSize;
422422

423+
/*
424+
* displaying the final address shows how much was actually used,
425+
* and additionally avoids a warning about the result of the final increment not being used.
426+
* (prefer this over removing the increment, as it is safer if another block is added)
427+
*/
428+
OS_printf("CFE_PSP: PSP reserved memory ends at: 0x%08lX\n",
429+
(unsigned long)ReservedMemoryAddr);
423430
}
424431

425432
/******************************************************************************

fsw/pc-rtems/src/cfe_psp_support.c

+1-11
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,7 @@ extern CFE_PSP_MemoryBlock_t PcRtems_ReservedMemBlock;
8787
void CFE_PSP_Restart(uint32 reset_type)
8888
{
8989

90-
if ( reset_type == CFE_PSP_RST_TYPE_POWERON )
91-
{
92-
CFE_PSP_FlushCaches(1, PcRtems_ReservedMemBlock.BlockPtr, PcRtems_ReservedMemBlock.BlockSize);
93-
/* reboot(BOOT_CLEAR); Need RTEMS equiv. */
94-
}
95-
else
96-
{
97-
CFE_PSP_FlushCaches(1, PcRtems_ReservedMemBlock.BlockPtr, PcRtems_ReservedMemBlock.BlockSize);
98-
/* reboot(BOOT_NORMAL); Need RTEMS Equiv */
99-
}
100-
90+
CFE_PSP_FlushCaches(1, PcRtems_ReservedMemBlock.BlockPtr, PcRtems_ReservedMemBlock.BlockSize);
10191
OS_printf("CFE_PSP_Restart is not implemented on this platform ( yet ! )\n");
10292
exit(-1);
10393

0 commit comments

Comments
 (0)