From 46baccb5212660fb671c069bbd569bf56ff47e56 Mon Sep 17 00:00:00 2001 From: "Nakamura, Yuuichi" Date: Mon, 11 May 2020 09:30:49 +0900 Subject: [PATCH] Remove unnecessary enter/leave_critical_section() in setlogmask() because it is MT-unsafe. --- libs/libc/syslog/lib_setlogmask.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/libs/libc/syslog/lib_setlogmask.c b/libs/libc/syslog/lib_setlogmask.c index 02aaa70107..ad5df88e3d 100644 --- a/libs/libc/syslog/lib_setlogmask.c +++ b/libs/libc/syslog/lib_setlogmask.c @@ -1,7 +1,8 @@ /**************************************************************************** * lib/syslog/lib_setlogmask.c * - * Copyright (C) 2007-2009, 2011-2012, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2012, 2016 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -42,8 +43,6 @@ #include #include -#include - #include "syslog/syslog.h" /**************************************************************************** @@ -91,17 +90,9 @@ uint8_t g_syslog_mask = LOG_ALL; int setlogmask(int mask) { uint8_t oldmask; - irqstate_t flags; - - /* These operations must be exclusive with respect to other threads as well - * as interrupts. - */ - - flags = enter_critical_section(); oldmask = g_syslog_mask; g_syslog_mask = (uint8_t)mask; - leave_critical_section(flags); return oldmask; }