fix(esp_common): move some DEBUG macros to http client component

In commit a0bcffcc, some ESP_RETURN and ESP_GOTO debug macros were
introduced. But this caused a regression with CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT
case. Its better to move this macros to HTTP client component itself, as
the debug log is still desired for the specific use-case.
This commit is contained in:
Mahavir Jain
2025-01-16 10:27:54 +05:30
parent fdb1897392
commit dcb43e0eff
4 changed files with 66 additions and 80 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -307,18 +307,6 @@ extern "C" {
} \
} while(0)
/**
* Macro which can be used to check the error code. If the code is not ESP_OK, it prints the message and returns.
* It logs the message in debug mode.
*/
#define ESP_RETURN_ON_ERROR_DEBUG(x, log_tag, format, ...) do { \
esp_err_t err_rc_ = (x); \
if (unlikely(err_rc_ != ESP_OK)) { \
ESP_LOGD(log_tag, "%s(%d): " format, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
return err_rc_; \
} \
} while(0)
/**
* A version of ESP_RETURN_ON_ERROR() macro that can be called from ISR.
*/
@@ -366,20 +354,6 @@ extern "C" {
} \
} while(0)
/**
* Macro which can be used to check the error code. If the code is not ESP_OK, it prints the message,
* sets the local variable 'ret' to the code, and then exits by jumping to 'goto_tag'.
* It logs the message in debug mode.
*/
#define ESP_GOTO_ON_ERROR_DEBUG(x, goto_tag, log_tag, format, ...) do { \
esp_err_t err_rc_ = (x); \
if (unlikely(err_rc_ != ESP_OK)) { \
ESP_LOGD(log_tag, "%s(%d): " format, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
ret = err_rc_; \
goto goto_tag; \
} \
} while(0)
/**
* A version of ESP_GOTO_ON_ERROR() macro that can be called from ISR.
*/
@@ -403,18 +377,6 @@ extern "C" {
} \
} while(0)
/**
* Macro which can be used to check the condition. If the condition is not 'true', it prints the message
* and returns with the supplied 'err_code'.
* It logs the message in debug mode.
*/
#define ESP_RETURN_ON_FALSE_DEBUG(a, err_code, log_tag, format, ...) do { \
if (unlikely(!(a))) { \
ESP_LOGD(log_tag, "%s(%d): " format, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
return err_code; \
} \
} while(0)
/**
* A version of ESP_RETURN_ON_FALSE() macro that can be called from ISR.
*/
@@ -458,19 +420,6 @@ extern "C" {
} \
} while (0)
/**
* Macro which can be used to check the condition. If the condition is not 'true', it prints the message,
* sets the local variable 'ret' to the supplied 'err_code', and then exits by jumping to 'goto_tag'.
* It logs the message in debug mode.
*/
#define ESP_GOTO_ON_FALSE_DEBUG(a, err_code, goto_tag, log_tag, format, ...) do { \
if (unlikely(!(a))) { \
ESP_LOGD(log_tag, "%s(%d): " format, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
ret = err_code; \
goto goto_tag; \
} \
} while (0)
/**
* A version of ESP_GOTO_ON_FALSE() macro that can be called from ISR.
*/