Module Name: src Committed By: uebayasi Date: Sun Nov 14 05:31:59 UTC 2010
Modified Files: src/sys/dev/pci: twe.c Log Message: Avoid pointless use of a sysctl definition, CTL_NAMES. Clean up whitespace. To generate a diff of this commit: cvs rdiff -u -r1.92 -r1.93 src/sys/dev/pci/twe.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/dev/pci/twe.c diff -u src/sys/dev/pci/twe.c:1.92 src/sys/dev/pci/twe.c:1.93 --- src/sys/dev/pci/twe.c:1.92 Sat Nov 13 13:52:08 2010 +++ src/sys/dev/pci/twe.c Sun Nov 14 05:31:59 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: twe.c,v 1.92 2010/11/13 13:52:08 uebayasi Exp $ */ +/* $NetBSD: twe.c,v 1.93 2010/11/14 05:31:59 uebayasi Exp $ */ /*- * Copyright (c) 2000, 2001, 2002, 2003, 2004 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: twe.c,v 1.92 2010/11/13 13:52:08 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: twe.c,v 1.93 2010/11/14 05:31:59 uebayasi Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -315,8 +315,7 @@ int s, size, i, rv, rseg; size_t max_segs, max_xfer; bus_dma_segment_t seg; - struct ctlname ctlnames[] = CTL_NAMES; - const struct sysctlnode *node; + const struct sysctlnode *node; struct twe_cmd *tc; struct twe_ccb *ccb; @@ -364,7 +363,7 @@ /* * Allocate and initialise the command blocks and CCBs. */ - size = sizeof(struct twe_cmd) * TWE_MAX_QUEUECNT; + size = sizeof(struct twe_cmd) * TWE_MAX_QUEUECNT; if ((rv = bus_dmamem_alloc(sc->sc_dmat, size, PAGE_SIZE, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) { @@ -462,26 +461,26 @@ NULL, NULL, 0, NULL, 0, CTL_HW, CTL_EOL) != 0) { aprint_error_dev(&sc->sc_dv, "could not create %s sysctl node\n", - ctlnames[CTL_HW].ctl_name); + "hw"); return; } if (sysctl_createv(NULL, 0, NULL, &node, - 0, CTLTYPE_NODE, device_xname(&sc->sc_dv), - SYSCTL_DESCR("twe driver information"), - NULL, 0, NULL, 0, + 0, CTLTYPE_NODE, device_xname(&sc->sc_dv), + SYSCTL_DESCR("twe driver information"), + NULL, 0, NULL, 0, CTL_HW, CTL_CREATE, CTL_EOL) != 0) { - aprint_error_dev(&sc->sc_dv, "could not create %s.%s sysctl node\n", - ctlnames[CTL_HW].ctl_name, device_xname(&sc->sc_dv)); + aprint_error_dev(&sc->sc_dv, "could not create %s.%s sysctl node\n", + "hw", device_xname(&sc->sc_dv)); return; } if ((i = sysctl_createv(NULL, 0, NULL, NULL, - 0, CTLTYPE_STRING, "driver_version", - SYSCTL_DESCR("twe0 driver version"), - NULL, 0, &twever, 0, + 0, CTLTYPE_STRING, "driver_version", + SYSCTL_DESCR("twe0 driver version"), + NULL, 0, &twever, 0, CTL_HW, node->sysctl_num, CTL_CREATE, CTL_EOL)) != 0) { - aprint_error_dev(&sc->sc_dv, "could not create %s.%s.driver_version sysctl\n", - ctlnames[CTL_HW].ctl_name, device_xname(&sc->sc_dv)); + aprint_error_dev(&sc->sc_dv, "could not create %s.%s.driver_version sysctl\n", + "hw", device_xname(&sc->sc_dv)); return; } }