From 56d43a94a9881e7bdf79c1096e1072c60d190df4 Mon Sep 17 00:00:00 2001 From: Marvin Friedrich Date: Tue, 13 Oct 2026 23:01:41 +0200 Subject: [PATCH] remove newlines in assert --- arch/x86_64/apic.c | 2 +- arch/x86_64/hpet.c | 2 +- arch/x86_64/idt.c | 4 ++-- arch/x86_64/sched.c | 2 +- arch/x86_64/smp.c | 2 +- core/mem/init.c | 12 ++++++------ core/mem/vma.c | 2 +- core/sched/sched_dumb.c | 6 +++--- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/x86_64/apic.c b/arch/x86_64/apic.c index 1bfa471..67fdc35 100644 --- a/arch/x86_64/apic.c +++ b/arch/x86_64/apic.c @@ -49,7 +49,7 @@ void lapic_init(struct local_apic* lapic) { uintptr_t vaddr = vm_alloc(0x1000); pmap_map(&kernel_vma.pmap, vaddr, apic_msr & 0xFFFF'F000, PTE_READ | PTE_WRITE, CACHE_MMIO); lapic->xapic_regs = (void*)vaddr; - assert(lapic->xapic_regs, "Failed to allocate virtual memory!\n"); + assert(lapic->xapic_regs, "Failed to allocate virtual memory!"); } asm_wrmsr(0x1B, apic_msr); diff --git a/arch/x86_64/hpet.c b/arch/x86_64/hpet.c index 863aa95..6b1ab54 100644 --- a/arch/x86_64/hpet.c +++ b/arch/x86_64/hpet.c @@ -74,7 +74,7 @@ static void hpet_init(struct boot_info*) { uint64_t caps = mmio_read64(hpet_clock.regs + HPET_CAP); hpet_clock.period = (caps >> 32) & 0xFFFF'FFFF; - assert(clock_switch(&hpet_clock.clock), "Unable to switch to HPET!\n"); + assert(clock_switch(&hpet_clock.clock), "Unable to switch to HPET!"); } INIT_TASK(hpet_stage, "arch.x86_64.hpet", hpet_init); INIT_DEPENDS(hpet_stage, acpi_stage); diff --git a/arch/x86_64/idt.c b/arch/x86_64/idt.c index ed567b5..fcde35b 100644 --- a/arch/x86_64/idt.c +++ b/arch/x86_64/idt.c @@ -96,9 +96,9 @@ void interrupt_handler(struct arch_context* ctx) { default: if (isr < 0x20) panic("Unhandled exception %lu at %#lx, error: %#lx\n", isr, ctx->rip, ctx->error); - assert(isr - 0x20 < ARRAY_SIZE(arch_cpu->irq_lines), "Unhandled interrupt on ISR %lu\n", isr); + assert(isr - 0x20 < ARRAY_SIZE(arch_cpu->irq_lines), "Unhandled interrupt on ISR %lu", isr); struct irq_line* line = arch_cpu->irq_lines[isr - 0x20]; - assert(line, "Unhandled interrupt on ISR %lu\n", isr); + assert(line, "Unhandled interrupt on ISR %lu", isr); irq_line_raise(line); } } diff --git a/arch/x86_64/sched.c b/arch/x86_64/sched.c index d36422b..ed42a09 100644 --- a/arch/x86_64/sched.c +++ b/arch/x86_64/sched.c @@ -114,7 +114,7 @@ errno_t arch_task_init( ) { struct arch_percpu* cpu = percpu_ref(arch_data); - assert((stack_start & 0xF) == 0, "Task stack is not 16-byte aligned!\n"); + assert((stack_start & 0xF) == 0, "Task stack is not 16-byte aligned!"); // Prepare a dummy stack with an entry point function to return to. struct task_frame* frame = (struct task_frame*)(stack_start - sizeof(uint64_t)) - 1; diff --git a/arch/x86_64/smp.c b/arch/x86_64/smp.c index 8816a13..b1e9d48 100644 --- a/arch/x86_64/smp.c +++ b/arch/x86_64/smp.c @@ -275,7 +275,7 @@ static errno_t build_temp_table(phys_t* out) { void x86_64_smp_init() { const size_t trampoline_size = smp_trampoline_end - smp_trampoline_start; - assert(trampoline_size <= arch_mem_page_size(), "SMP trampoline doesn't fit in a page\n"); + assert(trampoline_size <= arch_mem_page_size(), "SMP trampoline doesn't fit in a page"); const size_t max_cpus = percpu_max_cpus(); if (max_cpus <= 1) diff --git a/core/mem/init.c b/core/mem/init.c index c2c27be..eefe7b7 100644 --- a/core/mem/init.c +++ b/core/mem/init.c @@ -66,7 +66,7 @@ void mem_init(struct phys_mem* map, size_t map_len, uintptr_t kernel_virt, phys_ // since we're likely going to map it at a different base address. mem_hhdm_base = tmp_hhdm; - assert(pmap_new_kernel(&kernel_vma.pmap, 0) == 0, "Unable to allocate the kernel page table\n"); + assert(pmap_new_kernel(&kernel_vma.pmap, 0) == 0, "Unable to allocate the kernel page table"); tailq_init(&kernel_vma.mappings); // text @@ -79,7 +79,7 @@ void mem_init(struct phys_mem* map, size_t map_len, uintptr_t kernel_virt, phys_ PTE_READ | PTE_EXEC, CACHE_ANY ); - assert(!status, "Failed to map %p with error %i\n", p, status); + assert(!status, "Failed to map %p with error %i", p, status); } // rodata @@ -92,7 +92,7 @@ void mem_init(struct phys_mem* map, size_t map_len, uintptr_t kernel_virt, phys_ PTE_READ, CACHE_ANY ); - assert(!status, "Failed to map %p with error %i\n", p, status); + assert(!status, "Failed to map %p with error %i", p, status); } // data @@ -105,7 +105,7 @@ void mem_init(struct phys_mem* map, size_t map_len, uintptr_t kernel_virt, phys_ PTE_READ | PTE_WRITE, CACHE_ANY ); - assert(!status, "Failed to map %p with error %i\n", p, status); + assert(!status, "Failed to map %p with error %i", p, status); } // The kernel address space is divided into 4 segments. @@ -124,7 +124,7 @@ void mem_init(struct phys_mem* map, size_t map_len, uintptr_t kernel_virt, phys_ uintptr_t vaddr = (uintptr_t)(map[i].address + p + tmp_hhdm); phys_t paddr = (phys_t)(map[i].address + p); errno_t status = pmap_map(&kernel_vma.pmap, vaddr, paddr, PTE_READ | PTE_WRITE, CACHE_ANY); - assert(!status, "Failed to map HHDM page %p to %p with error %i\n", (void*)vaddr, (void*)paddr, status); + assert(!status, "Failed to map HHDM page %p to %p with error %i", (void*)vaddr, (void*)paddr, status); } } mem_hhdm_base = tmp_hhdm; @@ -152,7 +152,7 @@ void mem_init(struct phys_mem* map, size_t map_len, uintptr_t kernel_virt, phys_ for (size_t page = 0; page < length; page += pgsz) { phys_t paddr; - assert(!mem_phys_alloc(1, 0, &paddr), "Failed to allocate memory for PFNDB!\n"); + assert(!mem_phys_alloc(1, 0, &paddr), "Failed to allocate memory for PFNDB!"); assert( !pmap_map(&kernel_vma.pmap, vaddr + page, paddr, PTE_READ | PTE_WRITE, CACHE_ANY), "Failed to map PFNDB memory" diff --git a/core/mem/vma.c b/core/mem/vma.c index 0f47df1..af1b0c1 100644 --- a/core/mem/vma.c +++ b/core/mem/vma.c @@ -112,7 +112,7 @@ bool vma_page_fault(struct vma* v, const struct vma_fault_info* info) { if (still_valid) { errno_t status = pmap_map(&v->pmap, faulty_page * page_size, vm_page_addr(page), prot_to_pte(v, prot), CACHE_ANY); - assert(status == 0, "Failed to map a demand-loaded page\n"); + assert(status == 0, "Failed to map a demand-loaded page"); } spin_unlock(&v->lock); diff --git a/core/sched/sched_dumb.c b/core/sched/sched_dumb.c index 644c79a..5e525e1 100644 --- a/core/sched/sched_dumb.c +++ b/core/sched/sched_dumb.c @@ -37,11 +37,11 @@ void sched_to_user_context(uintptr_t ctx) { void sched_init(struct scheduler* sched) { struct task* idle_task; - assert(task_create("idle", &kernel_vma, idle_func, 0, &idle_task) == 0, "Unable to create idle task!\n"); + assert(task_create("idle", &kernel_vma, idle_func, 0, &idle_task) == 0, "Unable to create idle task!"); sched->idle_task = idle_task; struct task* boot_task = mem_alloc(sizeof(struct task), 0); - assert(boot_task != nullptr, "Unable to create boot task!\n"); + assert(boot_task != nullptr, "Unable to create boot task!"); strncpy(boot_task->name, "boot", sizeof(boot_task->name)); boot_task->space = &kernel_vma; sched->current = boot_task; @@ -52,7 +52,7 @@ void sched_init(struct scheduler* sched) { } void sched_add_task(struct scheduler* sched, struct task* task) { - assert(task != nullptr, "Tried to add NULL to the run queue\n"); + assert(task != nullptr, "Tried to add NULL to the run queue"); task->state = TASK_STATE_READY; tailq_insert_tail(&sched->run_queue, task, next); }