Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86 KNF. No functional change.



details:   https://anonhg.NetBSD.org/src/rev/651c4b4df583
branches:  trunk
changeset: 452051:651c4b4df583
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Jun 17 06:38:29 2019 +0000

description:
KNF. No functional change.

diffstat:

 sys/arch/x86/pci/msipic.c           |  25 ++++++++++++-----------
 sys/arch/x86/pci/pci_intr_machdep.c |  12 +++++-----
 sys/arch/x86/pci/pcib.c             |   6 ++--
 sys/arch/x86/x86/idt.c              |  18 ++++++++--------
 sys/arch/x86/x86/intr.c             |  38 ++++++++++++++++++++----------------
 sys/arch/x86/x86/ioapic.c           |  14 ++++++------
 6 files changed, 59 insertions(+), 54 deletions(-)

diffs (truncated from 359 to 300 lines):

diff -r f3977dff3153 -r 651c4b4df583 sys/arch/x86/pci/msipic.c
--- a/sys/arch/x86/pci/msipic.c Mon Jun 17 06:33:53 2019 +0000
+++ b/sys/arch/x86/pci/msipic.c Mon Jun 17 06:38:29 2019 +0000
@@ -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 @@
        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 @@
        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 @@
                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,
diff -r f3977dff3153 -r 651c4b4df583 sys/arch/x86/pci/pci_intr_machdep.c
--- a/sys/arch/x86/pci/pci_intr_machdep.c       Mon Jun 17 06:33:53 2019 +0000
+++ b/sys/arch/x86/pci/pci_intr_machdep.c       Mon Jun 17 06:38:29 2019 +0000
@@ -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 @@
                    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 @@
        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 @@
                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 */
diff -r f3977dff3153 -r 651c4b4df583 sys/arch/x86/pci/pcib.c
--- a/sys/arch/x86/pci/pcib.c   Mon Jun 17 06:33:53 2019 +0000
+++ b/sys/arch/x86/pci/pcib.c   Mon Jun 17 06:38:29 2019 +0000
@@ -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 @@
                                clock_broken_latch = 0;
                        }
 #endif
-                       return(1);
+                       return (1);
                }
                break;
        }
diff -r f3977dff3153 -r 651c4b4df583 sys/arch/x86/x86/idt.c
--- a/sys/arch/x86/x86/idt.c    Mon Jun 17 06:33:53 2019 +0000
+++ b/sys/arch/x86/x86/idt.c    Mon Jun 17 06:38:29 2019 +0000
@@ -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 @@
 
 #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 @@
 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 @@
        //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 @@
        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 */
diff -r f3977dff3153 -r 651c4b4df583 sys/arch/x86/x86/intr.c
--- a/sys/arch/x86/x86/intr.c   Mon Jun 17 06:33:53 2019 +0000
+++ b/sys/arch/x86/x86/intr.c   Mon Jun 17 06:38:29 2019 +0000
@@ -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 @@
  * 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 @@
 
                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 @@
        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 @@
         *
         */
        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 @@
         */
        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 @@
                        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);



Home | Main Index | Thread Index | Old Index