acpi.c KNF issues

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

acpi.c KNF issues

Alexander Hall
The last changes to acpi.c introduced some knf issues.
Those, and some whitespace, are removed below.

/Alexander

Index: acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.55
diff -u -r1.55 acpi.c
--- acpi.c 30 Jun 2006 23:09:41 -0000 1.55
+++ acpi.c 6 Aug 2006 20:51:32 -0000
@@ -118,7 +118,7 @@
 }
 
 int
-acpi_gasio(struct acpi_softc *sc, int iodir, int iospace, uint64_t address,
+acpi_gasio(struct acpi_softc *sc, int iodir, int iospace, uint64_t address,
    int access_size, int len, void *buffer)
 {
  u_int8_t *pb;
@@ -137,7 +137,7 @@
  case GAS_SYSTEM_MEMORY:
  /* copy to/from system memory */
  acpi_map(address, len, &mh);
- if (iodir == ACPI_IOREAD)
+ if (iodir == ACPI_IOREAD)
  memcpy(buffer, mh.va, len);
  else
  memcpy(mh.va, buffer, len);
@@ -163,27 +163,31 @@
  case 2:
  *(uint16_t *)(pb+reg) = bus_space_read_2
     (sc->sc_iot, ioh, reg);
- dnprintf(80, "os_in16(%llx) = %x\n", reg    +address, *(uint16_t *)(pb+reg));
+ dnprintf(80, "os_in16(%llx) = %x\n", reg
+    +address, *(uint16_t *)(pb+reg));
  break;
  case 4:
- *(uint32_t *)(pb+reg) = bus_space_read_4    (sc->sc_iot, ioh, reg);
+ *(uint32_t *)(pb+reg) = bus_space_read_4
+    (sc->sc_iot, ioh, reg);
  break;
  }
  }
  else {
  switch (access_size) {
  case 1:
- bus_space_write_1(sc->sc_iot, ioh, reg,    *(uint8_t *)(pb+reg));
+ bus_space_write_1(sc->sc_iot, ioh, reg,
+    *(uint8_t *)(pb+reg));
  dnprintf(80, "os_out8(%llx,%x)\n", reg+
     address, *(uint8_t *)(pb+reg));
  break;
  case 2:
- bus_space_write_2(sc->sc_iot, ioh, reg,
+ bus_space_write_2(sc->sc_iot, ioh, reg,
     *(uint16_t *)(pb+reg));
- dnprintf(80, "os_out16(%llx,%x)\n", reg+    address, *(uint16_t *)(pb+reg));
+ dnprintf(80, "os_out16(%llx,%x)\n", reg+
+    address, *(uint16_t *)(pb+reg));
  break;
  case 4:
- bus_space_write_4(sc->sc_iot, ioh, reg,
+ bus_space_write_4(sc->sc_iot, ioh, reg,
     *(uint32_t *)(pb+reg));
  break;
  }
@@ -201,14 +205,14 @@
  break;
 
  case GAS_PCI_CFG_SPACE:
- /* format of address:
+ /* format of address:
  *    bits 00..15 = register
  *    bits 16..31 = function
  *    bits 32..47 = device
  *    bits 48..63 = bus
  */
  pc = NULL;
- tag = pci_make_tag(pc,
+ tag = pci_make_tag(pc,
     ACPI_PCI_BUS(address), ACPI_PCI_DEV(address),
     ACPI_PCI_FN(address));
 
@@ -352,7 +356,7 @@
 
  dnprintf(20, "gpe1 block len : %x\n",
     sc->sc_fadt->gpe1_blk_len >> 1);
- dnprintf(20, "gpe1 block addr: %x\n",
+ dnprintf(20, "gpe1 block addr: %x\n",
     sc->sc_fadt->gpe1_blk);
  if (reg == ACPIREG_GPE1_EN && addr) {
  addr += size;
@@ -410,7 +414,7 @@
     acpi_read_pmreg(sc, ACPIREG_PM1B_CNT, offset));
  case ACPIREG_GPE_STS:
  __size = 1;
- dnprintf(0, "read GPE_STS  offset: %.2x %.2x %.2x\n", offset,
+ dnprintf(0, "read GPE_STS  offset: %.2x %.2x %.2x\n", offset,
     sc->sc_fadt->gpe0_blk_len>>1, sc->sc_fadt->gpe1_blk_len>>1);
  if (offset < (sc->sc_fadt->gpe0_blk_len >> 1)) {
  reg = ACPIREG_GPE0_STS;
@@ -418,15 +422,15 @@
  break;
  case ACPIREG_GPE_EN:
  __size = 1;
- dnprintf(0, "read GPE_EN   offset: %.2x %.2x %.2x\n",
+ dnprintf(0, "read GPE_EN   offset: %.2x %.2x %.2x\n",
     offset, sc->sc_fadt->gpe0_blk_len>>1,
     sc->sc_fadt->gpe1_blk_len>>1);
  if (offset < (sc->sc_fadt->gpe0_blk_len >> 1)) {
  reg = ACPIREG_GPE0_EN;
  }
- break;
+ break;
  }
-
+
  if (reg >= ACPIREG_MAXREG || sc->sc_pmregs[reg].size == 0)
  return (0);
 
@@ -480,7 +484,7 @@
  break;
  case ACPIREG_GPE_STS:
  __size = 1;
- dnprintf(0, "write GPE_STS offset: %.2x %.2x %.2x %.2x\n",
+ dnprintf(0, "write GPE_STS offset: %.2x %.2x %.2x %.2x\n",
     offset, sc->sc_fadt->gpe0_blk_len>>1,
     sc->sc_fadt->gpe1_blk_len>>1, regval);
  if (offset < (sc->sc_fadt->gpe0_blk_len >> 1)) {
@@ -489,13 +493,13 @@
  break;
  case ACPIREG_GPE_EN:
  __size = 1;
- dnprintf(0, "write GPE_EN  offset: %.2x %.2x %.2x %.2x\n",
+ dnprintf(0, "write GPE_EN  offset: %.2x %.2x %.2x %.2x\n",
     offset, sc->sc_fadt->gpe0_blk_len>>1,
     sc->sc_fadt->gpe1_blk_len>>1, regval);
  if (offset < (sc->sc_fadt->gpe0_blk_len >> 1)) {
  reg = ACPIREG_GPE0_EN;
  }
- break;
+ break;
  }
 
  /* All special case return here */
@@ -773,7 +777,7 @@
 
  /* Find available sleep/resume related methods. */
  acpi_init_pm(sc);
-
+
  /*
  * Set up a pointer to the firmware control structure
  */
@@ -818,7 +822,7 @@
  acpi_attach_machdep(sc);
 
  printf("\n");
-
+
  printf("%s: tables ", DEVNAME(sc));
  SIMPLEQ_FOREACH(entry, &sc->sc_tables, q_next) {
  printf("%.4s ", entry->q_table);
@@ -1108,7 +1112,7 @@
 
  /* Read enabled register */
  en = acpi_read_pmreg(sc, ACPIREG_GPE_EN, gpe>>3);
- dnprintf(0, "%sabling GPE %.2x (current: %sabled) %.2x\n",
+ dnprintf(0, "%sabling GPE %.2x (current: %sabled) %.2x\n",
     enable ? "en" : "dis", gpe, (en & mask) ? "en" : "dis", en);
  if (enable)
  en |= mask;
@@ -1363,10 +1367,10 @@
 acpi_resume(struct acpi_softc *sc)
 {
  struct aml_value res, env;
-
+
  env.type = AML_OBJTYPE_INTEGER;
  env.v_integer = sc->sc_state;
-
+
  if (sc->sc_bfs) {
  if (aml_eval_object(sc, sc->sc_pts, &res, 1, &env)) {
  dnprintf(10, "%s evaluating method _BFS failed.\n",