Module Name: src
Committed By: msaitoh
Date: Mon Jun 17 06:38:30 UTC 2019
Modified Files:
src/sys/arch/x86/pci: msipic.c pci_intr_machdep.c pcib.c
src/sys/arch/x86/x86: idt.c intr.c ioapic.c
Log Message:
KNF. No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/pci/msipic.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/x86/pci/pci_intr_machdep.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x86/pci/pcib.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x86/x86/idt.c
cvs rdiff -u -r1.145 -r1.146 src/sys/arch/x86/x86/intr.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/x86/x86/ioapic.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/pci/msipic.c
diff -u src/sys/arch/x86/pci/msipic.c:1.14 src/sys/arch/x86/pci/msipic.c:1.15
--- src/sys/arch/x86/pci/msipic.c:1.14 Mon Jun 17 05:45:46 2019
+++ src/sys/arch/x86/pci/msipic.c Mon Jun 17 06:38:29 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: msipic.c,v 1.14 2019/06/17 05:45:46 msaitoh Exp $ */
+/* $NetBSD: msipic.c,v 1.15 2019/06/17 06:38:29 msaitoh Exp $ */
/*
* Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msipic.c,v 1.14 2019/06/17 05:45:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msipic.c,v 1.15 2019/06/17 06:38:29 msaitoh Exp $");
#include "opt_intrdebug.h"
@@ -203,7 +203,7 @@ msipic_find_msi_pic_locked(int devid)
KASSERT(mutex_owned(&msipic_list_lock));
LIST_FOREACH(mpp, &msipic_list, mp_list) {
- if(mpp->mp_devid == devid)
+ if (mpp->mp_devid == devid)
return mpp->mp_pic;
}
return NULL;
@@ -645,7 +645,7 @@ msipic_construct_msix_pic(const struct p
tbl = pci_conf_read(pc, tag, off + PCI_MSIX_TBLOFFSET);
table_offset = tbl & PCI_MSIX_TBLOFFSET_MASK;
bir = tbl & PCI_MSIX_PBABIR_MASK;
- switch(bir) {
+ switch (bir) {
case 0:
bar = PCI_BAR0;
break;
@@ -665,18 +665,19 @@ msipic_construct_msix_pic(const struct p
bar = PCI_BAR5;
break;
default:
- aprint_error("detect an illegal device! The device use reserved BIR values.\n");
+ aprint_error("detect an illegal device! "
+ "The device use reserved BIR values.\n");
msipic_destruct_common_msi_pic(msix_pic);
return NULL;
}
memtype = pci_mapreg_type(pc, tag, bar);
- /*
- * PCI_MSIX_TABLE_ENTRY_SIZE consists below
- * - Vector Control (32bit)
- * - Message Data (32bit)
- * - Message Upper Address (32bit)
- * - Message Lower Address (32bit)
- */
+ /*
+ * PCI_MSIX_TABLE_ENTRY_SIZE consists below
+ * - Vector Control (32bit)
+ * - Message Data (32bit)
+ * - Message Upper Address (32bit)
+ * - Message Lower Address (32bit)
+ */
table_size = table_nentry * PCI_MSIX_TABLE_ENTRY_SIZE;
#if 0
err = pci_mapreg_submap(pa, bar, memtype, BUS_SPACE_MAP_LINEAR,
Index: src/sys/arch/x86/pci/pci_intr_machdep.c
diff -u src/sys/arch/x86/pci/pci_intr_machdep.c:1.49 src/sys/arch/x86/pci/pci_intr_machdep.c:1.50
--- src/sys/arch/x86/pci/pci_intr_machdep.c:1.49 Mon Feb 11 14:59:33 2019
+++ src/sys/arch/x86/pci/pci_intr_machdep.c Mon Jun 17 06:38:29 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_intr_machdep.c,v 1.49 2019/02/11 14:59:33 cherry Exp $ */
+/* $NetBSD: pci_intr_machdep.c,v 1.50 2019/06/17 06:38:29 msaitoh Exp $ */
/*-
* Copyright (c) 1997, 1998, 2009 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.49 2019/02/11 14:59:33 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.50 2019/06/17 06:38:29 msaitoh Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -234,7 +234,7 @@ pci_intr_string(pci_chipset_tag_t pc, pc
buf, len);
}
-#if defined(__HAVE_PCI_MSI_MSIX)
+#if defined(__HAVE_PCI_MSI_MSIX)
if (INT_VIA_MSI(ih))
return x86_pci_msi_string(pc, ih, buf, len);
#endif
@@ -266,9 +266,9 @@ pci_intr_setattr(pci_chipset_tag_t pc, p
switch (attr) {
case PCI_INTR_MPSAFE:
if (data) {
- *ih |= MPSAFE_MASK;
+ *ih |= MPSAFE_MASK;
} else {
- *ih &= ~MPSAFE_MASK;
+ *ih &= ~MPSAFE_MASK;
}
/* XXX Set live if already mapped. */
return 0;
@@ -524,7 +524,7 @@ pci_intr_alloc(const struct pci_attach_a
msi_count = 1;
intx_count = 1;
} else {
- switch(max_type) {
+ switch (max_type) {
case PCI_INTR_TYPE_MSIX:
msix_count = counts[PCI_INTR_TYPE_MSIX];
/* FALLTHROUGH */
Index: src/sys/arch/x86/pci/pcib.c
diff -u src/sys/arch/x86/pci/pcib.c:1.17 src/sys/arch/x86/pci/pcib.c:1.18
--- src/sys/arch/x86/pci/pcib.c:1.17 Mon Feb 11 14:59:33 2019
+++ src/sys/arch/x86/pci/pcib.c Mon Jun 17 06:38:29 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: pcib.c,v 1.17 2019/02/11 14:59:33 cherry Exp $ */
+/* $NetBSD: pcib.c,v 1.18 2019/06/17 06:38:29 msaitoh Exp $ */
/*-
* Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.17 2019/02/11 14:59:33 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.18 2019/06/17 06:38:29 msaitoh Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -167,7 +167,7 @@ pcibmatch(device_t parent, cfdata_t matc
clock_broken_latch = 0;
}
#endif
- return(1);
+ return (1);
}
break;
}
Index: src/sys/arch/x86/x86/idt.c
diff -u src/sys/arch/x86/x86/idt.c:1.10 src/sys/arch/x86/x86/idt.c:1.11
--- src/sys/arch/x86/x86/idt.c:1.10 Mon Feb 11 14:59:33 2019
+++ src/sys/arch/x86/x86/idt.c Mon Jun 17 06:38:30 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: idt.c,v 1.10 2019/02/11 14:59:33 cherry Exp $ */
+/* $NetBSD: idt.c,v 1.11 2019/06/17 06:38:30 msaitoh Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2009 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: idt.c,v 1.10 2019/02/11 14:59:33 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: idt.c,v 1.11 2019/06/17 06:38:30 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -77,11 +77,11 @@ __KERNEL_RCSID(0, "$NetBSD: idt.c,v 1.10
#include <machine/segments.h>
-/*
+/*
* XEN PV and native have a different idea of what idt entries should
* look like.
*/
-idt_descriptor_t *idt;
+idt_descriptor_t *idt;
static char idt_allocmap[NIDT];
@@ -92,13 +92,13 @@ void
set_idtgate(struct trap_info *xen_idd, void *function, int ist,
int type, int dpl, int sel)
{
- /*
+ /*
* Find the page boundary in which the descriptor resides.
* We make an assumption here, that the descriptor is part of
* a table (array), which fits in a page and is page aligned.
*
* This assumption is from the usecases at early startup in
- * machine/machdep.c
+ * machine/machdep.c
*
* Thus this function may not work in the "general" case of a
* randomly located idt entry template (for eg:).
@@ -109,13 +109,13 @@ set_idtgate(struct trap_info *xen_idd, v
//kpreempt_disable();
#if defined(__x86_64__)
/* Make it writeable, so we can update the values. */
- pmap_changeprot_local(xen_idt_vaddr, VM_PROT_READ|VM_PROT_WRITE);
+ pmap_changeprot_local(xen_idt_vaddr, VM_PROT_READ | VM_PROT_WRITE);
#endif /* __x86_64 */
xen_idd->cs = sel;
xen_idd->address = (unsigned long) function;
xen_idd->flags = dpl;
- /*
+ /*
* Again we make the assumption that the descriptor is
* implicitly part of an idt, which we infer as
* xen_idt_vaddr. (See above).
@@ -135,7 +135,7 @@ unset_idtgate(struct trap_info *xen_idd)
vaddr_t xen_idt_vaddr = ((vaddr_t) xen_idd) & PAGE_MASK;
/* Make it writeable, so we can update the values. */
- pmap_changeprot_local(xen_idt_vaddr, VM_PROT_READ|VM_PROT_WRITE);
+ pmap_changeprot_local(xen_idt_vaddr, VM_PROT_READ | VM_PROT_WRITE);
#endif /* __x86_64 */
/* Zero it */
Index: src/sys/arch/x86/x86/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.145 src/sys/arch/x86/x86/intr.c:1.146
--- src/sys/arch/x86/x86/intr.c:1.145 Wed Jun 5 04:31:37 2019
+++ src/sys/arch/x86/x86/intr.c Mon Jun 17 06:38:30 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.c,v 1.145 2019/06/05 04:31:37 knakahara Exp $ */
+/* $NetBSD: intr.c,v 1.146 2019/06/17 06:38:30 msaitoh Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.145 2019/06/05 04:31:37 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.146 2019/06/17 06:38:30 msaitoh Exp $");
#include "opt_intrdebug.h"
#include "opt_multiprocessor.h"
@@ -361,12 +361,13 @@ intr_calculatemasks(struct cpu_info *ci)
* by MI code and intrctl(8).
*/
const char *
-intr_create_intrid(int legacy_irq, struct pic *pic, int pin, char *buf, size_t len)
+intr_create_intrid(int legacy_irq, struct pic *pic, int pin, char *buf,
+ size_t len)
{
int ih = 0;
#if NPCI > 0
-#if defined(__HAVE_PCI_MSI_MSIX)
+#if defined(__HAVE_PCI_MSI_MSIX)
if ((pic->pic_type == PIC_MSI) || (pic->pic_type == PIC_MSIX)) {
uint64_t pih;
int dev, vec;
@@ -383,7 +384,7 @@ intr_create_intrid(int legacy_irq, struc
return x86_pci_msi_string(NULL, pih, buf, len);
}
-#endif /* __HAVE_PCI_MSI_MSIX */
+#endif /* __HAVE_PCI_MSI_MSIX */
#endif
if (pic->pic_type == PIC_XEN) {
@@ -958,10 +959,10 @@ intr_establish_xname(int legacy_irq, str
mutex_exit(&cpu_lock);
if (bootverbose || cpu_index(ci) != 0)
- aprint_verbose("allocated pic %s type %s pin %d level %d to %s slot %d "
- "idt entry %d\n",
- pic->pic_name, type == IST_EDGE ? "edge" : "level", pin, level,
- device_xname(ci->ci_dev), slot, idt_vec);
+ aprint_verbose("allocated pic %s type %s pin %d level %d to "
+ "%s slot %d idt entry %d\n",
+ pic->pic_name, type == IST_EDGE ? "edge" : "level", pin,
+ level, device_xname(ci->ci_dev), slot, idt_vec);
return (ih);
}
@@ -1033,7 +1034,8 @@ intr_disestablish_xcall(void *arg1, void
*
*/
if (source->is_handlers == NULL)
- (*pic->pic_delroute)(pic, ci, ih->ih_pin, idtvec, source->is_type);
+ (*pic->pic_delroute)(pic, ci, ih->ih_pin, idtvec,
+ source->is_type);
else
(*pic->pic_hwunmask)(pic, ih->ih_pin);
@@ -1279,7 +1281,7 @@ cpu_intr_init(struct cpu_info *ci)
*/
istack = uvm_km_alloc(kernel_map,
INTRSTACKSIZE + redzone_const_or_zero(2 * PAGE_SIZE), 0,
- UVM_KMF_WIRED|UVM_KMF_ZERO);
+ UVM_KMF_WIRED | UVM_KMF_ZERO);
if (redzone_const_or_false(true)) {
pmap_kremove(istack, PAGE_SIZE);
pmap_kremove(istack + INTRSTACKSIZE + PAGE_SIZE, PAGE_SIZE);
@@ -1334,9 +1336,10 @@ intr_printconfig(void)
isp = ci->ci_isources[i];
if (isp == NULL)
continue;
- (*pr)("%s source %d is pin %d from pic %s type %d maxlevel %d\n",
- device_xname(ci->ci_dev), i, isp->is_pin,
- isp->is_pic->pic_name, isp->is_type, isp->is_maxlevel);
+ (*pr)("%s source %d is pin %d from pic %s type %d "
+ "maxlevel %d\n", device_xname(ci->ci_dev), i,
+ isp->is_pin, isp->is_pic->pic_name, isp->is_type,
+ isp->is_maxlevel);
for (ih = isp->is_handlers; ih != NULL;
ih = ih->ih_next)
(*pr)("\thandler %p level %d\n",
@@ -1843,8 +1846,8 @@ intr_set_affinity(struct intrsource *isp
err = intr_find_unused_slot(newci, &newslot);
if (err) {
- DPRINTF(("failed to allocate interrupt slot for PIC %s intrid %s\n",
- isp->is_pic->pic_name, isp->is_intrid));
+ DPRINTF(("failed to allocate interrupt slot for PIC %s intrid "
+ "%s\n", isp->is_pic->pic_name, isp->is_intrid));
return err;
}
@@ -2123,7 +2126,8 @@ interrupt_construct_intrids(const kcpuse
return 0;
/*
- * Count the number of interrupts which affinity to any cpu of "cpuset".
+ * Count the number of interrupts which affinity to any cpu of
+ * "cpuset".
*/
count = 0;
mutex_enter(&cpu_lock);
Index: src/sys/arch/x86/x86/ioapic.c
diff -u src/sys/arch/x86/x86/ioapic.c:1.61 src/sys/arch/x86/x86/ioapic.c:1.62
--- src/sys/arch/x86/x86/ioapic.c:1.61 Fri Jun 14 09:23:42 2019
+++ src/sys/arch/x86/x86/ioapic.c Mon Jun 17 06:38:30 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ioapic.c,v 1.61 2019/06/14 09:23:42 msaitoh Exp $ */
+/* $NetBSD: ioapic.c,v 1.62 2019/06/17 06:38:30 msaitoh Exp $ */
/*-
* Copyright (c) 2000, 2009 The NetBSD Foundation, Inc.
@@ -44,11 +44,11 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.61 2019/06/14 09:23:42 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.62 2019/06/17 06:38:30 msaitoh Exp $");
#include "opt_ddb.h"