Skip to content

Commit

Permalink
Review feedback: Fix incorrect documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
anush-apple committed Feb 23, 2024
1 parent 727f0d1 commit 4b48de7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/lib/support/CodeUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ constexpr inline const _T & max(const _T & a, const _T & b)
} while (false)

/**
* @def SuccessOrExit(aStatus)
* @def SuccessOrExit(error)
*
* @brief
* This checks for the specified status, which is expected to
* This checks for the specified error, which is expected to
* commonly be successful (CHIP_NO_ERROR), and branches to
* the local label 'exit' if the status is unsuccessful.
*
Expand All @@ -387,10 +387,10 @@ constexpr inline const _T & max(const _T & a, const _T & b)
* }
* @endcode
*
* @param[in] aStatus A scalar status to be evaluated against zero (0).
* @param[in] error A ChipError object to be evaluated against success (CHIP_NO_ERROR).
*
*/
#define SuccessOrExit(aStatus) nlEXPECT(::chip::ChipError::IsSuccess((aStatus)), exit)
#define SuccessOrExit(error) nlEXPECT(::chip::ChipError::IsSuccess((error)), exit)

/**
* @def VerifyOrExit(aCondition, anAction)
Expand Down
14 changes: 7 additions & 7 deletions src/tracing/metric_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
#if MATTER_TRACING_ENABLED

/**
* @def SuccessOrExitWithMetric(kMetriKey, aStatus)
* @def SuccessOrExitWithMetric(kMetriKey, error)
*
* @brief
* This checks for the specified status, which is expected to
* This checks for the specified error, which is expected to
* commonly be successful (CHIP_NO_ERROR), and branches to
* the local label 'exit' if the status is unsuccessful.
* If unsuccessful, a metric with key kMetriKey is emitted with
* the local label 'exit' if the error is not success.
* If error is not a success, a metric with key kMetriKey is emitted with
* the error code as the value of the metric.
*
* Example Usage:
Expand All @@ -57,10 +57,10 @@
* @param[in] kMetricKey Metric key for the metric event to be emitted
* if the condition evaluates to false. The value
* for the metric is result of the expression aStatus.
* @param[in] aStatus A scalar status to be evaluated against zero (0).
* @param[in] error A ChipError object to be evaluated against success (CHIP_NO_ERROR).
*
*/
#define SuccessOrExitWithMetric(kMetricKey, aStatus) nlEXPECT(::chip::Tracing::ErrorHandling::LogMetricIfError(kMetricKey, aStatus), exit)
#define SuccessOrExitWithMetric(kMetricKey, error) nlEXPECT(::chip::Tracing::ErrorHandling::LogMetricIfError((kMetricKey), (error)), exit)

/**
* @def VerifyOrExitWithMetric(kMetricKey, aCondition, anAction)
Expand Down Expand Up @@ -97,7 +97,7 @@
* assertion fails.
*/
#define VerifyOrExitWithMetric(kMetricKey, aCondition, anAction) \
nlEXPECT_ACTION(aCondition, exit, MATTER_LOG_METRIC(kMetricKey, anAction))
nlEXPECT_ACTION(aCondition, exit, MATTER_LOG_METRIC((kMetricKey), (anAction)))

/*
* Utility Macros to support optional arguments for MATTER_LOG_METRIC_XYZ macros
Expand Down

0 comments on commit 4b48de7

Please sign in to comment.