From: deraadt Date: Sun, 16 May 2021 15:10:19 +0000 (+0000) Subject: panic does not require a \n at the end. When one is provided, it looks wrong. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4123b6a72e72fced8fc2e0a0d26650a8a8e7bb8b;p=openbsd panic does not require a \n at the end. When one is provided, it looks wrong. --- diff --git a/sys/arch/arm/cortex/arml2cc.c b/sys/arch/arm/cortex/arml2cc.c index 95efc216cd7..b399708b3b3 100644 --- a/sys/arch/arm/cortex/arml2cc.c +++ b/sys/arch/arm/cortex/arml2cc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arml2cc.c,v 1.6 2021/03/25 04:12:01 jsg Exp $ */ +/* $OpenBSD: arml2cc.c,v 1.7 2021/05/16 15:10:19 deraadt Exp $ */ /* * Copyright (c) 2013 Patrick Wildt * @@ -145,7 +145,7 @@ arml2cc_attach(struct device *parent, struct device *self, void *args) arml2cc_sc = sc; if (bus_space_read_4(sc->sc_iot, sc->sc_ioh, L2C_CTL)) - panic("L2 Cache controller was already enabled\n"); + panic("L2 Cache controller was already enabled"); sc->sc_dcache_line_size = 32 << (bus_space_read_4(sc->sc_iot, sc->sc_ioh, L2C_CACHE_TYPE) & L2C_CACHE_TYPE_LINESIZE); sc->sc_waymask = (8 << ((bus_space_read_4(sc->sc_iot, sc->sc_ioh, L2C_AUXCTL) diff --git a/sys/arch/arm64/arm64/pmap.c b/sys/arch/arm64/arm64/pmap.c index f3a6706321b..50dfaf77e67 100644 --- a/sys/arch/arm64/arm64/pmap.c +++ b/sys/arch/arm64/arm64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.76 2021/03/17 12:03:40 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.77 2021/05/16 15:10:19 deraadt Exp $ */ /* * Copyright (c) 2008-2009,2014-2016 Dale Rahn * @@ -752,7 +752,7 @@ _pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot, int flags, int cache) /* Do not have pted for this, get one and put it in VP */ if (pted == NULL) { - panic("pted not preallocated in pmap_kernel() va %lx pa %lx\n", + panic("pted not preallocated in pmap_kernel() va %lx pa %lx", va, pa); } @@ -1462,10 +1462,10 @@ pmap_set_l1(struct pmap *pm, uint64_t va, struct pmapvp1 *l1_va) int idx0; if (pmap_extract(pmap_kernel(), (vaddr_t)l1_va, &l1_pa) == 0) - panic("unable to find vp pa mapping %p\n", l1_va); + panic("unable to find vp pa mapping %p", l1_va); if (l1_pa & (Lx_TABLE_ALIGN-1)) - panic("misaligned L2 table\n"); + panic("misaligned L2 table"); pg_entry = VP_Lx(l1_pa); @@ -1483,10 +1483,10 @@ pmap_set_l2(struct pmap *pm, uint64_t va, struct pmapvp1 *vp1, int idx1; if (pmap_extract(pmap_kernel(), (vaddr_t)l2_va, &l2_pa) == 0) - panic("unable to find vp pa mapping %p\n", l2_va); + panic("unable to find vp pa mapping %p", l2_va); if (l2_pa & (Lx_TABLE_ALIGN-1)) - panic("misaligned L2 table\n"); + panic("misaligned L2 table"); pg_entry = VP_Lx(l2_pa); @@ -1504,10 +1504,10 @@ pmap_set_l3(struct pmap *pm, uint64_t va, struct pmapvp2 *vp2, int idx2; if (pmap_extract(pmap_kernel(), (vaddr_t)l3_va, &l3_pa) == 0) - panic("unable to find vp pa mapping %p\n", l3_va); + panic("unable to find vp pa mapping %p", l3_va); if (l3_pa & (Lx_TABLE_ALIGN-1)) - panic("misaligned L2 table\n"); + panic("misaligned L2 table"); pg_entry = VP_Lx(l3_pa); @@ -2004,7 +2004,7 @@ pmap_clear_modify(struct vm_page *pg) mtx_enter(&pg->mdpage.pv_mtx); LIST_FOREACH(pted, &(pg->mdpage.pv_list), pted_pv_list) { if (pmap_vp_lookup(pted->pted_pmap, pted->pted_va & ~PAGE_MASK, &pl3) == NULL) - panic("failed to look up pte\n"); + panic("failed to look up pte"); *pl3 |= ATTR_AP(2); pted->pted_pte &= ~PROT_WRITE; diff --git a/sys/arch/arm64/arm64/trap.c b/sys/arch/arm64/arm64/trap.c index 4e7e8cc3fb3..d8cdf13ced9 100644 --- a/sys/arch/arm64/arm64/trap.c +++ b/sys/arch/arm64/arm64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.37 2021/05/15 11:30:27 kettenis Exp $ */ +/* $OpenBSD: trap.c,v 1.38 2021/05/16 15:10:19 deraadt Exp $ */ /*- * Copyright (c) 2014 Andrew Turner * All rights reserved. @@ -237,7 +237,7 @@ do_el1h_sync(struct trapframe *frame) db_trapper(frame->tf_elr, 0/*XXX*/, frame, exception); } #else - panic("No debugger in kernel.\n"); + panic("No debugger in kernel."); #endif break; default: @@ -248,7 +248,7 @@ do_el1h_sync(struct trapframe *frame) db_trapper(frame->tf_elr, 0/*XXX*/, frame, exception); } #endif - panic("Unknown kernel exception %x esr_el1 %llx lr %lxpc %lx\n", + panic("Unknown kernel exception %x esr_el1 %llx lr %lxpc %lx", exception, esr, frame->tf_lr, frame->tf_elr); } @@ -317,7 +317,7 @@ do_el0_sync(struct trapframe *frame) trapsignal(p, SIGTRAP, 0, TRAP_TRACE, sv); break; default: - // panic("Unknown userland exception %x esr_el1 %lx\n", exception, + // panic("Unknown userland exception %x esr_el1 %lx", exception, // esr); // USERLAND MUST NOT PANIC MACHINE { diff --git a/sys/arch/arm64/dev/aplintc.c b/sys/arch/arm64/dev/aplintc.c index edaa6099f7d..019559f3aef 100644 --- a/sys/arch/arm64/dev/aplintc.c +++ b/sys/arch/arm64/dev/aplintc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aplintc.c,v 1.3 2021/04/21 18:11:17 kettenis Exp $ */ +/* $OpenBSD: aplintc.c,v 1.4 2021/05/16 15:10:19 deraadt Exp $ */ /* * Copyright (c) 2021 Mark Kettenis * @@ -218,7 +218,7 @@ aplintc_irq_handler(void *frame) } if (irq >= sc->sc_nirq) - panic("%s: unexpected irq %d\n", __func__, irq); + panic("%s: unexpected irq %d", __func__, irq); if (sc->sc_irq_handler[irq] == NULL) return; @@ -358,13 +358,13 @@ aplintc_intr_establish(void *cookie, int *cell, int level, if (type == 0) { KASSERT(level != (IPL_CLOCK | IPL_MPSAFE)); if (irq >= sc->sc_nirq) { - panic("%s: bogus irq number %d\n", + panic("%s: bogus irq number %d", sc->sc_dev.dv_xname, irq); } } else if (type == 1) { KASSERT(level == (IPL_CLOCK | IPL_MPSAFE)); if (irq >= 4) - panic("%s: bogus fiq number %d\n", + panic("%s: bogus fiq number %d", sc->sc_dev.dv_xname, irq); } else { panic("%s: bogus irq type %d", @@ -450,7 +450,7 @@ aplintc_handle_ipi(struct aplintc_softc *sc, uint32_t irq) struct cpu_info *ci = curcpu(); if (irq != AIC_EVENT_IPI_OTHER) - panic("%s: unexpected irq %d\n", __func__, irq); + panic("%s: unexpected irq %d", __func__, irq); HWRITE4(sc, AIC_IPI_ACK, AIC_IPI_OTHER); diff --git a/sys/arch/arm64/dev/smmu.c b/sys/arch/arm64/dev/smmu.c index 082248440f7..07a5539a21d 100644 --- a/sys/arch/arm64/dev/smmu.c +++ b/sys/arch/arm64/dev/smmu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smmu.c,v 1.13 2021/04/03 15:59:08 patrick Exp $ */ +/* $OpenBSD: smmu.c,v 1.14 2021/05/16 15:10:19 deraadt Exp $ */ /* * Copyright (c) 2008-2009,2014-2016 Dale Rahn * Copyright (c) 2021 Patrick Wildt @@ -814,10 +814,10 @@ smmu_set_l1(struct smmu_domain *dom, uint64_t va, struct smmuvp1 *l1_va) int idx0; if (pmap_extract(pmap_kernel(), (vaddr_t)l1_va, &l1_pa) == 0) - panic("unable to find vp pa mapping %p\n", l1_va); + panic("unable to find vp pa mapping %p", l1_va); if (l1_pa & (Lx_TABLE_ALIGN-1)) - panic("misaligned L2 table\n"); + panic("misaligned L2 table"); pg_entry = VP_Lx(l1_pa); @@ -835,10 +835,10 @@ smmu_set_l2(struct smmu_domain *dom, uint64_t va, struct smmuvp1 *vp1, int idx1; if (pmap_extract(pmap_kernel(), (vaddr_t)l2_va, &l2_pa) == 0) - panic("unable to find vp pa mapping %p\n", l2_va); + panic("unable to find vp pa mapping %p", l2_va); if (l2_pa & (Lx_TABLE_ALIGN-1)) - panic("misaligned L2 table\n"); + panic("misaligned L2 table"); pg_entry = VP_Lx(l2_pa); @@ -856,10 +856,10 @@ smmu_set_l3(struct smmu_domain *dom, uint64_t va, struct smmuvp2 *vp2, int idx2; if (pmap_extract(pmap_kernel(), (vaddr_t)l3_va, &l3_pa) == 0) - panic("unable to find vp pa mapping %p\n", l3_va); + panic("unable to find vp pa mapping %p", l3_va); if (l3_pa & (Lx_TABLE_ALIGN-1)) - panic("misaligned L2 table\n"); + panic("misaligned L2 table"); pg_entry = VP_Lx(l3_pa); diff --git a/sys/arch/armv7/broadcom/bcm2836_intr.c b/sys/arch/armv7/broadcom/bcm2836_intr.c index ec55af43f9a..f5f2b7ea19c 100644 --- a/sys/arch/armv7/broadcom/bcm2836_intr.c +++ b/sys/arch/armv7/broadcom/bcm2836_intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcm2836_intr.c,v 1.5 2020/07/14 15:34:15 patrick Exp $ */ +/* $OpenBSD: bcm2836_intr.c,v 1.6 2021/05/16 15:10:19 deraadt Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn * Copyright (c) 2015 Patrick Wildt @@ -168,10 +168,10 @@ bcm_intc_attach(struct device *parent, struct device *self, void *aux) */ node = OF_finddevice("/soc/local_intc"); if (node == -1) - panic("%s: can't find ARM control logic\n", __func__); + panic("%s: can't find ARM control logic", __func__); if (OF_getpropintarray(node, "reg", reg, sizeof(reg)) != sizeof(reg)) - panic("%s: can't map ARM control logic\n", __func__); + panic("%s: can't map ARM control logic", __func__); if (bus_space_map(sc->sc_iot, reg[0], reg[1], 0, &sc->sc_lioh)) panic("%s: bus_space_map failed!", __func__); diff --git a/sys/arch/armv7/omap/dmtimer.c b/sys/arch/armv7/omap/dmtimer.c index 101ab073ea7..3497dde47c2 100644 --- a/sys/arch/armv7/omap/dmtimer.c +++ b/sys/arch/armv7/omap/dmtimer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dmtimer.c,v 1.12 2021/05/16 03:39:28 jsg Exp $ */ +/* $OpenBSD: dmtimer.c,v 1.13 2021/05/16 15:10:19 deraadt Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn * Copyright (c) 2013 Raphael Graf @@ -155,7 +155,7 @@ dmtimer_attach(struct device *parent, struct device *self, void *args) if (bus_space_map(sc->sc_iot, aa->aa_dev->mem[0].addr, aa->aa_dev->mem[0].size, 0, &ioh)) - panic("%s: bus_space_map failed!\n", __func__); + panic("%s: bus_space_map failed!", __func__); prcm_setclock(1, PRCM_CLK_SPEED_32); diff --git a/sys/arch/armv7/omap/prcm.c b/sys/arch/armv7/omap/prcm.c index d32a088ba77..58c56228578 100644 --- a/sys/arch/armv7/omap/prcm.c +++ b/sys/arch/armv7/omap/prcm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: prcm.c,v 1.16 2021/03/25 04:12:01 jsg Exp $ */ +/* $OpenBSD: prcm.c,v 1.17 2021/05/16 15:10:19 deraadt Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn * @@ -332,7 +332,7 @@ prcm_v3_bit(int mod) case PRCM_I2C2: return PRCM_CLK_EN_I2C3; default: - panic("%s: module not found\n", __func__); + panic("%s: module not found", __func__); } } @@ -379,7 +379,7 @@ prcm_am335x_clkctrl(int mod) case PRCM_RNG: return PRCM_AM335X_RNG_CLKCTRL; default: - panic("%s: module not found\n", __func__); + panic("%s: module not found", __func__); } } @@ -475,7 +475,7 @@ prcm_v4_enablemodule(struct prcm_softc *sc, int mod) /* XXX */ break; default: - panic("%s: module not found\n", __func__); + panic("%s: module not found", __func__); } } diff --git a/sys/arch/armv7/sunxi/sxiintc.c b/sys/arch/armv7/sunxi/sxiintc.c index e414dbf8b42..abda083ea28 100644 --- a/sys/arch/armv7/sunxi/sxiintc.c +++ b/sys/arch/armv7/sunxi/sxiintc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sxiintc.c,v 1.8 2021/03/25 04:12:01 jsg Exp $ */ +/* $OpenBSD: sxiintc.c,v 1.9 2021/05/16 15:10:19 deraadt Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn * Copyright (c) 2013 Artturi Alm @@ -379,7 +379,7 @@ sxiintc_intr_establish(int irq, int level, struct cpu_info *ci, uint32_t er; if (irq <= 0 || irq >= NIRQ) - panic("intr_establish: bogus irq %d %s\n", irq, name); + panic("intr_establish: bogus irq %d %s", irq, name); if (ci == NULL) ci = &cpu_info_primary; diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c index b1db57278b1..efc695819b0 100644 --- a/sys/arch/i386/i386/pmap.c +++ b/sys/arch/i386/i386/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.212 2021/04/24 09:44:44 mpi Exp $ */ +/* $OpenBSD: pmap.c,v 1.213 2021/05/16 15:10:19 deraadt Exp $ */ /* $NetBSD: pmap.c,v 1.91 2000/06/02 17:46:37 thorpej Exp $ */ /* @@ -1404,7 +1404,7 @@ pmap_pinit_pd_86(struct pmap *pmap) if (!pmap_extract(pmap_kernel(), (vaddr_t)pmap->pm_pdir_intel, &pmap->pm_pdirpa_intel)) - panic("%s: unknown PA mapping for meltdown PD\n", + panic("%s: unknown PA mapping for meltdown PD", __func__); /* Copy PDEs from pmap_kernel's U-K view */ @@ -2530,7 +2530,7 @@ pmap_enter_special_86(vaddr_t va, paddr_t pa, vm_prot_t prot, u_int32_t flags) panic("%s: kernel_map out of virtual space!", __func__); if (!pmap_extract(pmap, pmap->pm_pdir_intel, &pmap->pm_pdirpa_intel)) - panic("%s: can't locate PD page\n", __func__); + panic("%s: can't locate PD page", __func__); } DPRINTF("%s: pm_pdir_intel 0x%x pm_pdirpa_intel 0x%x\n", __func__, @@ -2544,7 +2544,7 @@ pmap_enter_special_86(vaddr_t va, paddr_t pa, vm_prot_t prot, u_int32_t flags) flags, l2idx, l1idx); if ((pd = (pd_entry_t *)pmap->pm_pdir_intel) == NULL) - panic("%s: PD not initialized for pmap @ %p\n", __func__, pmap); + panic("%s: PD not initialized for pmap @ %p", __func__, pmap); /* npa = physaddr of PT page */ npa = pd[l2idx] & PMAP_PA_MASK; diff --git a/sys/arch/i386/i386/pmapae.c b/sys/arch/i386/i386/pmapae.c index 3a179a6e8c6..7efbcc89a19 100644 --- a/sys/arch/i386/i386/pmapae.c +++ b/sys/arch/i386/i386/pmapae.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmapae.c,v 1.62 2021/04/29 15:34:22 bluhm Exp $ */ +/* $OpenBSD: pmapae.c,v 1.63 2021/05/16 15:10:19 deraadt Exp $ */ /* * Copyright (c) 2006-2008 Michael Shalayeff @@ -1003,14 +1003,14 @@ pmap_pinit_pd_pae(struct pmap *pmap) panic("%s: kernel_map out of virtual space!", __func__); if (!pmap_extract(pmap_kernel(), (vaddr_t)&pmap->pm_pdidx_intel, &pmap->pm_pdirpa_intel)) - panic("%s: can't locate PDPT\n", __func__); + panic("%s: can't locate PDPT", __func__); pmap->pm_pdir_intel = va; for (i = 0; i < 4; i++) { pmap->pm_pdidx_intel[i] = 0; if (!pmap_extract(pmap, va + i * NBPG, (paddr_t *)&pmap->pm_pdidx_intel[i])) - panic("%s: can't locate PD page\n", __func__); + panic("%s: can't locate PD page", __func__); pmap->pm_pdidx_intel[i] |= PG_V; DPRINTF("%s: pm_pdidx_intel[%d] = 0x%llx\n", __func__, i, pmap->pm_pdidx_intel[i]); @@ -1943,13 +1943,13 @@ pmap_enter_special_pae(vaddr_t va, paddr_t pa, vm_prot_t prot, u_int32_t flags) pmap->pm_pdir_intel = vapd; if (!pmap_extract(pmap, (vaddr_t)&pmap->pm_pdidx_intel, &pmap->pm_pdirpa_intel)) - panic("%s: can't locate PDPT\n", __func__); + panic("%s: can't locate PDPT", __func__); for (i = 0; i < 4; i++) { pmap->pm_pdidx_intel[i] = 0; if (!pmap_extract(pmap, vapd + i*NBPG, (paddr_t *)&pmap->pm_pdidx_intel[i])) - panic("%s: can't locate PD page\n", __func__); + panic("%s: can't locate PD page", __func__); /* ensure PDPs are wired down XXX hshoexer why? */ pdppg = PHYS_TO_VM_PAGE(pmap->pm_pdidx_intel[i]); @@ -1977,7 +1977,7 @@ pmap_enter_special_pae(vaddr_t va, paddr_t pa, vm_prot_t prot, u_int32_t flags) flags, l2idx, l1idx); if ((pd = (pd_entry_t *)pmap->pm_pdir_intel) == 0) - panic("%s: PD not initialized for pmap @ %p\n", __func__, pmap); + panic("%s: PD not initialized for pmap @ %p", __func__, pmap); /* npa = phsyaddr of PT page */ npa = pd[l2idx] & PMAP_PA_MASK; diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index 0772eb35ed0..35bd6735ac8 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.152 2021/05/05 07:29:01 mpi Exp $ */ +/* $OpenBSD: trap.c,v 1.153 2021/05/16 15:10:19 deraadt Exp $ */ /* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */ /*- @@ -211,7 +211,7 @@ kpageflttrap(struct trapframe *frame, uint32_t cr2) if (error) { if (pcb->pcb_onfault == NULL) { /* bad memory access in the kernel */ - panic("uvm_fault(%p, 0x%lx, 0, %d) -> %x\n", + panic("uvm_fault(%p, 0x%lx, 0, %d) -> %x", map, va, access_type, error); return 0; } diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c index b71360bdfa6..5f13c134231 100644 --- a/sys/arch/loongson/loongson/machdep.c +++ b/sys/arch/loongson/loongson/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.95 2021/03/11 11:16:58 jsg Exp $ */ +/* $OpenBSD: machdep.c,v 1.96 2021/05/16 15:10:19 deraadt Exp $ */ /* * Copyright (c) 2009, 2010, 2014 Miodrag Vallat. @@ -1296,7 +1296,7 @@ hw_cpu_hatch(struct cpu_info *ci) break; #endif default: - panic("%s: unhandled Loongson version %x\n", __func__, + panic("%s: unhandled Loongson version %x", __func__, loongson_ver); } diff --git a/sys/arch/sparc64/dev/iommu.c b/sys/arch/sparc64/dev/iommu.c index 731fbf4c04b..1e2c7c25ca5 100644 --- a/sys/arch/sparc64/dev/iommu.c +++ b/sys/arch/sparc64/dev/iommu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iommu.c,v 1.81 2021/03/11 11:17:00 jsg Exp $ */ +/* $OpenBSD: iommu.c,v 1.82 2021/05/16 15:10:19 deraadt Exp $ */ /* $NetBSD: iommu.c,v 1.47 2002/02/08 20:03:45 eeh Exp $ */ /* @@ -742,7 +742,7 @@ iommu_dvmamap_load(bus_dma_tag_t t, bus_dma_tag_t t0, bus_dmamap_t map, paddr_t pa; if (pmap_extract(pmap, a, &pa) == FALSE) - panic("iomap pmap error addr 0x%lx\n", a); + panic("iomap pmap error addr 0x%lx", a); err = iommu_iomap_insert_page(ims, pa); if (err) { @@ -824,7 +824,7 @@ iommu_dvmamap_load(bus_dma_tag_t t, bus_dma_tag_t t0, bus_dmamap_t map, /* Yuck... Redoing the same pmap_extract... */ if (pmap_extract(pmap, a, &pa) == FALSE) - panic("iomap pmap error addr 0x%lx\n", a); + panic("iomap pmap error addr 0x%lx", a); pgstart = pa | (MAX(a, addr) & PAGE_MASK); pgend = pa | (MIN(a + PAGE_SIZE - 1, diff --git a/sys/arch/sparc64/dev/viommu.c b/sys/arch/sparc64/dev/viommu.c index 91e33cd93eb..d839a3417c3 100644 --- a/sys/arch/sparc64/dev/viommu.c +++ b/sys/arch/sparc64/dev/viommu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: viommu.c,v 1.19 2017/05/25 03:19:39 dlg Exp $ */ +/* $OpenBSD: viommu.c,v 1.20 2021/05/16 15:10:19 deraadt Exp $ */ /* $NetBSD: iommu.c,v 1.47 2002/02/08 20:03:45 eeh Exp $ */ /* @@ -338,7 +338,7 @@ viommu_dvmamap_load(bus_dma_tag_t t, bus_dma_tag_t t0, bus_dmamap_t map, paddr_t pa; if (pmap_extract(pmap, a, &pa) == FALSE) - panic("iomap pmap error addr 0x%lx\n", a); + panic("iomap pmap error addr 0x%lx", a); err = iommu_iomap_insert_page(ims, pa); if (err) { @@ -415,7 +415,7 @@ viommu_dvmamap_load(bus_dma_tag_t t, bus_dma_tag_t t0, bus_dmamap_t map, /* Yuck... Redoing the same pmap_extract... */ if (pmap_extract(pmap, a, &pa) == FALSE) - panic("iomap pmap error addr 0x%lx\n", a); + panic("iomap pmap error addr 0x%lx", a); pgstart = pa | (MAX(a, addr) & PAGE_MASK); pgend = pa | (MIN(a + PAGE_SIZE - 1, diff --git a/sys/dev/acpi/acpidmar.c b/sys/dev/acpi/acpidmar.c index 93228d76286..a0b263fbe4c 100644 --- a/sys/dev/acpi/acpidmar.c +++ b/sys/dev/acpi/acpidmar.c @@ -630,7 +630,7 @@ domain_load_map(struct domain *dom, bus_dmamap_t map, int flags, int pteflag, co panic("domain_load_map: extent_alloc"); } if (res == -1) { - panic("got -1 address\n"); + panic("got -1 address"); } mtx_leave(&dom->exlck); @@ -914,7 +914,7 @@ iommu_alloc_page(struct iommu_softc *iommu, paddr_t *paddr) *paddr = 0; va = km_alloc(VTD_PAGE_SIZE, &kv_page, &kp_zero, &kd_nowait); if (va == NULL) { - panic("can't allocate page\n"); + panic("can't allocate page"); } pmap_extract(pmap_kernel(), (vaddr_t)va, paddr); return (va); @@ -2502,7 +2502,7 @@ acpiivrs_init(struct acpidmar_softc *sc, struct acpi_ivrs *ivrs) if (!sc->sc_hwdte) { sc->sc_hwdte = iommu_alloc_hwdte(sc, HWDTE_SIZE, &sc->sc_hwdtep); if (sc->sc_hwdte == NULL) - panic("Can't allocate HWDTE!\n"); + panic("Can't allocate HWDTE!"); } domain_map_page = domain_map_page_amd; diff --git a/sys/dev/ic/bwi.c b/sys/dev/ic/bwi.c index 91948caf03b..f2008da1648 100644 --- a/sys/dev/ic/bwi.c +++ b/sys/dev/ic/bwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwi.c,v 1.130 2020/07/10 13:26:37 patrick Exp $ */ +/* $OpenBSD: bwi.c,v 1.131 2021/05/16 15:10:19 deraadt Exp $ */ /* * Copyright (c) 2007 The DragonFly Project. All rights reserved. @@ -6214,7 +6214,7 @@ bwi_setup_desc32(struct bwi_softc *sc, struct bwi_desc32 *desc_array, uint32_t ctrl, addr, addr_hi, addr_lo; if (sc->sc_bus_space == BWI_BUS_SPACE_30BIT && paddr >= 0x40000000) - panic("bad paddr 0x%lx\n", (long)paddr); + panic("bad paddr 0x%lx", (long)paddr); addr_lo = __SHIFTOUT(paddr, BWI_DESC32_A_ADDR_MASK); addr_hi = __SHIFTOUT(paddr, BWI_DESC32_A_FUNC_MASK); diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index 238469751da..4b502468fea 100644 --- a/sys/dev/pci/if_iwm.c +++ b/sys/dev/pci/if_iwm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.324 2021/05/12 10:05:57 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.325 2021/05/16 15:10:20 deraadt Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -3730,7 +3730,7 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iwm_nvm_section *sections) phy_sku = (const uint16_t *) sections[IWM_NVM_SECTION_TYPE_PHY_SKU].data; } else { - panic("unknown device family %d\n", sc->sc_device_family); + panic("unknown device family %d", sc->sc_device_family); } sw = (const uint16_t *)sections[IWM_NVM_SECTION_TYPE_SW].data; @@ -7636,7 +7636,7 @@ iwm_mac_ctxt_cmd_common(struct iwm_softc *sc, struct iwm_node *in, else if (ic->ic_opmode == IEEE80211_M_STA) cmd->mac_type = htole32(IWM_FW_MAC_TYPE_BSS_STA); else - panic("unsupported operating mode %d\n", ic->ic_opmode); + panic("unsupported operating mode %d", ic->ic_opmode); cmd->tsf_id = htole32(IWM_TSF_ID_A); IEEE80211_ADDR_COPY(cmd->node_addr, ic->ic_myaddr); diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c index ef2ffdeb56a..a37ba57c905 100644 --- a/sys/dev/pci/if_iwx.c +++ b/sys/dev/pci/if_iwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwx.c,v 1.55 2021/05/06 09:19:28 stsp Exp $ */ +/* $OpenBSD: if_iwx.c,v 1.56 2021/05/16 15:10:20 deraadt Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -5847,7 +5847,7 @@ iwx_mac_ctxt_cmd_common(struct iwx_softc *sc, struct iwx_node *in, else if (ic->ic_opmode == IEEE80211_M_STA) cmd->mac_type = htole32(IWX_FW_MAC_TYPE_BSS_STA); else - panic("unsupported operating mode %d\n", ic->ic_opmode); + panic("unsupported operating mode %d", ic->ic_opmode); cmd->tsf_id = htole32(IWX_TSF_ID_A); IEEE80211_ADDR_COPY(cmd->node_addr, ic->ic_myaddr); diff --git a/sys/dev/pv/if_hvn.c b/sys/dev/pv/if_hvn.c index f12e2f935ca..621c78a296e 100644 --- a/sys/dev/pv/if_hvn.c +++ b/sys/dev/pv/if_hvn.c @@ -641,7 +641,7 @@ hvn_txeof(struct hvn_softc *sc, uint64_t tid) txd = &sc->sc_tx_desc[id]; if ((m = txd->txd_buf) == NULL) - panic("%s: no mbuf @%u\n", sc->sc_dev.dv_xname, id); + panic("%s: no mbuf @%u", sc->sc_dev.dv_xname, id); txd->txd_buf = NULL; bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap, 0, 0, diff --git a/sys/dev/pv/virtio.c b/sys/dev/pv/virtio.c index 35bdd61d254..633832207d0 100644 --- a/sys/dev/pv/virtio.c +++ b/sys/dev/pv/virtio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: virtio.c,v 1.19 2019/05/26 15:20:04 sf Exp $ */ +/* $OpenBSD: virtio.c,v 1.20 2021/05/16 15:10:20 deraadt Exp $ */ /* $NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $ */ /* @@ -152,7 +152,7 @@ virtio_reinit_start(struct virtio_softc *sc) if (n == 0) /* vq disappeared */ continue; if (n != vq->vq_num) { - panic("%s: virtqueue size changed, vq index %d\n", + panic("%s: virtqueue size changed, vq index %d", sc->sc_dev.dv_xname, vq->vq_index); } virtio_init_vq(sc, vq); @@ -608,7 +608,7 @@ virtio_enqueue(struct virtqueue *vq, int slot, bus_dmamap_t dmamap, int write) dmamap->dm_segs[i].ds_len); } #endif - panic("dmamap->dm_nseg %d > vq->vq_maxnsegs %d\n", + panic("dmamap->dm_nseg %d > vq->vq_maxnsegs %d", dmamap->dm_nsegs, vq->vq_maxnsegs); } diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 0ffaeb86ca0..e31a72f4fbd 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.418 2021/02/08 11:20:03 stsp Exp $ */ +/* $OpenBSD: softraid.c,v 1.419 2021/05/16 15:10:19 deraadt Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom * Copyright (c) 2008 Chris Kuethe @@ -837,8 +837,8 @@ sr_meta_opt_load(struct sr_softc *sc, struct sr_metadata *sm, SR_OLD_META_OPT_SIZE - MD5_DIGEST_LENGTH); if (bcmp(&checksum, (void *)omh + SR_OLD_META_OPT_MD5, sizeof(checksum))) - panic("%s: invalid optional metadata " - "checksum", DEVNAME(sc)); + panic("%s: invalid optional metadata checksum", + DEVNAME(sc)); /* Determine correct length. */ switch (omh->som_type) { @@ -853,8 +853,8 @@ sr_meta_opt_load(struct sr_softc *sc, struct sr_metadata *sm, sizeof(struct sr_meta_keydisk); break; default: - panic("unknown old optional metadata " - "type %u\n", omh->som_type); + panic("unknown old optional metadata type %u", + omh->som_type); } omi->omi_som = malloc(omh->som_length, M_DEVBUF, @@ -4209,7 +4209,7 @@ sr_schedule_wu(struct sr_workunit *wu) goto start; if (wu->swu_state != SR_WU_INPROGRESS) - panic("sr_schedule_wu: work unit not in progress (state %i)\n", + panic("sr_schedule_wu: work unit not in progress (state %i)", wu->swu_state); /* Walk queue backwards and fill in collider if we have one. */ @@ -4341,8 +4341,8 @@ sr_set_chunk_state(struct sr_discipline *sd, int c, int new_state) default: die: splx(s); /* XXX */ - panic("%s: %s: %s: invalid chunk state transition " - "%d -> %d", DEVNAME(sd->sd_sc), + panic("%s: %s: %s: invalid chunk state transition %d -> %d", + DEVNAME(sd->sd_sc), sd->sd_meta->ssd_devname, sd->sd_vol.sv_chunks[c]->src_meta.scmi.scm_devname, old_state, new_state); @@ -4407,8 +4407,8 @@ sr_set_vol_state(struct sr_discipline *sd) default: die: - panic("%s: %s: invalid volume state transition " - "%d -> %d", DEVNAME(sd->sd_sc), + panic("%s: %s: invalid volume state transition %d -> %d", + DEVNAME(sd->sd_sc), sd->sd_meta->ssd_devname, old_state, new_state); /* NOTREACHED */ diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index f487cab77db..6d704d80d11 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_malloc.c,v 1.145 2021/04/21 10:02:05 mpi Exp $ */ +/* $OpenBSD: kern_malloc.c,v 1.146 2021/05/16 15:10:20 deraadt Exp $ */ /* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */ /* @@ -196,7 +196,7 @@ malloc(size_t size, int type, int flags) return (NULL); } else panic("malloc: allocation too large, " - "type = %d, size = %lu\n", type, size); + "type = %d, size = %lu", type, size); } indx = BUCKETINDX(size); diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 0e584e0e1fb..b1cff96396b 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_prf.c,v 1.102 2020/11/28 17:53:05 deraadt Exp $ */ +/* $OpenBSD: subr_prf.c,v 1.103 2021/05/16 15:10:20 deraadt Exp $ */ /* $NetBSD: subr_prf.c,v 1.45 1997/10/24 18:14:25 chuck Exp $ */ /*- @@ -869,7 +869,7 @@ reswitch: switch (ch) { base = DEC; goto number; case 'n': - panic("no %%n support\n"); + panic("no %%n support"); break; case 'O': flags |= LONGINT; diff --git a/sys/kern/tty.c b/sys/kern/tty.c index e8144b76ce0..169c3d1cdf7 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.167 2021/02/08 10:51:02 mpi Exp $ */ +/* $OpenBSD: tty.c,v 1.168 2021/05/16 15:10:20 deraadt Exp $ */ /* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */ /*- @@ -1953,8 +1953,8 @@ ttyrub(int c, struct tty *tp) (void)ttyoutput('\b', tp); break; default: /* XXX */ -#define PANICSTR "ttyrub: would panic c = %d, val = %d\n" - (void)printf(PANICSTR, c, CCLASS(c)); +#define PANICSTR "ttyrub: would panic c = %d, val = %d" + (void)printf(PANICSTR "\n", c, CCLASS(c)); #ifdef notdef panic(PANICSTR, c, CCLASS(c)); #endif diff --git a/sys/net/if_etherip.c b/sys/net/if_etherip.c index 4a2a6592afa..57eb95a6242 100644 --- a/sys/net/if_etherip.c +++ b/sys/net/if_etherip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_etherip.c,v 1.48 2021/01/09 21:00:58 gnezdo Exp $ */ +/* $OpenBSD: if_etherip.c,v 1.49 2021/05/16 15:10:20 deraadt Exp $ */ /* * Copyright (c) 2015 Kazuya GODA * @@ -793,7 +793,7 @@ etherip_ip_cmp(int af, const union etherip_addr *a, const union etherip_addr *b) return (memcmp(&a->in4, &b->in4, sizeof(a->in4))); break; default: - panic("%s: unsupported af %d\n", __func__, af); + panic("%s: unsupported af %d", __func__, af); } return (0); diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 43b712ee7e6..93e99a79650 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gif.c,v 1.132 2021/02/20 04:58:29 dlg Exp $ */ +/* $OpenBSD: if_gif.c,v 1.133 2021/05/16 15:10:20 deraadt Exp $ */ /* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */ /* @@ -910,7 +910,7 @@ gif_ip_cmp(int af, const union gif_addr *a, const union gif_addr *b) case AF_INET: return (memcmp(&a->in4, &b->in4, sizeof(a->in4))); default: - panic("%s: unsupported af %d\n", __func__, af); + panic("%s: unsupported af %d", __func__, af); } return (0); diff --git a/sys/net/if_wg.c b/sys/net/if_wg.c index 7bdf5ff36c6..18333eda4cb 100644 --- a/sys/net/if_wg.c +++ b/sys/net/if_wg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wg.c,v 1.16 2021/03/10 10:21:48 jsg Exp $ */ +/* $OpenBSD: if_wg.c,v 1.17 2021/05/16 15:10:20 deraadt Exp $ */ /* * Copyright (C) 2015-2020 Jason A. Donenfeld . All Rights Reserved. @@ -1356,7 +1356,7 @@ wg_handshake(struct wg_softc *sc, struct mbuf *m) &t->t_endpoint); goto error; } else if (res != 0) { - panic("unexpected response: %d\n", res); + panic("unexpected response: %d", res); } if (noise_consume_initiation(&sc->sc_local, &remote, @@ -1392,7 +1392,7 @@ wg_handshake(struct wg_softc *sc, struct mbuf *m) &t->t_endpoint); goto error; } else if (res != 0) { - panic("unexpected response: %d\n", res); + panic("unexpected response: %d", res); } if ((remote = wg_index_get(sc, resp->r_idx)) == NULL) { @@ -1532,7 +1532,7 @@ wg_encap(struct wg_softc *sc, struct mbuf *m) } else if (__predict_false(res == ESTALE)) { wg_timers_event_want_initiation(&peer->p_timers); } else if (__predict_false(res != 0)) { - panic("unexpected result: %d\n", res); + panic("unexpected result: %d", res); } /* A packet with length 0 is a keepalive packet */ @@ -1596,7 +1596,7 @@ wg_decap(struct wg_softc *sc, struct mbuf *m) } else if (__predict_false(res == ESTALE)) { wg_timers_event_want_initiation(&peer->p_timers); } else if (__predict_false(res != 0)) { - panic("unexpected response: %d\n", res); + panic("unexpected response: %d", res); } wg_peer_set_endpoint_from_tag(peer, t); diff --git a/sys/ufs/ext2fs/ext2fs_alloc.c b/sys/ufs/ext2fs/ext2fs_alloc.c index 49f375813d2..ca71d8adf98 100644 --- a/sys/ufs/ext2fs/ext2fs_alloc.c +++ b/sys/ufs/ext2fs/ext2fs_alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_alloc.c,v 1.38 2021/03/11 13:31:35 jsg Exp $ */ +/* $OpenBSD: ext2fs_alloc.c,v 1.39 2021/05/16 15:10:20 deraadt Exp $ */ /* $NetBSD: ext2fs_alloc.c,v 1.10 2001/07/05 08:38:27 toshii Exp $ */ /* @@ -368,7 +368,7 @@ ext2fs_alloccg(struct inode *ip, int cg, u_int32_t bpref, int size) gotit: #ifdef DIAGNOSTIC if (isset(bbp, bno)) { - panic("%s: dup alloc: cg=%d bno=%u fs=%s\n", + panic("%s: dup alloc: cg=%d bno=%u fs=%s", __func__, cg, bno, fs->e2fs_fsmnt); } #endif @@ -481,7 +481,7 @@ ext2fs_blkfree(struct inode *ip, u_int32_t bno) bbp = (char *)bp->b_data; bno = dtogd(fs, bno); if (isclr(bbp, bno)) - panic("%s: freeing free block: dev = 0x%x, block = %u, fs = %s\n", + panic("%s: freeing free block: dev = 0x%x, block = %u, fs = %s", __func__, ip->i_dev, bno, fs->e2fs_fsmnt); clrbit(bbp, bno); diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c index a30c0211860..84b4e7167cc 100644 --- a/sys/uvm/uvm_km.c +++ b/sys/uvm/uvm_km.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_km.c,v 1.143 2021/03/26 13:40:05 mpi Exp $ */ +/* $OpenBSD: uvm_km.c,v 1.144 2021/05/16 15:10:20 deraadt Exp $ */ /* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */ /* @@ -988,7 +988,7 @@ km_free(void *v, size_t sz, const struct kmem_va_mode *kv, pg = PHYS_TO_VM_PAGE(pa); if (pg == NULL) { - panic("km_free: unmanaged page 0x%lx\n", pa); + panic("km_free: unmanaged page 0x%lx", pa); } TAILQ_INSERT_TAIL(&pgl, pg, pageq); }