[libcamera-devel] [PATCH 1/5] libcamera: base: log: Remove unnecessary local variable
Umang Jain
umang.jain at ideasonboard.com
Sun May 29 13:17:51 CEST 2022
Hi Laurent,
Thank you for the patch
On 5/26/22 00:24, Laurent Pinchart via libcamera-devel wrote:
> The output local variable in Logger::logSetTarget() isn't necessary.
> Remove it.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
> src/libcamera/base/log.cpp | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp
> index 64813b6607c5..df84ba4e8328 100644
> --- a/src/libcamera/base/log.cpp
> +++ b/src/libcamera/base/log.cpp
> @@ -477,15 +477,11 @@ int Logger::logSetStream(std::ostream *stream)
> */
> int Logger::logSetTarget(enum LoggingTarget target)
> {
> - std::shared_ptr<LogOutput> output;
> -
> switch (target) {
> case LoggingTargetSyslog:
> - output = std::make_shared<LogOutput>();
> - std::atomic_store(&output_, output);
> + std::atomic_store(&output_, std::make_shared<LogOutput>());
> break;
> case LoggingTargetNone:
> - output = nullptr;
> std::atomic_store(&output_, std::shared_ptr<LogOutput>());
> break;
> default:
More information about the libcamera-devel
mailing list