Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FreeRTOS/FreeRTOS-Kernel.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralfred gedeon <28123637+alfred2g@users.noreply.github.com>2021-03-21 19:03:38 +0300
committerGitHub <noreply@github.com>2021-03-21 19:03:38 +0300
commit9cd19603e8c055e22105e28c2dace4d55b1e420b (patch)
treebf0ce2c2ac62fb2061f915fa5308f51895e5ec23 /timers.c
parent6b72419c789dfee9070186f18bd145a2516d9e28 (diff)
Code: Remove redundant check (#287)
Diffstat (limited to 'timers.c')
-rw-r--r--timers.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/timers.c b/timers.c
index eb4229695..203a07778 100644
--- a/timers.c
+++ b/timers.c
@@ -350,27 +350,24 @@
/* 0 is not a valid value for xTimerPeriodInTicks. */
configASSERT( ( xTimerPeriodInTicks > 0 ) );
- if( pxNewTimer != NULL )
- {
- /* Ensure the infrastructure used by the timer service task has been
- * created/initialised. */
- prvCheckForValidListAndQueue();
-
- /* Initialise the timer structure members using the function
- * parameters. */
- pxNewTimer->pcTimerName = pcTimerName;
- pxNewTimer->xTimerPeriodInTicks = xTimerPeriodInTicks;
- pxNewTimer->pvTimerID = pvTimerID;
- pxNewTimer->pxCallbackFunction = pxCallbackFunction;
- vListInitialiseItem( &( pxNewTimer->xTimerListItem ) );
+ /* Ensure the infrastructure used by the timer service task has been
+ * created/initialised. */
+ prvCheckForValidListAndQueue();
- if( uxAutoReload != pdFALSE )
- {
- pxNewTimer->ucStatus |= tmrSTATUS_IS_AUTORELOAD;
- }
+ /* Initialise the timer structure members using the function
+ * parameters. */
+ pxNewTimer->pcTimerName = pcTimerName;
+ pxNewTimer->xTimerPeriodInTicks = xTimerPeriodInTicks;
+ pxNewTimer->pvTimerID = pvTimerID;
+ pxNewTimer->pxCallbackFunction = pxCallbackFunction;
+ vListInitialiseItem( &( pxNewTimer->xTimerListItem ) );
- traceTIMER_CREATE( pxNewTimer );
+ if( uxAutoReload != pdFALSE )
+ {
+ pxNewTimer->ucStatus |= tmrSTATUS_IS_AUTORELOAD;
}
+
+ traceTIMER_CREATE( pxNewTimer );
}
/*-----------------------------------------------------------*/