From db8942178a9e6b25960970c5ef8b45e47ab2d38d Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 1 Apr 2022 19:55:56 +0300 Subject: [PATCH] Kernel: Stop debug spam when using read on /dev/mem device This is not really useful and quite annoying so let's disable it by default. --- Kernel/Devices/MemoryDevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Devices/MemoryDevice.cpp b/Kernel/Devices/MemoryDevice.cpp index 08af5bd8c3..3494248525 100644 --- a/Kernel/Devices/MemoryDevice.cpp +++ b/Kernel/Devices/MemoryDevice.cpp @@ -33,7 +33,7 @@ UNMAP_AFTER_INIT MemoryDevice::~MemoryDevice() = default; ErrorOr MemoryDevice::read(OpenFileDescription&, u64 offset, UserOrKernelBuffer& buffer, size_t length) { if (!MM.is_allowed_to_read_physical_memory_for_userspace(PhysicalAddress(offset), length)) { - dbgln("MemoryDevice: Trying to read physical memory at {} for range of {} bytes failed due to violation of access", PhysicalAddress(offset), length); + dbgln_if(MEMORY_DEVICE_DEBUG, "MemoryDevice: Trying to read physical memory at {} for range of {} bytes failed due to violation of access", PhysicalAddress(offset), length); return EINVAL; } auto mapping = TRY(Memory::map_typed(PhysicalAddress(offset), length));