From cf4ff121a9527e41562d14f36a76ab0ebac0f461 Mon Sep 17 00:00:00 2001 From: pierrenoel-bouteville-act <74783364+pierrenoel-bouteville-act@users.noreply.github.com> Date: Wed, 6 Apr 2022 20:08:44 +0200 Subject: [PATCH] tasks.c:2067:11: warning: this condition has identical branches [-Wduplicated-branches] (#482) * replace duplicated if branch because empty by a comment to avoid warning/error with option GCC -Wduplicated-branches * Missing ';' * cosmetic comment * update comment as suggested by Gaurav-Aggarwal-AWS * cosmetic Co-authored-by: Pierre-Noel Bouteville --- tasks.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tasks.c b/tasks.c index 20df27345..82ad273dd 100644 --- a/tasks.c +++ b/tasks.c @@ -2064,15 +2064,14 @@ void vTaskStartScheduler( void ) /* Setting up the timer tick is hardware specific and thus in the * portable interface. */ - if( xPortStartScheduler() != pdFALSE ) - { - /* Should not reach here as if the scheduler is running the - * function will not return. */ - } - else - { - /* Should only reach here if a task calls xTaskEndScheduler(). */ - } + xPortStartScheduler(); + + /* In most cases, xPortStartScheduler() will not return. If it + * returns pdTRUE then there was not enough heap memory available + * to create either the Idle or the Timer task. If it returned + * pdFALSE, then the application called xTaskEndScheduler(). + * Most ports don't implement xTaskEndScheduler() as there is + * nothing to return to. */ } else {