Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Nov 2009 11:07:42 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r198786 - in head/sys: compat/ndis dev/if_ndis
Message-ID:  <200911021107.nA2B7gP4054855@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Mon Nov  2 11:07:42 2009
New Revision: 198786
URL: http://svn.freebsd.org/changeset/base/198786

Log:
  Big style cleanup. While there remove references to FreeBSD versions
  older than 6.0.
  
  Submitted by:	Paul B Mahol <onemda at gmail.com>

Modified:
  head/sys/compat/ndis/kern_ndis.c
  head/sys/compat/ndis/kern_windrv.c
  head/sys/compat/ndis/subr_hal.c
  head/sys/compat/ndis/subr_ndis.c
  head/sys/compat/ndis/subr_ntoskrnl.c
  head/sys/compat/ndis/subr_pe.c
  head/sys/compat/ndis/subr_usbd.c
  head/sys/dev/if_ndis/if_ndis.c
  head/sys/dev/if_ndis/if_ndis_usb.c

Modified: head/sys/compat/ndis/kern_ndis.c
==============================================================================
--- head/sys/compat/ndis/kern_ndis.c	Mon Nov  2 09:56:46 2009	(r198785)
+++ head/sys/compat/ndis/kern_ndis.c	Mon Nov  2 11:07:42 2009	(r198786)
@@ -184,7 +184,7 @@ ndis_modevent(module_t mod, int cmd, voi
 		break;
 	}
 
-	return(error);
+	return (error);
 }
 DEV_MODULE(ndisapi, ndis_modevent, NULL);
 MODULE_VERSION(ndisapi, 1);
@@ -193,7 +193,6 @@ static void
 ndis_sendrsrcavail_func(adapter)
 	ndis_handle		adapter;
 {
-	return;
 }
 
 static void
@@ -211,8 +210,7 @@ ndis_status_func(adapter, status, sbuf, 
 	sc = device_get_softc(block->nmb_physdeviceobj->do_devext);
 	ifp = sc->ifp;
 	if (ifp->if_flags & IFF_DEBUG)
-		device_printf (sc->ndis_dev, "status: %x\n", status);
-	return;
+		device_printf(sc->ndis_dev, "status: %x\n", status);
 }
 
 static void
@@ -227,8 +225,7 @@ ndis_statusdone_func(adapter)
 	sc = device_get_softc(block->nmb_physdeviceobj->do_devext);
 	ifp = sc->ifp;
 	if (ifp->if_flags & IFF_DEBUG)
-		device_printf (sc->ndis_dev, "status complete\n");
-	return;
+		device_printf(sc->ndis_dev, "status complete\n");
 }
 
 static void
@@ -241,7 +238,6 @@ ndis_setdone_func(adapter, status)
 
 	block->nmb_setstat = status;
 	KeSetEvent(&block->nmb_setevent, IO_NO_INCREMENT, FALSE);
-	return;
 }
 
 static void
@@ -254,7 +250,6 @@ ndis_getdone_func(adapter, status)
 
 	block->nmb_getstat = status;
 	KeSetEvent(&block->nmb_getevent, IO_NO_INCREMENT, FALSE);
-	return;
 }
 
 static void
@@ -270,10 +265,8 @@ ndis_resetdone_func(ndis_handle adapter,
 	ifp = sc->ifp;
 
 	if (ifp->if_flags & IFF_DEBUG)
-		device_printf (sc->ndis_dev, "reset done...\n");
+		device_printf(sc->ndis_dev, "reset done...\n");
 	KeSetEvent(&block->nmb_resetevent, IO_NO_INCREMENT, FALSE);
-
-	return;
 }
 
 int
@@ -287,7 +280,7 @@ ndis_create_sysctls(arg)
 	struct sysctl_ctx_entry	*e;
 
 	if (arg == NULL)
-		return(EINVAL);
+		return (EINVAL);
 
 	sc = arg;
 	vals = sc->ndis_regvals;
@@ -367,7 +360,7 @@ ndis_create_sysctls(arg)
 		    "Interrupt Number", buf, CTLFLAG_RD);
 	}
 
-	return(0);
+	return (0);
 }
 
 int
@@ -388,7 +381,7 @@ ndis_add_sysctl(arg, key, desc, val, fla
 
 	if (cfg == NULL) {
 		printf("failed for %s\n", key);
-		return(ENOMEM);
+		return (ENOMEM);
 	}
 
 	cfg->ndis_cfg.nc_cfgkey = strdup(key, M_DEVBUF);
@@ -415,7 +408,7 @@ ndis_add_sysctl(arg, key, desc, val, fla
 	    cfg->ndis_cfg.nc_cfgdesc);
 #endif
 
-	return(0);
+	return (0);
 }
 
 /*
@@ -451,7 +444,7 @@ ndis_flush_sysctls(arg)
 		free(cfg, M_DEVBUF);
 	}
 
-	return(0);
+	return (0);
 }
 
 static void
@@ -488,8 +481,6 @@ ndis_return(dobj, arg)
 		KeAcquireSpinLock(&block->nmb_returnlock, &irql);
 	}
 	KeReleaseSpinLock(&block->nmb_returnlock, irql);
-
-	return;
 }
 
 void
@@ -522,8 +513,6 @@ ndis_return_packet(buf, arg)
 	IoQueueWorkItem(block->nmb_returnitem,
 	    (io_workitem_func)kernndis_functbl[7].ipt_wrap,
 	    WORKQUEUE_CRITICAL, block);
-
-	return;
 }
 
 void
@@ -540,8 +529,6 @@ ndis_free_bufs(b0)
 		IoFreeMdl(b0);
 		b0 = next;
 	}
-
-	return;
 }
 
 void
@@ -553,7 +540,6 @@ ndis_free_packet(p)
 
 	ndis_free_bufs(p->np_private.npp_head);
 	NdisFreePacket(p);
-	return;
 }
 
 int
@@ -567,26 +553,18 @@ ndis_convert_res(arg)
 	device_t		dev;
 	struct resource_list	*brl;
 	struct resource_list_entry	*brle;
-#if __FreeBSD_version < 600022
-	struct resource_list	brl_rev;
-	struct resource_list_entry	*n;
-#endif
 	int			error = 0;
 
 	sc = arg;
 	block = sc->ndis_block;
 	dev = sc->ndis_dev;
 
-#if __FreeBSD_version < 600022
-	SLIST_INIT(&brl_rev);
-#endif
-
 	rl = malloc(sizeof(ndis_resource_list) +
 	    (sizeof(cm_partial_resource_desc) * (sc->ndis_rescnt - 1)),
 	    M_DEVBUF, M_NOWAIT|M_ZERO);
 
 	if (rl == NULL)
-		return(ENOMEM);
+		return (ENOMEM);
 
 	rl->cprl_version = 5;
 	rl->cprl_version = 1;
@@ -597,37 +575,7 @@ ndis_convert_res(arg)
 
 	if (brl != NULL) {
 
-#if __FreeBSD_version < 600022
-		/*
-		 * We have a small problem. Some PCI devices have
-		 * multiple I/O ranges. Windows orders them starting
-		 * from lowest numbered BAR to highest. We discover
-		 * them in that order too, but insert them into a singly
-		 * linked list head first, which means when time comes
-		 * to traverse the list, we enumerate them in reverse
-		 * order. This screws up some drivers which expect the
-		 * BARs to be in ascending order so that they can choose
-		 * the "first" one as their register space. Unfortunately,
-		 * in order to fix this, we have to create our own
-		 * temporary list with the entries in reverse order.
-		 */
-
-		SLIST_FOREACH(brle, brl, link) {
-			n = malloc(sizeof(struct resource_list_entry),
-			    M_TEMP, M_NOWAIT);
-			if (n == NULL) {
-				error = ENOMEM;
-				goto bad;
-			}
-			bcopy((char *)brle, (char *)n,
-			    sizeof(struct resource_list_entry));
-			SLIST_INSERT_HEAD(&brl_rev, n, link);
-		}
-
-		SLIST_FOREACH(brle, &brl_rev, link) {
-#else
 		STAILQ_FOREACH(brle, brl, link) {
-#endif
 			switch (brle->type) {
 			case SYS_RES_IOPORT:
 				prd->cprd_type = CmResourceTypePort;
@@ -671,17 +619,7 @@ ndis_convert_res(arg)
 
 	block->nmb_rlist = rl;
 
-#if __FreeBSD_version < 600022
-bad:
-
-	while (!SLIST_EMPTY(&brl_rev)) {
-		n = SLIST_FIRST(&brl_rev);
-		SLIST_REMOVE_HEAD(&brl_rev, link);
-		free (n, M_TEMP);
-	}
-#endif
-
-	return(error);
+	return (error);
 }
 
 /*
@@ -711,7 +649,7 @@ ndis_ptom(m0, p)
 	int			diff;
 
 	if (p == NULL || m0 == NULL)
-		return(EINVAL);
+		return (EINVAL);
 
 	priv = &p->np_private;
 	buf = priv->npp_head;
@@ -729,7 +667,7 @@ ndis_ptom(m0, p)
 		if (m == NULL) {
 			m_freem(*m0);
 			*m0 = NULL;
-			return(ENOBUFS);
+			return (ENOBUFS);
 		}
 		m->m_len = MmGetMdlByteCount(buf);
 		m->m_data = MmGetMdlVirtualAddress(buf);
@@ -765,7 +703,7 @@ ndis_ptom(m0, p)
 	}
 	(*m0)->m_pkthdr.len = totlen;
 
-	return(0);
+	return (0);
 }
 
 /*
@@ -793,7 +731,7 @@ ndis_mtop(m0, p)
 	ndis_packet_private	*priv;
 
 	if (p == NULL || *p == NULL || m0 == NULL)
-		return(EINVAL);
+		return (EINVAL);
 
 	priv = &(*p)->np_private;
 	priv->npp_totlen = m0->m_pkthdr.len;
@@ -805,7 +743,7 @@ ndis_mtop(m0, p)
 		if (buf == NULL) {
 			ndis_free_packet(*p);
 			*p = NULL;
-			return(ENOMEM);
+			return (ENOMEM);
 		}
 		MmBuildMdlForNonPagedPool(buf);
 
@@ -818,7 +756,7 @@ ndis_mtop(m0, p)
 
 	priv->npp_tail = buf;
 
-	return(0);
+	return (0);
 }
 
 int
@@ -831,25 +769,25 @@ ndis_get_supported_oids(arg, oids, oidcn
 	ndis_oid		*o;
 
 	if (arg == NULL || oids == NULL || oidcnt == NULL)
-		return(EINVAL);
+		return (EINVAL);
 	len = 0;
 	ndis_get_info(arg, OID_GEN_SUPPORTED_LIST, NULL, &len);
 
 	o = malloc(len, M_DEVBUF, M_NOWAIT);
 	if (o == NULL)
-		return(ENOMEM);
+		return (ENOMEM);
 
 	rval = ndis_get_info(arg, OID_GEN_SUPPORTED_LIST, o, &len);
 
 	if (rval) {
 		free(o, M_DEVBUF);
-		return(rval);
+		return (rval);
 	}
 
 	*oids = o;
 	*oidcnt = len / 4;
 
-	return(0);
+	return (0);
 }
 
 int
@@ -893,7 +831,7 @@ ndis_set_info(arg, oid, buf, buflen)
 	    sc->ndis_block->nmb_devicectx == NULL) {
 		sc->ndis_block->nmb_pendingreq = NULL;
 		KeReleaseSpinLock(&sc->ndis_block->nmb_lock, irql);
-		return(ENXIO);
+		return (ENXIO);
 	}
 
 	rval = MSCALL6(setfunc, adapter, oid, buf, *buflen,
@@ -917,19 +855,19 @@ ndis_set_info(arg, oid, buf, buflen)
 		*buflen = bytesneeded;
 
 	if (rval == NDIS_STATUS_INVALID_LENGTH)
-		return(ENOSPC);
+		return (ENOSPC);
 
 	if (rval == NDIS_STATUS_INVALID_OID)
-		return(EINVAL);
+		return (EINVAL);
 
 	if (rval == NDIS_STATUS_NOT_SUPPORTED ||
 	    rval == NDIS_STATUS_NOT_ACCEPTED)
-		return(ENOTSUP);
+		return (ENOTSUP);
 
 	if (rval != NDIS_STATUS_SUCCESS)
-		return(ENODEV);
+		return (ENODEV);
 
-	return(0);
+	return (0);
 }
 
 typedef void (*ndis_senddone_func)(ndis_handle, ndis_packet *, ndis_status);
@@ -951,7 +889,7 @@ ndis_send_packets(arg, packets, cnt)
 	sc = arg;
 	adapter = sc->ndis_block->nmb_miniportadapterctx;
 	if (adapter == NULL)
-		return(ENXIO);
+		return (ENXIO);
 	sendfunc = sc->ndis_chars->nmc_sendmulti_func;
 	senddonefunc = sc->ndis_block->nmb_senddone_func;
 
@@ -976,7 +914,7 @@ ndis_send_packets(arg, packets, cnt)
 	if (NDIS_SERIALIZED(sc->ndis_block))
 		KeReleaseSpinLock(&sc->ndis_block->nmb_lock, irql);
 
-	return(0);
+	return (0);
 }
 
 int
@@ -994,7 +932,7 @@ ndis_send_packet(arg, packet)
 	sc = arg;
 	adapter = sc->ndis_block->nmb_miniportadapterctx;
 	if (adapter == NULL)
-		return(ENXIO);
+		return (ENXIO);
 	sendfunc = sc->ndis_chars->nmc_sendsingle_func;
 	senddonefunc = sc->ndis_block->nmb_senddone_func;
 
@@ -1006,7 +944,7 @@ ndis_send_packet(arg, packet)
 	if (status == NDIS_STATUS_PENDING) {
 		if (NDIS_SERIALIZED(sc->ndis_block))
 			KeReleaseSpinLock(&sc->ndis_block->nmb_lock, irql);
-		return(0);
+		return (0);
 	}
 
 	MSCALL3(senddonefunc, sc->ndis_block, packet, status);
@@ -1014,7 +952,7 @@ ndis_send_packet(arg, packet)
 	if (NDIS_SERIALIZED(sc->ndis_block))
 		KeReleaseSpinLock(&sc->ndis_block->nmb_lock, irql);
 
-	return(0);
+	return (0);
 }
 
 int
@@ -1030,18 +968,18 @@ ndis_init_dma(arg)
 	    M_DEVBUF, M_NOWAIT|M_ZERO);
 
 	if (sc->ndis_tmaps == NULL)
-		return(ENOMEM);
+		return (ENOMEM);
 
 	for (i = 0; i < sc->ndis_maxpkts; i++) {
 		error = bus_dmamap_create(sc->ndis_ttag, 0,
 		    &sc->ndis_tmaps[i]);
 		if (error) {
 			free(sc->ndis_tmaps, M_DEVBUF);
-			return(ENODEV);
+			return (ENODEV);
 		}
 	}
 
-	return(0);
+	return (0);
 }
 
 int
@@ -1070,7 +1008,7 @@ ndis_destroy_dma(arg)
 
 	bus_dma_tag_destroy(sc->ndis_ttag);
 
-	return(0);
+	return (0);
 }
 
 int
@@ -1093,7 +1031,7 @@ ndis_reset_nic(arg)
 	if (adapter == NULL || resetfunc == NULL ||
 	    sc->ndis_block->nmb_devicectx == NULL) {
 		NDIS_UNLOCK(sc);
-		return(EIO);
+		return (EIO);
 	}
 
 	NDIS_UNLOCK(sc);
@@ -1112,7 +1050,7 @@ ndis_reset_nic(arg)
 		KeWaitForSingleObject(&sc->ndis_block->nmb_resetevent,
 		    0, 0, FALSE, NULL);
 
-	return(0);
+	return (0);
 }
 
 int
@@ -1149,7 +1087,7 @@ ndis_halt_nic(arg)
 	adapter = sc->ndis_block->nmb_miniportadapterctx;
 	if (adapter == NULL) {
 		NDIS_UNLOCK(sc);
-		return(EIO);
+		return (EIO);
 	}
 
 	sc->ndis_block->nmb_devicectx = NULL;
@@ -1169,7 +1107,7 @@ ndis_halt_nic(arg)
 	sc->ndis_block->nmb_miniportadapterctx = NULL;
 	NDIS_UNLOCK(sc);
 
-	return(0);
+	return (0);
 }
 
 int
@@ -1186,7 +1124,7 @@ ndis_shutdown_nic(arg)
 	shutdownfunc = sc->ndis_chars->nmc_shutdown_handler;
 	NDIS_UNLOCK(sc);
 	if (adapter == NULL || shutdownfunc == NULL)
-		return(EIO);
+		return (EIO);
 
 	if (sc->ndis_chars->nmc_rsvd0 == NULL)
 		MSCALL1(shutdownfunc, adapter);
@@ -1195,7 +1133,7 @@ ndis_shutdown_nic(arg)
 
 	TAILQ_REMOVE(&ndis_devhead, sc->ndis_block, link);
 
-	return(0);
+	return (0);
 }
 
 int
@@ -1215,7 +1153,7 @@ ndis_pnpevent_nic(arg, type)
 	pnpeventfunc = sc->ndis_chars->nmc_pnpevent_handler;
 	NDIS_UNLOCK(sc);
 	if (adapter == NULL || pnpeventfunc == NULL)
-		return(EIO);
+		return (EIO);
 
 	if (sc->ndis_chars->nmc_rsvd0 == NULL)
 		MSCALL4(pnpeventfunc, adapter, type, NULL, 0);
@@ -1237,7 +1175,7 @@ ndis_init_nic(arg)
 	uint32_t		chosenmedium, i;
 
 	if (arg == NULL)
-		return(EINVAL);
+		return (EINVAL);
 
 	sc = arg;
 	NDIS_LOCK(sc);
@@ -1262,7 +1200,7 @@ ndis_init_nic(arg)
 		NDIS_LOCK(sc);
 		sc->ndis_block->nmb_miniportadapterctx = NULL;
 		NDIS_UNLOCK(sc);
-		return(ENXIO);
+		return (status);
 	}
 
 	/*
@@ -1281,7 +1219,7 @@ ndis_init_nic(arg)
 	sc->ndis_block->nmb_devicectx = sc;
 	NDIS_UNLOCK(sc);
 
-	return(0);
+	return (0);
 }
 
 static void
@@ -1305,8 +1243,6 @@ ndis_intrsetup(dpc, dobj, ip, sc)
 	if (KeInsertQueueDpc(&intr->ni_dpc, NULL, NULL) == TRUE)
 		intr->ni_dpccnt++;
 	KeReleaseSpinLockFromDpcLevel(&intr->ni_dpccountlock);
-
-	return;
 }
 
 int
@@ -1343,7 +1279,7 @@ ndis_get_info(arg, oid, buf, buflen)
 	    sc->ndis_block->nmb_devicectx == NULL) {
 		sc->ndis_block->nmb_pendingreq = NULL;
 		KeReleaseSpinLock(&sc->ndis_block->nmb_lock, irql);
-		return(ENXIO);
+		return (ENXIO);
 	}
 
 	rval = MSCALL6(queryfunc, adapter, oid, buf, *buflen,
@@ -1370,19 +1306,19 @@ ndis_get_info(arg, oid, buf, buflen)
 
 	if (rval == NDIS_STATUS_INVALID_LENGTH ||
 	    rval == NDIS_STATUS_BUFFER_TOO_SHORT)
-		return(ENOSPC);
+		return (ENOSPC);
 
 	if (rval == NDIS_STATUS_INVALID_OID)
-		return(EINVAL);
+		return (EINVAL);
 
 	if (rval == NDIS_STATUS_NOT_SUPPORTED ||
 	    rval == NDIS_STATUS_NOT_ACCEPTED)
-		return(ENOTSUP);
+		return (ENOTSUP);
 
 	if (rval != NDIS_STATUS_SUCCESS)
-		return(ENODEV);
+		return (ENODEV);
 
-	return(0);
+	return (0);
 }
 
 uint32_t
@@ -1403,14 +1339,14 @@ NdisAddDevice(drv, pdo)
 		    INTR_TYPE_NET | INTR_MPSAFE,
 		    NULL, ntoskrnl_intr, NULL, &sc->ndis_intrhand);
 		if (error)
-			return(NDIS_STATUS_FAILURE);
+			return (NDIS_STATUS_FAILURE);
 	}
 
 	status = IoCreateDevice(drv, sizeof(ndis_miniport_block), NULL,
 	    FILE_DEVICE_UNKNOWN, 0, FALSE, &fdo);
 
 	if (status != STATUS_SUCCESS)
-		return(status);
+		return (status);
 
 	block = fdo->do_devext;
 
@@ -1446,7 +1382,7 @@ NdisAddDevice(drv, pdo)
 		if (status != NDIS_STATUS_SUCCESS) {
 			IoDetachDevice(block->nmb_nextdeviceobj);
 			IoDeleteDevice(fdo);
-			return(status);
+			return (status);
 		}
 		InitializeListHead((&block->nmb_packetlist));
 	}
@@ -1498,5 +1434,5 @@ ndis_unload_driver(arg)
 	IoDetachDevice(sc->ndis_block->nmb_nextdeviceobj);
 	IoDeleteDevice(fdo);
 
-	return(0);
+	return (0);
 }

Modified: head/sys/compat/ndis/kern_windrv.c
==============================================================================
--- head/sys/compat/ndis/kern_windrv.c	Mon Nov  2 09:56:46 2009	(r198785)
+++ head/sys/compat/ndis/kern_windrv.c	Mon Nov  2 11:07:42 2009	(r198786)
@@ -123,7 +123,7 @@ windrv_libinit(void)
 		panic("failed to allocate thread info blocks");
 	smp_rendezvous(NULL, x86_newldt, NULL, NULL);
 #endif
-	return(0);
+	return (0);
 }
 
 int
@@ -148,7 +148,7 @@ windrv_libfini(void)
 	smp_rendezvous(NULL, x86_oldldt, NULL, NULL);
 	ExFreePool(my_tids);
 #endif
-	return(0);
+	return (0);
 }
 
 /*
@@ -172,7 +172,7 @@ windrv_lookup(img, name)
 	if (name != NULL) {
 		RtlInitAnsiString(&as, name);
 		if (RtlAnsiStringToUnicodeString(&us, &as, TRUE))
-			return(NULL);
+			return (NULL);
 	}
 
 	mtx_lock(&drvdb_mtx); 
@@ -183,7 +183,7 @@ windrv_lookup(img, name)
 			mtx_unlock(&drvdb_mtx);
 			if (name != NULL)
 				ExFreePool(us.us_buf);
-			return(d->windrv_object);
+			return (d->windrv_object);
 		}
 	}
 	mtx_unlock(&drvdb_mtx);
@@ -191,7 +191,7 @@ windrv_lookup(img, name)
 	if (name != NULL)
 		RtlFreeUnicodeString(&us);
 
-	return(NULL);
+	return (NULL);
 }
 
 struct drvdb_ent *
@@ -209,12 +209,12 @@ windrv_match(matchfunc, ctx)
 		match = matchfunc(d->windrv_bustype, d->windrv_devlist, ctx);
 		if (match == TRUE) {
 			mtx_unlock(&drvdb_mtx);
-			return(d);
+			return (d);
 		}
 	}
 	mtx_unlock(&drvdb_mtx);
 
-	return(NULL);
+	return (NULL);
 }
 
 /*
@@ -283,7 +283,7 @@ windrv_unload(mod, img, len)
 		return (ENOENT);
 
 	if (drv == NULL)
-		return(ENOENT);
+		return (ENOENT);
 
 	/*
 	 * Destroy any custom extensions that may have been added.
@@ -306,7 +306,7 @@ windrv_unload(mod, img, len)
 	/* Free our DB handle */
 	free(r, M_DEVBUF);
 
-	return(0);
+	return (0);
 }
 
 #define WINDRV_LOADED		htonl(0x42534F44)
@@ -345,28 +345,28 @@ windrv_load(mod, img, len, bustype, devl
 
 	/* Perform text relocation */
 	if (pe_relocate(img))
-		return(ENOEXEC);
+		return (ENOEXEC);
 
 	/* Dynamically link the NDIS.SYS routines -- required. */
 	if (pe_patch_imports(img, "NDIS", ndis_functbl))
-		return(ENOEXEC);
+		return (ENOEXEC);
 
 	/* Dynamically link the HAL.dll routines -- optional. */
 	if (pe_get_import_descriptor(img, &imp_desc, "HAL") == 0) {
 		if (pe_patch_imports(img, "HAL", hal_functbl))
-			return(ENOEXEC);
+			return (ENOEXEC);
 	}
 
 	/* Dynamically link ntoskrnl.exe -- optional. */
 	if (pe_get_import_descriptor(img, &imp_desc, "ntoskrnl") == 0) {
 		if (pe_patch_imports(img, "ntoskrnl", ntoskrnl_functbl))
-			return(ENOEXEC);
+			return (ENOEXEC);
 	}
 
 	/* Dynamically link USBD.SYS -- optional */
 	if (pe_get_import_descriptor(img, &imp_desc, "USBD") == 0) {
 		if (pe_patch_imports(img, "USBD", usbd_functbl))
-			return(ENOEXEC);
+			return (ENOEXEC);
 	}
 
 	*ptr = WINDRV_LOADED;
@@ -398,7 +398,7 @@ skipreloc:
 	if (drv->dro_driverext == NULL) {
 		free(new, M_DEVBUF);
 		free(drv, M_DEVBUF);
-		return(ENOMEM);
+		return (ENOMEM);
 	}
 
 	InitializeListHead((&drv->dro_driverext->dre_usrext));
@@ -410,7 +410,7 @@ skipreloc:
 	if (RtlAnsiStringToUnicodeString(&drv->dro_drivername, &as, TRUE)) {
 		free(new, M_DEVBUF);
 		free(drv, M_DEVBUF);
-		return(ENOMEM);
+		return (ENOMEM);
 	}
 
 	new->windrv_object = drv;
@@ -426,7 +426,7 @@ skipreloc:
 		RtlFreeUnicodeString(&drv->dro_drivername);
 		free(drv, M_DEVBUF);
 		free(new, M_DEVBUF);
-		return(ENODEV);
+		return (ENODEV);
 	}
 
 	mtx_lock(&drvdb_mtx); 
@@ -463,7 +463,7 @@ windrv_create_pdo(drv, bsddev)
 
 	dev->do_devext = bsddev;
 
-	return(STATUS_SUCCESS);
+	return (STATUS_SUCCESS);
 }
 
 void
@@ -482,8 +482,6 @@ windrv_destroy_pdo(drv, bsddev)
 	mtx_lock(&drvdb_mtx);
 	IoDeleteDevice(pdo);
 	mtx_unlock(&drvdb_mtx);
-
-	return;
 }
 
 /*
@@ -503,13 +501,13 @@ windrv_find_pdo(drv, bsddev)
 	while (pdo != NULL) {
 		if (pdo->do_devext == bsddev) {
 			mtx_unlock(&drvdb_mtx);
-			return(pdo);
+			return (pdo);
 		}
 		pdo = pdo->do_nextdev;
 	}
 	mtx_unlock(&drvdb_mtx);
 
-	return(NULL);
+	return (NULL);
 }
 
 /*
@@ -533,7 +531,7 @@ windrv_bus_attach(drv, name)
 	if (RtlAnsiStringToUnicodeString(&drv->dro_drivername, &as, TRUE))
 	{
 		free(new, M_DEVBUF);
-		return(ENOMEM);
+		return (ENOMEM);
 	}
 
 	/*
@@ -550,7 +548,7 @@ windrv_bus_attach(drv, name)
 	STAILQ_INSERT_HEAD(&drvdb_head, new, link);
 	mtx_unlock(&drvdb_mtx);
 
-	return(0);
+	return (0);
 }
 
 #ifdef __amd64__
@@ -578,7 +576,7 @@ windrv_wrap(func, wrap, argcnt, ftype)
 
 	p = malloc((wrapend - wrapstart), M_DEVBUF, M_NOWAIT);
 	if (p == NULL)
-		return(ENOMEM);
+		return (ENOMEM);
 
 	/* Copy over the code. */
 
@@ -591,7 +589,7 @@ windrv_wrap(func, wrap, argcnt, ftype)
 
 	*wrap = p;
 
-	return(0);
+	return (0);
 }
 #endif /* __amd64__ */
 
@@ -695,8 +693,6 @@ ctxsw_utow(void)
 	x86_critical_exit();
 
 	/* Now entering Windows land, population: you. */
-
-	return;
 }
 
 /*
@@ -722,7 +718,6 @@ ctxsw_wtou(void)
 	if (t->tid_cpu != curthread->td_oncpu)
 		panic("ctxsw GOT MOVED TO OTHER CPU!");
 #endif
-	return;
 }
 
 static int	windrv_wrap_stdcall(funcptr, funcptr *, int);
@@ -754,7 +749,7 @@ windrv_wrap_fastcall(func, wrap, argcnt)
 
 	p = malloc((wrapend - wrapstart), M_DEVBUF, M_NOWAIT);
 	if (p == NULL)
-		return(ENOMEM);
+		return (ENOMEM);
 
 	/* Copy over the code. */
 
@@ -774,7 +769,7 @@ windrv_wrap_fastcall(func, wrap, argcnt)
 
 	*wrap = p;
 
-	return(0);
+	return (0);
 }
 
 extern void	x86_stdcall_wrap(void);
@@ -802,7 +797,7 @@ windrv_wrap_stdcall(func, wrap, argcnt)
 
 	p = malloc((wrapend - wrapstart), M_DEVBUF, M_NOWAIT);
 	if (p == NULL)
-		return(ENOMEM);
+		return (ENOMEM);
 
 	/* Copy over the code. */
 
@@ -818,7 +813,7 @@ windrv_wrap_stdcall(func, wrap, argcnt)
 
 	*wrap = p;
 
-	return(0);
+	return (0);
 }
 
 extern void	x86_regparm_wrap(void);
@@ -842,7 +837,7 @@ windrv_wrap_regparm(func, wrap)
 
 	p = malloc((wrapend - wrapstart), M_DEVBUF, M_NOWAIT);
 	if (p == NULL)
-		return(ENOMEM);
+		return (ENOMEM);
 
 	/* Copy over the code. */
 
@@ -855,7 +850,7 @@ windrv_wrap_regparm(func, wrap)
 
 	*wrap = p;
 
-	return(0);
+	return (0);
 }
 
 int
@@ -867,18 +862,18 @@ windrv_wrap(func, wrap, argcnt, ftype)
 {
 	switch(ftype) {
 	case WINDRV_WRAP_FASTCALL:
-		return(windrv_wrap_fastcall(func, wrap, argcnt));
+		return (windrv_wrap_fastcall(func, wrap, argcnt));
 	case WINDRV_WRAP_STDCALL:
-		return(windrv_wrap_stdcall(func, wrap, argcnt));
+		return (windrv_wrap_stdcall(func, wrap, argcnt));
 	case WINDRV_WRAP_REGPARM:
-		return(windrv_wrap_regparm(func, wrap));
+		return (windrv_wrap_regparm(func, wrap));
 	case WINDRV_WRAP_CDECL:
-		return(windrv_wrap_stdcall(func, wrap, 0));
+		return (windrv_wrap_stdcall(func, wrap, 0));
 	default:
 		break;
 	}
 
-	return(EINVAL);
+	return (EINVAL);
 }
 
 static void
@@ -909,8 +904,6 @@ x86_oldldt(dummy)
 	x86_setldt(&gtable, ltable);
 
 	mtx_unlock_spin(&dt_lock);
-
-	return;
 }
 
 static void
@@ -959,8 +952,6 @@ x86_newldt(dummy)
 	mtx_unlock_spin(&dt_lock);
 
 	/* Whew. */
-
-	return;
 }
 
 #endif /* __i386__ */
@@ -971,5 +962,5 @@ windrv_unwrap(func)
 {
 	free(func, M_DEVBUF);
 
-	return(0);
+	return (0);
 }

Modified: head/sys/compat/ndis/subr_hal.c
==============================================================================
--- head/sys/compat/ndis/subr_hal.c	Mon Nov  2 09:56:46 2009	(r198785)
+++ head/sys/compat/ndis/subr_hal.c	Mon Nov  2 11:07:42 2009	(r198786)
@@ -102,8 +102,7 @@ hal_libinit()
 		patch++;
 	}
 
-
-	return(0);
+	return (0);
 }
 
 int
@@ -121,7 +120,7 @@ hal_libfini()
 		patch++;
 	}
 
-	return(0);
+	return (0);
 }
 
 static void
@@ -129,7 +128,6 @@ KeStallExecutionProcessor(usecs)
 	uint32_t		usecs;
 {
 	DELAY(usecs);
-	return;
 }
 
 static void
@@ -138,21 +136,18 @@ WRITE_PORT_ULONG(port, val)
 	uint32_t		val;
 {
 	bus_space_write_4(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val);
-	return;
 }
 
 static void
 WRITE_PORT_USHORT(uint16_t *port, uint16_t val)
 {
 	bus_space_write_2(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val);
-	return;
 }
 
 static void
 WRITE_PORT_UCHAR(uint8_t *port, uint8_t val)
 {
 	bus_space_write_1(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val);
-	return;
 }
 
 static void
@@ -163,7 +158,6 @@ WRITE_PORT_BUFFER_ULONG(port, val, cnt)
 {
 	bus_space_write_multi_4(NDIS_BUS_SPACE_IO, 0x0,
 	    (bus_size_t)port, val, cnt);
-	return;
 }
 
 static void
@@ -174,7 +168,6 @@ WRITE_PORT_BUFFER_USHORT(port, val, cnt)
 {
 	bus_space_write_multi_2(NDIS_BUS_SPACE_IO, 0x0,
 	    (bus_size_t)port, val, cnt);
-	return;
 }
 
 static void
@@ -185,28 +178,27 @@ WRITE_PORT_BUFFER_UCHAR(port, val, cnt)
 {
 	bus_space_write_multi_1(NDIS_BUS_SPACE_IO, 0x0,
 	    (bus_size_t)port, val, cnt);
-	return;
 }
 
 static uint16_t
 READ_PORT_USHORT(port)
 	uint16_t		*port;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911021107.nA2B7gP4054855>