diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c index 189388948493..f4d4b3aa05a7 100644 --- a/sys/compat/ndis/kern_ndis.c +++ b/sys/compat/ndis/kern_ndis.c @@ -184,7 +184,7 @@ ndis_modevent(module_t mod, int cmd, void *arg) 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, slen) 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, ndis_status status, 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, flag) 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, flag) 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, oidcnt) 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); } diff --git a/sys/compat/ndis/kern_windrv.c b/sys/compat/ndis/kern_windrv.c index 1d4f76c93f5f..f231863e8887 100644 --- a/sys/compat/ndis/kern_windrv.c +++ b/sys/compat/ndis/kern_windrv.c @@ -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, devlist, regvals) /* 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 @@ windrv_load(mod, img, len, bustype, devlist, regvals) 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 @@ windrv_load(mod, img, len, bustype, devlist, regvals) 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 @@ windrv_load(mod, img, len, bustype, devlist, regvals) 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(>able, 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); } diff --git a/sys/compat/ndis/subr_hal.c b/sys/compat/ndis/subr_hal.c index 72b6db2915e9..45f34408c461 100644 --- a/sys/compat/ndis/subr_hal.c +++ b/sys/compat/ndis/subr_hal.c @@ -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; { - return(bus_space_read_2(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port)); + return (bus_space_read_2(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port)); } static uint32_t READ_PORT_ULONG(port) uint32_t *port; { - return(bus_space_read_4(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port)); + return (bus_space_read_4(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port)); } static uint8_t READ_PORT_UCHAR(port) uint8_t *port; { - return(bus_space_read_1(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port)); + return (bus_space_read_1(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port)); } static void @@ -217,7 +209,6 @@ READ_PORT_BUFFER_ULONG(port, val, cnt) { bus_space_read_multi_4(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val, cnt); - return; } static void @@ -228,7 +219,6 @@ READ_PORT_BUFFER_USHORT(port, val, cnt) { bus_space_read_multi_2(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val, cnt); - return; } static void @@ -239,7 +229,6 @@ READ_PORT_BUFFER_UCHAR(port, val, cnt) { bus_space_read_multi_1(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val, cnt); - return; } /* @@ -370,7 +359,7 @@ KfAcquireSpinLock(lock) KeRaiseIrql(DISPATCH_LEVEL, &oldirql); KeAcquireSpinLockAtDpcLevel(lock); - return(oldirql); + return (oldirql); } void @@ -378,16 +367,14 @@ KfReleaseSpinLock(kspin_lock *lock, uint8_t newirql) { KeReleaseSpinLockFromDpcLevel(lock); KeLowerIrql(newirql); - - return; } uint8_t KeGetCurrentIrql() { if (mtx_owned(&disp_lock[curthread->td_oncpu])) - return(DISPATCH_LEVEL); - return(PASSIVE_LEVEL); + return (DISPATCH_LEVEL); + return (PASSIVE_LEVEL); } static uint64_t @@ -397,7 +384,7 @@ KeQueryPerformanceCounter(freq) if (freq != NULL) *freq = hz; - return((uint64_t)ticks); + return ((uint64_t)ticks); } uint8_t @@ -417,7 +404,7 @@ KfRaiseIrql(uint8_t irql) } /*printf("RAISE IRQL: %d %d\n", irql, oldirql);*/ - return(oldirql); + return (oldirql); } void @@ -431,8 +418,6 @@ KfLowerIrql(uint8_t oldirql) mtx_unlock(&disp_lock[curthread->td_oncpu]); sched_unpin(); - - return; } static uint8_t @@ -441,20 +426,18 @@ KeRaiseIrqlToDpcLevel(void) uint8_t irql; KeRaiseIrql(DISPATCH_LEVEL, &irql); - return(irql); + return (irql); } static void _KeLowerIrql(uint8_t oldirql) { KeLowerIrql(oldirql); - return; } static void dummy() { - printf ("hal dummy called...\n"); - return; + printf("hal dummy called...\n"); } image_patch_table hal_functbl[] = { diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index d60e5268fe79..6f2b57dd3b41 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -319,7 +319,7 @@ ndis_libinit() patch++; } - return(0); + return (0); } int @@ -333,7 +333,7 @@ ndis_libfini() patch++; } - return(0); + return (0); } static funcptr @@ -345,11 +345,11 @@ ndis_findwrap(func) patch = ndis_functbl; while (patch->ipt_func != NULL) { if ((funcptr)patch->ipt_func == func) - return((funcptr)patch->ipt_wrap); + return ((funcptr)patch->ipt_wrap); patch++; } - return(NULL); + return (NULL); } /* @@ -385,8 +385,6 @@ NdisInitializeWrapper(wrapper, drv, path, unused) */ drv->dro_driverext->dre_adddevicefunc = NdisAddDevice; - - return; } static void @@ -395,7 +393,6 @@ NdisTerminateWrapper(handle, syspec) void *syspec; { /* Nothing to see here, move along. */ - return; } static ndis_status @@ -422,7 +419,7 @@ NdisMRegisterMiniport(handle, characteristics, len) if (IoAllocateDriverObjectExtension(drv, (void *)1, sizeof(ndis_miniport_characteristics), (void **)&ch) != STATUS_SUCCESS) { - return(NDIS_STATUS_RESOURCES); + return (NDIS_STATUS_RESOURCES); } bzero((char *)ch, sizeof(ndis_miniport_characteristics)); @@ -435,7 +432,7 @@ NdisMRegisterMiniport(handle, characteristics, len) ch->nmc_pnpevent_handler = NULL; } - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static ndis_status @@ -448,11 +445,11 @@ NdisAllocateMemoryWithTag(vaddr, len, tag) mem = ExAllocatePoolWithTag(NonPagedPool, len, tag); if (mem == NULL) { - return(NDIS_STATUS_RESOURCES); + return (NDIS_STATUS_RESOURCES); } *vaddr = mem; - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static ndis_status @@ -466,10 +463,10 @@ NdisAllocateMemory(vaddr, len, flags, highaddr) mem = ExAllocatePoolWithTag(NonPagedPool, len, 0); if (mem == NULL) - return(NDIS_STATUS_RESOURCES); + return (NDIS_STATUS_RESOURCES); *vaddr = mem; - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static void @@ -482,8 +479,6 @@ NdisFreeMemory(vaddr, len, flags) return; ExFreePool(vaddr); - - return; } static ndis_status @@ -506,7 +501,7 @@ NdisMSetAttributesEx(adapter_handle, adapter_ctx, hangsecs, block->nmb_checkforhangsecs = hangsecs; block->nmb_flags = flags; - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static void @@ -517,8 +512,6 @@ NdisOpenConfiguration(status, cfg, wrapctx) { *cfg = wrapctx; *status = NDIS_STATUS_SUCCESS; - - return; } static void @@ -530,8 +523,6 @@ NdisOpenConfigurationKeyByName(status, cfg, subkey, subhandle) { *subhandle = cfg; *status = NDIS_STATUS_SUCCESS; - - return; } static void @@ -543,8 +534,6 @@ NdisOpenConfigurationKeyByIndex(status, cfg, idx, subkey, subhandle) ndis_handle *subhandle; { *status = NDIS_STATUS_FAILURE; - - return; } static ndis_status @@ -565,7 +554,7 @@ ndis_encode_parm(block, oid, type, parm) np = ExAllocatePoolWithTag(NonPagedPool, sizeof(ndis_parmlist_entry), 0); if (np == NULL) - return(NDIS_STATUS_RESOURCES); + return (NDIS_STATUS_RESOURCES); InsertHeadList((&block->nmb_parmlist), (&np->np_list)); *parm = p = &np->np_parm; @@ -584,7 +573,7 @@ ndis_encode_parm(block, oid, type, parm) if (RtlAnsiStringToUnicodeString(us, &as, TRUE)) { ExFreePool(np); - return(NDIS_STATUS_RESOURCES); + return (NDIS_STATUS_RESOURCES); } break; case ndis_parm_int: @@ -609,11 +598,11 @@ ndis_encode_parm(block, oid, type, parm) strtoul((char *)oid->oid_arg1, NULL, base); break; default: - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); break; } - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static void @@ -690,8 +679,6 @@ NdisReadConfiguration(status, parm, cfg, key, type) RtlFreeAnsiString(&as); *status = NDIS_STATUS_FAILURE; - - return; } static ndis_status @@ -707,7 +694,7 @@ ndis_decode_parm(block, parm, val) case ndis_parm_string: ustr = &parm->ncp_parmdata.ncp_stringdata; if (RtlUnicodeStringToAnsiString(&as, ustr, TRUE)) - return(NDIS_STATUS_RESOURCES); + return (NDIS_STATUS_RESOURCES); bcopy(as.as_buf, val, as.as_len); RtlFreeAnsiString(&as); break; @@ -718,10 +705,10 @@ ndis_decode_parm(block, parm, val) sprintf(val, "%xu", parm->ncp_parmdata.ncp_intdata); break; default: - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); break; } - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static void @@ -779,7 +766,6 @@ NdisWriteConfiguration(status, cfg, key, parm) RtlFreeAnsiString(&as); *status = NDIS_STATUS_SUCCESS; - return; } static void @@ -801,8 +787,6 @@ NdisCloseConfiguration(cfg) RtlFreeUnicodeString(&p->ncp_parmdata.ncp_stringdata); ExFreePool(e); } - - return; } /* @@ -814,8 +798,6 @@ NdisAllocateSpinLock(lock) { KeInitializeSpinLock(&lock->nsl_spinlock); lock->nsl_kirql = 0; - - return; } /* @@ -834,7 +816,6 @@ NdisFreeSpinLock(lock) KeInitializeSpinLock(&lock->nsl_spinlock); lock->nsl_kirql = 0; #endif - return; } /* @@ -846,7 +827,6 @@ NdisAcquireSpinLock(lock) ndis_spin_lock *lock; { KeAcquireSpinLock(&lock->nsl_spinlock, &lock->nsl_kirql); - return; } /* @@ -858,7 +838,6 @@ NdisReleaseSpinLock(lock) ndis_spin_lock *lock; { KeReleaseSpinLock(&lock->nsl_spinlock, lock->nsl_kirql); - return; } /* @@ -869,7 +848,6 @@ NdisDprAcquireSpinLock(lock) ndis_spin_lock *lock; { KeAcquireSpinLockAtDpcLevel(&lock->nsl_spinlock); - return; } /* @@ -880,7 +858,6 @@ NdisDprReleaseSpinLock(lock) ndis_spin_lock *lock; { KeReleaseSpinLockFromDpcLevel(&lock->nsl_spinlock); - return; } static void @@ -889,7 +866,6 @@ NdisInitializeReadWriteLock(lock) { KeInitializeSpinLock(&lock->nrl_spinlock); bzero((char *)&lock->nrl_rsvd, sizeof(lock->nrl_rsvd)); - return; } static void @@ -901,8 +877,6 @@ NdisAcquireReadWriteLock(ndis_rw_lock *lock, uint8_t writeacc, lock->nrl_rsvd[0]++; } else lock->nrl_rsvd[1]++; - - return; } static void @@ -915,8 +889,6 @@ NdisReleaseReadWriteLock(lock, state) KeReleaseSpinLock(&lock->nrl_spinlock, state->nls_oldirql); } else lock->nrl_rsvd[1]--; - - return; } static uint32_t @@ -935,7 +907,7 @@ NdisReadPciSlotInformation(adapter, slot, offset, buf, len) block = (ndis_miniport_block *)adapter; dest = buf; if (block == NULL) - return(0); + return (0); dev = block->nmb_physdeviceobj->do_devext; @@ -959,7 +931,7 @@ NdisReadPciSlotInformation(adapter, slot, offset, buf, len) dest[i] = pci_read_config(dev, i + offset, 1); } - return(len); + return (len); } static uint32_t @@ -979,7 +951,7 @@ NdisWritePciSlotInformation(adapter, slot, offset, buf, len) dest = buf; if (block == NULL) - return(0); + return (0); dev = block->nmb_physdeviceobj->do_devext; for (i = 0; i < len; i++) { @@ -987,7 +959,7 @@ NdisWritePciSlotInformation(adapter, slot, offset, buf, len) pci_write_config(dev, i + offset, dest[i], 1); } - return(len); + return (len); } /* @@ -1033,22 +1005,20 @@ NdisWriteErrorLogEntry(ndis_handle adapter, ndis_error_code code, } } - device_printf (dev, "NDIS ERROR: %x (%s)\n", code, + device_printf(dev, "NDIS ERROR: %x (%s)\n", code, str == NULL ? "unknown error" : str); if (ifp != NULL && ifp->if_flags & IFF_DEBUG) { - device_printf (dev, "NDIS NUMERRORS: %x\n", numerrors); + device_printf(dev, "NDIS NUMERRORS: %x\n", numerrors); va_start(ap, numerrors); for (i = 0; i < numerrors; i++) - device_printf (dev, "argptr: %p\n", + device_printf(dev, "argptr: %p\n", va_arg(ap, void *)); va_end(ap); } if (as.as_len) RtlFreeAnsiString(&as); - - return; } static void @@ -1072,8 +1042,6 @@ ndis_map_cb(arg, segs, nseg, error) } ctx->nma_cnt = nseg; - - return; } static void @@ -1110,8 +1078,6 @@ NdisMStartBufferPhysicalMapping(ndis_handle adapter, ndis_buffer *buf, writedev ? BUS_DMASYNC_PREWRITE : BUS_DMASYNC_PREREAD); *arraysize = nma.nma_cnt; - - return; } static void @@ -1139,8 +1105,6 @@ NdisMCompleteBufferPhysicalMapping(adapter, buf, mapreg) BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->ndis_mtag, map); - - return; } /* @@ -1158,8 +1122,6 @@ NdisInitializeTimer(timer, func, ctx) KeInitializeTimer(&timer->nt_ktimer); KeInitializeDpc(&timer->nt_kdpc, func, ctx); KeSetImportanceDpc(&timer->nt_kdpc, KDPC_IMPORTANCE_LOW); - - return; } static void @@ -1183,8 +1145,6 @@ ndis_timercall(dpc, timer, sysarg1, sysarg2) if (NDIS_SERIALIZED(timer->nmt_block)) KeReleaseSpinLockFromDpcLevel(&timer->nmt_block->nmb_lock); - - return; } /* @@ -1250,8 +1210,6 @@ NdisSetTimer(timer, msecs) */ KeSetTimer(&timer->nt_ktimer, ((int64_t)msecs * -10000), &timer->nt_kdpc); - - return; } static void @@ -1261,8 +1219,6 @@ NdisMSetPeriodicTimer(timer, msecs) { KeSetTimerEx(&timer->nmt_ktimer, ((int64_t)msecs * -10000), msecs, &timer->nmt_kdpc); - - return; } /* @@ -1279,7 +1235,6 @@ NdisMCancelTimer(timer, cancelled) { *cancelled = KeCancelTimer(&timer->nt_ktimer); - return; } static void @@ -1291,7 +1246,7 @@ NdisMQueryAdapterResources(status, adapter, list, buflen) { ndis_miniport_block *block; struct ndis_softc *sc; - int rsclen; + uint32_t rsclen; block = (ndis_miniport_block *)adapter; sc = device_get_softc(block->nmb_physdeviceobj->do_devext); @@ -1306,8 +1261,6 @@ NdisMQueryAdapterResources(status, adapter, list, buflen) bcopy((char *)block->nmb_rlist, (char *)list, rsclen); *status = NDIS_STATUS_SUCCESS; - - return; } static ndis_status @@ -1321,21 +1274,21 @@ NdisMRegisterIoPortRange(offset, adapter, port, numports) struct ndis_softc *sc; if (adapter == NULL) - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); block = (ndis_miniport_block *)adapter; sc = device_get_softc(block->nmb_physdeviceobj->do_devext); if (sc->ndis_res_io == NULL) - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); /* Don't let the device map more ports than we have. */ if (rman_get_size(sc->ndis_res_io) < numports) - return(NDIS_STATUS_INVALID_LENGTH); + return (NDIS_STATUS_INVALID_LENGTH); *offset = (void *)rman_get_start(sc->ndis_res_io); - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static void @@ -1345,7 +1298,6 @@ NdisMDeregisterIoPortRange(adapter, port, numports, offset) uint32_t numports; void *offset; { - return; } static void @@ -1386,8 +1338,6 @@ NdisReadNetworkAddress(status, addr, addrlen, adapter) *addrlen = ETHER_ADDR_LEN; *status = NDIS_STATUS_SUCCESS; } - - return; } static ndis_status @@ -1396,7 +1346,7 @@ NdisQueryMapRegisterCount(bustype, cnt) uint32_t *cnt; { *cnt = 8192; - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static ndis_status @@ -1414,7 +1364,7 @@ NdisMAllocateMapRegisters(ndis_handle adapter, uint32_t dmachannel, M_DEVBUF, M_NOWAIT|M_ZERO); if (sc->ndis_mmaps == NULL) - return(NDIS_STATUS_RESOURCES); + return (NDIS_STATUS_RESOURCES); error = bus_dma_tag_create(sc->ndis_parent_tag, ETHER_ALIGN, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, @@ -1423,7 +1373,7 @@ NdisMAllocateMapRegisters(ndis_handle adapter, uint32_t dmachannel, if (error) { free(sc->ndis_mmaps, M_DEVBUF); - return(NDIS_STATUS_RESOURCES); + return (NDIS_STATUS_RESOURCES); } for (i = 0; i < physmapneeded; i++) @@ -1431,7 +1381,7 @@ NdisMAllocateMapRegisters(ndis_handle adapter, uint32_t dmachannel, sc->ndis_mmapcnt = physmapneeded; - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static void @@ -1451,8 +1401,6 @@ NdisMFreeMapRegisters(adapter) free(sc->ndis_mmaps, M_DEVBUF); bus_dma_tag_destroy(sc->ndis_mtag); - - return; } static void @@ -1470,8 +1418,6 @@ ndis_mapshared_cb(arg, segs, nseg, error) p = arg; p->np_quad = segs[0].ds_addr; - - return; } /* @@ -1556,8 +1502,6 @@ NdisMAllocateSharedMemory(ndis_handle adapter, uint32_t len, uint8_t cached, sh->ndis_saddr = *vaddr; InsertHeadList((&sc->ndis_shlist), (&sh->ndis_list)); NDIS_UNLOCK(sc); - - return; } struct ndis_allocwork { @@ -1593,8 +1537,6 @@ ndis_asyncmem_complete(dobj, arg) IoFreeWorkItem(w->na_iw); free(w, M_DEVBUF); - - return; } static ndis_status @@ -1607,18 +1549,18 @@ NdisMAllocateSharedMemoryAsync(ndis_handle adapter, uint32_t len, io_workitem_func ifw; if (adapter == NULL) - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); block = adapter; iw = IoAllocateWorkItem(block->nmb_deviceobj); if (iw == NULL) - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); w = malloc(sizeof(struct ndis_allocwork), M_TEMP, M_NOWAIT); if (w == NULL) - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); w->na_cached = cached; w->na_len = len; @@ -1628,7 +1570,7 @@ NdisMAllocateSharedMemoryAsync(ndis_handle adapter, uint32_t len, ifw = (io_workitem_func)ndis_findwrap((funcptr)ndis_asyncmem_complete); IoQueueWorkItem(iw, ifw, WORKQUEUE_DELAYED, w); - return(NDIS_STATUS_PENDING); + return (NDIS_STATUS_PENDING); } static void @@ -1683,8 +1625,6 @@ NdisMFreeSharedMemory(ndis_handle adapter, uint32_t len, uint8_t cached, bus_dma_tag_destroy(sh->ndis_stag); free(sh, M_DEVBUF); - - return; } static ndis_status @@ -1695,14 +1635,14 @@ NdisMMapIoSpace(vaddr, adapter, paddr, len) uint32_t len; { if (adapter == NULL) - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); *vaddr = MmMapIoSpace(paddr.np_quad, len, 0); if (*vaddr == NULL) - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static void @@ -1712,20 +1652,19 @@ NdisMUnmapIoSpace(adapter, vaddr, len) uint32_t len; { MmUnmapIoSpace(vaddr, len); - return; } static uint32_t NdisGetCacheFillSize(void) { - return(128); + return (128); } static uint32_t NdisMGetDmaAlignment(handle) ndis_handle handle; { - return(16); + return (16); } /* @@ -1748,13 +1687,13 @@ NdisMInitializeScatterGatherDma(ndis_handle adapter, uint8_t is64, int error; if (adapter == NULL) - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); block = (ndis_miniport_block *)adapter; sc = device_get_softc(block->nmb_physdeviceobj->do_devext); /* Don't do this twice. */ if (sc->ndis_sc == 1) - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); error = bus_dma_tag_create(sc->ndis_parent_tag, ETHER_ALIGN, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, @@ -1763,7 +1702,7 @@ NdisMInitializeScatterGatherDma(ndis_handle adapter, uint8_t is64, sc->ndis_sc = 1; - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } void @@ -1811,7 +1750,6 @@ NdisAllocatePacketPool(status, pool, descnum, protrsvdlen) *pool = p; *status = NDIS_STATUS_SUCCESS; - return; } void @@ -1822,7 +1760,7 @@ NdisAllocatePacketPoolEx(status, pool, descnum, oflowdescnum, protrsvdlen) uint32_t oflowdescnum; uint32_t protrsvdlen; { - return(NdisAllocatePacketPool(status, pool, + return (NdisAllocatePacketPool(status, pool, descnum + oflowdescnum, protrsvdlen)); } @@ -1833,7 +1771,7 @@ NdisPacketPoolUsage(pool) ndis_packet_pool *p; p = (ndis_packet_pool *)pool; - return(p->np_cnt - ExQueryDepthSList(&p->np_head)); + return (p->np_cnt - ExQueryDepthSList(&p->np_head)); } void @@ -1866,8 +1804,6 @@ NdisFreePacketPool(pool) ExFreePool(p->np_pktmem); ExFreePool(p); - - return; } void @@ -1927,8 +1863,6 @@ NdisAllocatePacket(status, packet, pool) *packet = pkt; *status = NDIS_STATUS_SUCCESS; - - return; } void @@ -1955,8 +1889,6 @@ NdisFreePacket(packet) } KeReleaseSpinLock(&p->np_lock, irql); #endif - - return; } static void @@ -1980,8 +1912,6 @@ NdisUnchainBufferAtFront(packet, buf) *buf = priv->npp_head; priv->npp_head = (*buf)->mdl_next; } - - return; } static void @@ -2010,8 +1940,6 @@ NdisUnchainBufferAtBack(packet, buf) priv->npp_tail = tmp; tmp->mdl_next = NULL; } - - return; } /* @@ -2042,14 +1970,12 @@ NdisAllocateBufferPool(status, pool, descnum) *pool = NonPagedPool; *status = NDIS_STATUS_SUCCESS; - return; } static void NdisFreeBufferPool(pool) ndis_handle pool; { - return; } static void @@ -2072,8 +1998,6 @@ NdisAllocateBuffer(status, buffer, pool, vaddr, len) *buffer = buf; *status = NDIS_STATUS_SUCCESS; - - return; } static void @@ -2081,7 +2005,6 @@ NdisFreeBuffer(buf) ndis_buffer *buf; { IoFreeMdl(buf); - return; } /* Aw c'mon. */ @@ -2090,7 +2013,7 @@ static uint32_t NdisBufferLength(buf) ndis_buffer *buf; { - return(MmGetMdlByteCount(buf)); + return (MmGetMdlByteCount(buf)); } /* @@ -2107,8 +2030,6 @@ NdisQueryBuffer(buf, vaddr, len) if (vaddr != NULL) *vaddr = MmGetMdlVirtualAddress(buf); *len = MmGetMdlByteCount(buf); - - return; } /* Same as above -- we don't care about the priority. */ @@ -2123,8 +2044,6 @@ NdisQueryBufferSafe(buf, vaddr, len, prio) if (vaddr != NULL) *vaddr = MmGetMdlVirtualAddress(buf); *len = MmGetMdlByteCount(buf); - - return; } /* Damnit Microsoft!! How many ways can you do the same thing?! */ @@ -2133,7 +2052,7 @@ static void * NdisBufferVirtualAddress(buf) ndis_buffer *buf; { - return(MmGetMdlVirtualAddress(buf)); + return (MmGetMdlVirtualAddress(buf)); } static void * @@ -2141,7 +2060,7 @@ NdisBufferVirtualAddressSafe(buf, prio) ndis_buffer *buf; uint32_t prio; { - return(MmGetMdlVirtualAddress(buf)); + return (MmGetMdlVirtualAddress(buf)); } static void @@ -2150,8 +2069,6 @@ NdisAdjustBufferLength(buf, len) int len; { MmGetMdlByteCount(buf) = len; - - return; } static uint32_t @@ -2159,7 +2076,7 @@ NdisInterlockedIncrement(addend) uint32_t *addend; { atomic_add_long((u_long *)addend, 1); - return(*addend); + return (*addend); } static uint32_t @@ -2167,7 +2084,7 @@ NdisInterlockedDecrement(addend) uint32_t *addend; { atomic_subtract_long((u_long *)addend, 1); - return(*addend); + return (*addend); } static void @@ -2180,7 +2097,6 @@ NdisInitializeEvent(event) * not signaled state. */ KeInitializeEvent(&event->ne_event, EVENT_TYPE_NOTIFY, FALSE); - return; } static void @@ -2188,7 +2104,6 @@ NdisSetEvent(event) ndis_event *event; { KeSetEvent(&event->ne_event, IO_NO_INCREMENT, FALSE); - return; } static void @@ -2196,7 +2111,6 @@ NdisResetEvent(event) ndis_event *event; { KeResetEvent(&event->ne_event); - return; } static uint8_t @@ -2212,9 +2126,9 @@ NdisWaitEvent(event, msecs) 0, 0, TRUE, msecs ? & duetime : NULL); if (rval == STATUS_TIMEOUT) - return(FALSE); + return (FALSE); - return(TRUE); + return (TRUE); } static ndis_status @@ -2227,9 +2141,9 @@ NdisUnicodeStringToAnsiString(dstr, sstr) rval = RtlUnicodeStringToAnsiString(dstr, sstr, FALSE); if (rval == STATUS_INSUFFICIENT_RESOURCES) - return(NDIS_STATUS_RESOURCES); + return (NDIS_STATUS_RESOURCES); if (rval) - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); return (NDIS_STATUS_SUCCESS); } @@ -2244,9 +2158,9 @@ NdisAnsiStringToUnicodeString(dstr, sstr) rval = RtlAnsiStringToUnicodeString(dstr, sstr, FALSE); if (rval == STATUS_INSUFFICIENT_RESOURCES) - return(NDIS_STATUS_RESOURCES); + return (NDIS_STATUS_RESOURCES); if (rval) - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); return (NDIS_STATUS_SUCCESS); } @@ -2282,7 +2196,7 @@ ndis_intr(iobj, arg) intr = sc->ndis_block->nmb_interrupt; if (intr == NULL || sc->ndis_block->nmb_miniportadapterctx == NULL) - return(FALSE); + return (FALSE); if (sc->ndis_block->nmb_interrupt->ni_isrreq == TRUE) MSCALL3(intr->ni_isrfunc, &is_our_intr, &call_isr, @@ -2296,7 +2210,7 @@ ndis_intr(iobj, arg) if (call_isr) IoRequestDpc(sc->ndis_block->nmb_deviceobj, NULL, sc); - return(is_our_intr); + return (is_our_intr); } static void @@ -2337,8 +2251,6 @@ ndis_intrhand(dpc, intr, sysarg1, sysarg2) if (intr->ni_dpccnt == 0) KeSetEvent(&intr->ni_dpcevt, IO_NO_INCREMENT, FALSE); KeReleaseSpinLockFromDpcLevel(&intr->ni_dpccountlock); - - return; } static ndis_status @@ -2359,7 +2271,7 @@ NdisMRegisterInterrupt(ndis_miniport_interrupt *intr, ndis_handle adapter, intr->ni_rsvd = ExAllocatePoolWithTag(NonPagedPool, sizeof(struct mtx), 0); if (intr->ni_rsvd == NULL) - return(NDIS_STATUS_RESOURCES); + return (NDIS_STATUS_RESOURCES); intr->ni_block = adapter; intr->ni_isrreq = reqisr; @@ -2378,11 +2290,11 @@ NdisMRegisterInterrupt(ndis_miniport_interrupt *intr, ndis_handle adapter, ivec, ilevel, 0, imode, shared, 0, FALSE); if (error != STATUS_SUCCESS) - return(NDIS_STATUS_FAILURE); + return (NDIS_STATUS_FAILURE); block->nmb_interrupt = intr; - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static void @@ -2408,8 +2320,6 @@ NdisMDeregisterInterrupt(intr) KeWaitForSingleObject(&intr->ni_dpcevt, 0, 0, FALSE, NULL); KeResetEvent(&intr->ni_dpcevt); - - return; } static void @@ -2431,8 +2341,6 @@ NdisMRegisterAdapterShutdownHandler(adapter, shutdownctx, shutdownfunc) chars->nmc_shutdown_handler = shutdownfunc; chars->nmc_rsvd0 = shutdownctx; - - return; } static void @@ -2452,8 +2360,6 @@ NdisMDeregisterAdapterShutdownHandler(adapter) chars->nmc_shutdown_handler = NULL; chars->nmc_rsvd0 = NULL; - - return; } static uint32_t @@ -2461,10 +2367,10 @@ NDIS_BUFFER_TO_SPAN_PAGES(buf) ndis_buffer *buf; { if (buf == NULL) - return(0); + return (0); if (MmGetMdlByteCount(buf) == 0) - return(1); - return(SPAN_PAGES(MmGetMdlVirtualAddress(buf), + return (1); + return (SPAN_PAGES(MmGetMdlVirtualAddress(buf), MmGetMdlByteCount(buf))); } @@ -2477,7 +2383,6 @@ NdisGetBufferPhysicalArraySize(buf, pages) return; *pages = NDIS_BUFFER_TO_SPAN_PAGES(buf); - return; } static void @@ -2491,8 +2396,6 @@ NdisQueryBufferOffset(buf, off, len) *off = MmGetMdlByteOffset(buf); *len = MmGetMdlByteCount(buf); - - return; } void @@ -2514,8 +2417,6 @@ NdisMSleep(usecs) KeSetTimer(&timer, ((int64_t)usecs * -10), NULL); KeWaitForSingleObject(&timer, 0, 0, FALSE, NULL); } - - return; } static uint32_t @@ -2533,7 +2434,7 @@ NdisReadPcmciaAttributeMemory(handle, offset, buf, len) int i; if (handle == NULL) - return(0); + return (0); block = (ndis_miniport_block *)handle; sc = device_get_softc(block->nmb_physdeviceobj->do_devext); @@ -2545,7 +2446,7 @@ NdisReadPcmciaAttributeMemory(handle, offset, buf, len) for (i = 0; i < len; i++) dest[i] = bus_space_read_1(bt, bh, (offset + i) * 2); - return(i); + return (i); } static uint32_t @@ -2563,7 +2464,7 @@ NdisWritePcmciaAttributeMemory(handle, offset, buf, len) int i; if (handle == NULL) - return(0); + return (0); block = (ndis_miniport_block *)handle; sc = device_get_softc(block->nmb_physdeviceobj->do_devext); @@ -2575,7 +2476,7 @@ NdisWritePcmciaAttributeMemory(handle, offset, buf, len) for (i = 0; i < len; i++) bus_space_write_1(bt, bh, (offset + i) * 2, src[i]); - return(i); + return (i); } static list_entry * @@ -2594,7 +2495,7 @@ NdisInterlockedInsertHeadList(head, entry, lock) head->nle_flink = entry; KeReleaseSpinLock(&lock->nsl_spinlock, lock->nsl_kirql); - return(flink); + return (flink); } static list_entry * @@ -2612,7 +2513,7 @@ NdisInterlockedRemoveHeadList(head, lock) flink->nle_blink = head; KeReleaseSpinLock(&lock->nsl_spinlock, lock->nsl_kirql); - return(entry); + return (entry); } static list_entry * @@ -2631,7 +2532,7 @@ NdisInterlockedInsertTailList(head, entry, lock) head->nle_blink = entry; KeReleaseSpinLock(&lock->nsl_spinlock, lock->nsl_kirql); - return(blink); + return (blink); } static uint8_t @@ -2640,7 +2541,7 @@ NdisMSynchronizeWithInterrupt(intr, syncfunc, syncctx) void *syncfunc; void *syncctx; { - return(KeSynchronizeExecution(intr->ni_introbj, syncfunc, syncctx)); + return (KeSynchronizeExecution(intr->ni_introbj, syncfunc, syncctx)); } static void @@ -2648,7 +2549,6 @@ NdisGetCurrentSystemTime(tval) uint64_t *tval; { ntoskrnl_time(tval); - return; } /* @@ -2662,8 +2562,6 @@ NdisGetSystemUpTime(tval) nanouptime(&ts); *tval = ts.tv_nsec / 1000000 + ts.tv_sec * 1000; - - return; } static void @@ -2674,7 +2572,6 @@ NdisInitializeString(dst, src) ansi_string as; RtlInitAnsiString(&as, src); RtlAnsiStringToUnicodeString(dst, &as, TRUE); - return; } static void @@ -2682,14 +2579,13 @@ NdisFreeString(str) unicode_string *str; { RtlFreeUnicodeString(str); - return; } static ndis_status NdisMRemoveMiniport(adapter) ndis_handle *adapter; { - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static void @@ -2698,7 +2594,6 @@ NdisInitAnsiString(dst, src) char *src; { RtlInitAnsiString(dst, src); - return; } static void @@ -2707,7 +2602,6 @@ NdisInitUnicodeString(dst, src) uint16_t *src; { RtlInitUnicodeString(dst, src); - return; } static void NdisMGetDeviceProperty(adapter, phydevobj, @@ -2729,8 +2623,6 @@ static void NdisMGetDeviceProperty(adapter, phydevobj, *funcdevobj = block->nmb_deviceobj; if (nextdevobj != NULL) *nextdevobj = block->nmb_nextdeviceobj; - - return; } static void @@ -2754,8 +2646,6 @@ NdisGetFirstBufferFromPacket(packet, buf, firstva, firstlen, totlen) for (tmp = tmp->mdl_next; tmp != NULL; tmp = tmp->mdl_next) *totlen += MmGetMdlByteCount(tmp); } - - return; } static void @@ -2783,13 +2673,13 @@ ndis_find_sym(lf, filename, suffix, sym) fullsym = ExAllocatePoolWithTag(NonPagedPool, MAXPATHLEN, 0); if (fullsym == NULL) - return(ENOMEM); + return (ENOMEM); bzero(fullsym, MAXPATHLEN); strncpy(fullsym, filename, MAXPATHLEN); if (strlen(filename) < 4) { ExFreePool(fullsym); - return(EINVAL); + return (EINVAL); } /* If the filename has a .ko suffix, strip if off. */ @@ -2807,9 +2697,9 @@ ndis_find_sym(lf, filename, suffix, sym) *sym = linker_file_lookup_symbol(lf, fullsym, 0); ExFreePool(fullsym); if (*sym == 0) - return(ENOENT); + return (ENOENT); - return(0); + return (0); } struct ndis_checkmodule { @@ -2960,8 +2850,6 @@ NdisOpenFile(status, filehandle, filelength, filename, highestaddr) *filehandle = fh; *filelength = fh->nf_maplen = vap->va_size & 0xFFFFFFFF; *status = NDIS_STATUS_SUCCESS; - - return; } static void @@ -3025,8 +2913,6 @@ NdisMapFile(status, mappedbuffer, filehandle) *status = NDIS_STATUS_SUCCESS; *mappedbuffer = fh->nf_map; } - - return; } static void @@ -3042,8 +2928,6 @@ NdisUnmapFile(filehandle) if (fh->nf_type == NDIS_FH_TYPE_VFS) ExFreePool(fh->nf_map); fh->nf_map = NULL; - - return; } static void @@ -3078,14 +2962,12 @@ NdisCloseFile(filehandle) fh->nf_vp = NULL; free(fh->nf_name, M_DEVBUF); ExFreePool(fh); - - return; } static uint8_t NdisSystemProcessorCount() { - return(mp_ncpus); + return (mp_ncpus); } typedef void (*ndis_statusdone_handler)(ndis_handle); @@ -3103,7 +2985,6 @@ NdisMIndicateStatusComplete(adapter) statusdonefunc = block->nmb_statusdone_func; MSCALL1(statusdonefunc, adapter); - return; } static void @@ -3120,7 +3001,6 @@ NdisMIndicateStatus(adapter, status, sbuf, slen) statusfunc = block->nmb_status_func; MSCALL4(statusfunc, adapter, status, sbuf, slen); - return; } /* @@ -3154,7 +3034,7 @@ NdisScheduleWorkItem(work) (work_item_func)work->nwi_func, work->nwi_ctx); ExQueueWorkItem(wqi, WORKQUEUE_DELAYED); - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static void @@ -3244,7 +3124,6 @@ NdisCopyFromPacketToPacket(dpkt, doff, reqlen, spkt, soff, cpylen) } *cpylen = copied; - return; } static void @@ -3258,7 +3137,6 @@ NdisCopyFromPacketToPacketSafe(dpkt, doff, reqlen, spkt, soff, cpylen, prio) uint32_t prio; { NdisCopyFromPacketToPacket(dpkt, doff, reqlen, spkt, soff, cpylen); - return; } static void @@ -3289,7 +3167,7 @@ NdisMRegisterDevice(handle, devname, symname, majorfuncs, devobj, devhandle) *devhandle = dobj; } - return(status); + return (status); } static ndis_status @@ -3297,7 +3175,7 @@ NdisMDeregisterDevice(handle) ndis_handle handle; { IoDeleteDevice(handle); - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static ndis_status @@ -3314,9 +3192,9 @@ NdisMQueryAdapterInstanceName(name, handle) RtlInitAnsiString(&as, __DECONST(char *, device_get_nameunit(dev))); if (RtlAnsiStringToUnicodeString(name, &as, TRUE)) - return(NDIS_STATUS_RESOURCES); + return (NDIS_STATUS_RESOURCES); - return(NDIS_STATUS_SUCCESS); + return (NDIS_STATUS_SUCCESS); } static void @@ -3324,14 +3202,12 @@ NdisMRegisterUnloadHandler(handle, func) ndis_handle handle; void *func; { - return; } static void dummy() { - printf ("NDIS dummy called...\n"); - return; + printf("NDIS dummy called...\n"); } /* diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c index 69bea9e15d6e..ba1e49ffaf67 100644 --- a/sys/compat/ndis/subr_ntoskrnl.c +++ b/sys/compat/ndis/subr_ntoskrnl.c @@ -295,13 +295,13 @@ ntoskrnl_libinit() #endif if (kq_queues == NULL) - return(ENOMEM); + return (ENOMEM); wq_queues = ExAllocatePoolWithTag(NonPagedPool, sizeof(kdpc_queue) * WORKITEM_THREADS, 0); if (wq_queues == NULL) - return(ENOMEM); + return (ENOMEM); #ifdef NTOSKRNL_MULTIPLE_DPCS bzero((char *)kq_queues, sizeof(kdpc_queue) * mp_ncpus); @@ -378,7 +378,7 @@ ntoskrnl_libinit() iw_zone = uma_zcreate("Windows WorkItem", sizeof(io_workitem), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - return(0); + return (0); } int @@ -419,7 +419,7 @@ ntoskrnl_libfini() mtx_destroy(&ntoskrnl_interlock); mtx_destroy(&ntoskrnl_calllock); - return(0); + return (0); } /* @@ -432,7 +432,7 @@ ntoskrnl_memset(buf, ch, size) int ch; size_t size; { - return(memset(buf, ch, size)); + return (memset(buf, ch, size)); } static void * @@ -442,7 +442,7 @@ ntoskrnl_memmove(dst, src, size) size_t size; { bcopy(src, dst, size); - return(dst); + return (dst); } static void * @@ -506,14 +506,14 @@ static int ntoskrnl_toupper(c) int c; { - return(toupper(c)); + return (toupper(c)); } static int ntoskrnl_tolower(c) int c; { - return(tolower(c)); + return (tolower(c)); } static uint8_t @@ -523,20 +523,20 @@ RtlEqualUnicodeString(unicode_string *str1, unicode_string *str2, int i; if (str1->us_len != str2->us_len) - return(FALSE); + return (FALSE); for (i = 0; i < str1->us_len; i++) { if (caseinsensitive == TRUE) { if (toupper((char)(str1->us_buf[i] & 0xFF)) != toupper((char)(str2->us_buf[i] & 0xFF))) - return(FALSE); + return (FALSE); } else { if (str1->us_buf[i] != str2->us_buf[i]) - return(FALSE); + return (FALSE); } } - return(TRUE); + return (TRUE); } static void @@ -550,7 +550,6 @@ RtlCopyUnicodeString(dest, src) else dest->us_len = dest->us_maxlen; memcpy(dest->us_buf, src->us_buf, dest->us_len); - return; } static void @@ -567,8 +566,6 @@ ntoskrnl_ascii_to_unicode(ascii, unicode, len) *ustr = (uint16_t)ascii[i]; ustr++; } - - return; } static void @@ -585,15 +582,13 @@ ntoskrnl_unicode_to_ascii(unicode, ascii, len) *astr = (uint8_t)unicode[i]; astr++; } - - return; } uint32_t RtlUnicodeStringToAnsiString(ansi_string *dest, unicode_string *src, uint8_t allocate) { if (dest == NULL || src == NULL) - return(STATUS_INVALID_PARAMETER); + return (STATUS_INVALID_PARAMETER); dest->as_len = src->us_len / 2; if (dest->as_maxlen < dest->as_len) @@ -603,7 +598,7 @@ RtlUnicodeStringToAnsiString(ansi_string *dest, unicode_string *src, uint8_t all dest->as_buf = ExAllocatePoolWithTag(NonPagedPool, (src->us_len / 2) + 1, 0); if (dest->as_buf == NULL) - return(STATUS_INSUFFICIENT_RESOURCES); + return (STATUS_INSUFFICIENT_RESOURCES); dest->as_len = dest->as_maxlen = src->us_len / 2; } else { dest->as_len = src->us_len / 2; /* XXX */ @@ -622,13 +617,13 @@ RtlAnsiStringToUnicodeString(unicode_string *dest, ansi_string *src, uint8_t allocate) { if (dest == NULL || src == NULL) - return(STATUS_INVALID_PARAMETER); + return (STATUS_INVALID_PARAMETER); if (allocate == TRUE) { dest->us_buf = ExAllocatePoolWithTag(NonPagedPool, src->as_len * 2, 0); if (dest->us_buf == NULL) - return(STATUS_INSUFFICIENT_RESOURCES); + return (STATUS_INSUFFICIENT_RESOURCES); dest->us_len = dest->us_maxlen = strlen(src->as_buf) * 2; } else { dest->us_len = src->as_len * 2; /* XXX */ @@ -652,9 +647,9 @@ ExAllocatePoolWithTag(pooltype, len, tag) buf = malloc(len, M_DEVBUF, M_NOWAIT|M_ZERO); if (buf == NULL) - return(NULL); + return (NULL); - return(buf); + return (buf); } void @@ -662,7 +657,6 @@ ExFreePool(buf) void *buf; { free(buf, M_DEVBUF); - return; } uint32_t @@ -678,14 +672,14 @@ IoAllocateDriverObjectExtension(drv, clid, extlen, ext) + extlen, 0); if (ce == NULL) - return(STATUS_INSUFFICIENT_RESOURCES); + return (STATUS_INSUFFICIENT_RESOURCES); ce->ce_clid = clid; InsertTailList((&drv->dro_driverext->dre_usrext), (&ce->ce_list)); *ext = (void *)(ce + 1); - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); } void * @@ -702,17 +696,17 @@ IoGetDriverObjectExtension(drv, clid) */ if (drv->dro_driverext == NULL) - return(NULL); + return (NULL); e = drv->dro_driverext->dre_usrext.nle_flink; while (e != &drv->dro_driverext->dre_usrext) { ce = (custom_extension *)e; if (ce->ce_clid == clid) - return((void *)(ce + 1)); + return ((void *)(ce + 1)); e = e->nle_flink; } - return(NULL); + return (NULL); } @@ -725,7 +719,7 @@ IoCreateDevice(driver_object *drv, uint32_t devextlen, unicode_string *devname, dev = ExAllocatePoolWithTag(NonPagedPool, sizeof(device_object), 0); if (dev == NULL) - return(STATUS_INSUFFICIENT_RESOURCES); + return (STATUS_INSUFFICIENT_RESOURCES); dev->do_type = devtype; dev->do_drvobj = drv; @@ -738,7 +732,7 @@ IoCreateDevice(driver_object *drv, uint32_t devextlen, unicode_string *devname, if (dev->do_devext == NULL) { ExFreePool(dev); - return(STATUS_INSUFFICIENT_RESOURCES); + return (STATUS_INSUFFICIENT_RESOURCES); } bzero(dev->do_devext, devextlen); @@ -769,7 +763,7 @@ IoCreateDevice(driver_object *drv, uint32_t devextlen, unicode_string *devname, if (dev->do_devext != NULL) ExFreePool(dev->do_devext); ExFreePool(dev); - return(STATUS_INSUFFICIENT_RESOURCES); + return (STATUS_INSUFFICIENT_RESOURCES); } dev->do_devobj_ext->dve_type = 0; @@ -794,7 +788,7 @@ IoCreateDevice(driver_object *drv, uint32_t devextlen, unicode_string *devname, *newdev = dev; - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); } void @@ -824,8 +818,6 @@ IoDeleteDevice(dev) } ExFreePool(dev); - - return; } device_object * @@ -859,10 +851,10 @@ IoBuildSynchronousFsdRequest(func, dobj, buf, len, off, event, status) ip = IoBuildAsynchronousFsdRequest(func, dobj, buf, len, off, status); if (ip == NULL) - return(NULL); + return (NULL); ip->irp_usrevent = event; - return(ip); + return (ip); } static irp * @@ -879,7 +871,7 @@ IoBuildAsynchronousFsdRequest(func, dobj, buf, len, off, status) ip = IoAllocateIrp(dobj->do_stacksize, TRUE); if (ip == NULL) - return(NULL); + return (NULL); ip->irp_usriostat = status; ip->irp_tail.irp_overlay.irp_thread = NULL; @@ -900,7 +892,7 @@ IoBuildAsynchronousFsdRequest(func, dobj, buf, len, off, status) ExAllocatePoolWithTag(NonPagedPool, len, 0); if (ip->irp_assoc.irp_sysbuf == NULL) { IoFreeIrp(ip); - return(NULL); + return (NULL); } bcopy(buf, ip->irp_assoc.irp_sysbuf, len); } @@ -911,7 +903,7 @@ IoBuildAsynchronousFsdRequest(func, dobj, buf, len, off, status) if (ip->irp_assoc.irp_sysbuf != NULL) ExFreePool(ip->irp_assoc.irp_sysbuf); IoFreeIrp(ip); - return(NULL); + return (NULL); } ip->irp_userbuf = NULL; ip->irp_assoc.irp_sysbuf = NULL; @@ -933,7 +925,7 @@ IoBuildAsynchronousFsdRequest(func, dobj, buf, len, off, status) sl->isl_parameters.isl_write.isl_byteoff = 0; } - return(ip); + return (ip); } static irp * @@ -947,7 +939,7 @@ IoBuildDeviceIoControlRequest(uint32_t iocode, device_object *dobj, void *ibuf, ip = IoAllocateIrp(dobj->do_stacksize, TRUE); if (ip == NULL) - return(NULL); + return (NULL); ip->irp_usrevent = event; ip->irp_usriostat = status; ip->irp_tail.irp_overlay.irp_thread = NULL; @@ -976,7 +968,7 @@ IoBuildDeviceIoControlRequest(uint32_t iocode, device_object *dobj, void *ibuf, ExAllocatePoolWithTag(NonPagedPool, buflen, 0); if (ip->irp_assoc.irp_sysbuf == NULL) { IoFreeIrp(ip); - return(NULL); + return (NULL); } } if (ilen && ibuf != NULL) { @@ -994,7 +986,7 @@ IoBuildDeviceIoControlRequest(uint32_t iocode, device_object *dobj, void *ibuf, ExAllocatePoolWithTag(NonPagedPool, ilen, 0); if (ip->irp_assoc.irp_sysbuf == NULL) { IoFreeIrp(ip); - return(NULL); + return (NULL); } bcopy(ibuf, ip->irp_assoc.irp_sysbuf, ilen); } @@ -1045,7 +1037,7 @@ IoMakeAssociatedIrp(irp *ip, uint8_t stsize) associrp = IoAllocateIrp(stsize, FALSE); if (associrp == NULL) - return(NULL); + return (NULL); mtx_lock(&ntoskrnl_dispatchlock); associrp->irp_flags |= IRP_ASSOCIATED_IRP; @@ -1054,7 +1046,7 @@ IoMakeAssociatedIrp(irp *ip, uint8_t stsize) associrp->irp_assoc.irp_master = ip; mtx_unlock(&ntoskrnl_dispatchlock); - return(associrp); + return (associrp); } static void @@ -1062,7 +1054,6 @@ IoFreeIrp(ip) irp *ip; { ExFreePool(ip); - return; } static void @@ -1075,8 +1066,6 @@ IoInitializeIrp(irp *io, uint16_t psize, uint8_t ssize) InitializeListHead(&io->irp_thlist); io->irp_tail.irp_overlay.irp_csl = (io_stack_location *)(io + 1) + ssize; - - return; } static void @@ -1090,22 +1079,18 @@ IoReuseIrp(ip, status) IoInitializeIrp(ip, ip->irp_size, ip->irp_stackcnt); ip->irp_iostat.isb_status = status; ip->irp_allocflags = allocflags; - - return; } void IoAcquireCancelSpinLock(uint8_t *irql) { KeAcquireSpinLock(&ntoskrnl_cancellock, irql); - return; } void IoReleaseCancelSpinLock(uint8_t irql) { KeReleaseSpinLock(&ntoskrnl_cancellock, irql); - return; } uint8_t @@ -1119,7 +1104,7 @@ IoCancelIrp(irp *ip) ip->irp_cancel = TRUE; if (cfunc == NULL) { IoReleaseCancelSpinLock(cancelirql); - return(FALSE); + return (FALSE); } ip->irp_cancelirql = cancelirql; MSCALL2(cfunc, IoGetCurrentIrpStackLocation(ip)->isl_devobj, ip); @@ -1149,7 +1134,7 @@ IofCallDriver(dobj, ip) disp = drvobj->dro_dispatch[sl->isl_major]; status = MSCALL2(disp, dobj, ip); - return(status); + return (status); } void @@ -1230,8 +1215,6 @@ IofCompleteRequest(irp *ip, uint8_t prioboost) IoFreeMdl(ip->irp_mdl); IoFreeIrp(ip); } - - return; } void @@ -1253,8 +1236,6 @@ ntoskrnl_intr(arg) l = l->nle_flink; } KeReleaseSpinLock(&ntoskrnl_intlock, irql); - - return; } uint8_t @@ -1263,14 +1244,13 @@ KeAcquireInterruptSpinLock(iobj) { uint8_t irql; KeAcquireSpinLock(&ntoskrnl_intlock, &irql); - return(irql); + return (irql); } void KeReleaseInterruptSpinLock(kinterrupt *iobj, uint8_t irql) { KeReleaseSpinLock(&ntoskrnl_intlock, irql); - return; } uint8_t @@ -1285,7 +1265,7 @@ KeSynchronizeExecution(iobj, syncfunc, syncctx) MSCALL1(syncfunc, syncctx); KeReleaseSpinLock(&ntoskrnl_intlock, irql); - return(TRUE); + return (TRUE); } /* @@ -1313,7 +1293,7 @@ IoConnectInterrupt(kinterrupt **iobj, void *svcfunc, void *svcctx, *iobj = ExAllocatePoolWithTag(NonPagedPool, sizeof(kinterrupt), 0); if (*iobj == NULL) - return(STATUS_INSUFFICIENT_RESOURCES); + return (STATUS_INSUFFICIENT_RESOURCES); (*iobj)->ki_svcfunc = svcfunc; (*iobj)->ki_svcctx = svcctx; @@ -1328,7 +1308,7 @@ IoConnectInterrupt(kinterrupt **iobj, void *svcfunc, void *svcctx, InsertHeadList((&ntoskrnl_intlist), (&(*iobj)->ki_list)); KeReleaseSpinLock(&ntoskrnl_intlock, curirql); - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); } void @@ -1345,8 +1325,6 @@ IoDisconnectInterrupt(iobj) KeReleaseSpinLock(&ntoskrnl_intlock, irql); ExFreePool(iobj); - - return; } device_object * @@ -1363,7 +1341,7 @@ IoAttachDeviceToDeviceStack(src, dst) src->do_stacksize = attached->do_stacksize + 1; mtx_unlock(&ntoskrnl_dispatchlock); - return(attached); + return (attached); } void @@ -1392,8 +1370,6 @@ IoDetachDevice(topdev) } mtx_unlock(&ntoskrnl_dispatchlock); - - return; } /* @@ -1419,13 +1395,13 @@ ntoskrnl_is_signalled(obj, td) km = (kmutant *)obj; if ((obj->dh_sigstate <= 0 && km->km_ownerthread == td) || obj->dh_sigstate == 1) - return(TRUE); - return(FALSE); + return (TRUE); + return (FALSE); } if (obj->dh_sigstate > 0) - return(TRUE); - return(FALSE); + return (TRUE); + return (FALSE); } static void @@ -1460,8 +1436,6 @@ ntoskrnl_satisfy_wait(obj, td) default: break; } - - return; } static void @@ -1479,8 +1453,6 @@ ntoskrnl_satisfy_multiple_waits(wb) cur->wb_awakened = TRUE; cur = cur->wb_next; } while (cur != wb); - - return; } /* Always called with dispatcher lock held. */ @@ -1562,8 +1534,6 @@ ntoskrnl_waittest(obj, increment) e = e->nle_flink; } - - return; } /* @@ -1579,8 +1549,6 @@ ntoskrnl_time(tval) nanotime(&ts); *tval = (uint64_t)ts.tv_nsec / 100 + (uint64_t)ts.tv_sec * 10000000 + 11644473600 * 10000000; /* 100ns ticks from 1601 to 1970 */ - - return; } static void @@ -1666,7 +1634,7 @@ KeWaitForSingleObject(void *arg, uint32_t reason, uint32_t mode, obj = arg; if (obj == NULL) - return(STATUS_INVALID_PARAMETER); + return (STATUS_INVALID_PARAMETER); mtx_lock(&ntoskrnl_dispatchlock); @@ -1747,14 +1715,14 @@ KeWaitForSingleObject(void *arg, uint32_t reason, uint32_t mode, if (error == EWOULDBLOCK) { mtx_unlock(&ntoskrnl_dispatchlock); - return(STATUS_TIMEOUT); + return (STATUS_TIMEOUT); } mtx_unlock(&ntoskrnl_dispatchlock); - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); /* - return(KeWaitForMultipleObjects(1, &obj, WAITTYPE_ALL, reason, + return (KeWaitForMultipleObjects(1, &obj, WAITTYPE_ALL, reason, mode, alertable, duetime, &w)); */ } @@ -1776,9 +1744,9 @@ KeWaitForMultipleObjects(uint32_t cnt, nt_dispatch_header *obj[], uint32_t wtype wb_ext we; if (cnt > MAX_WAIT_OBJECTS) - return(STATUS_INVALID_PARAMETER); + return (STATUS_INVALID_PARAMETER); if (cnt > THREAD_WAIT_OBJECTS && wb_array == NULL) - return(STATUS_INVALID_PARAMETER); + return (STATUS_INVALID_PARAMETER); mtx_lock(&ntoskrnl_dispatchlock); @@ -1959,21 +1927,20 @@ KeWaitForMultipleObjects(uint32_t cnt, nt_dispatch_header *obj[], uint32_t wtype } mtx_unlock(&ntoskrnl_dispatchlock); - return(status); + return (status); } static void WRITE_REGISTER_USHORT(uint16_t *reg, uint16_t val) { bus_space_write_2(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg, val); - return; } static uint16_t READ_REGISTER_USHORT(reg) uint16_t *reg; { - return(bus_space_read_2(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg)); + return (bus_space_read_2(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg)); } static void @@ -1982,27 +1949,25 @@ WRITE_REGISTER_ULONG(reg, val) uint32_t val; { bus_space_write_4(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg, val); - return; } static uint32_t READ_REGISTER_ULONG(reg) uint32_t *reg; { - return(bus_space_read_4(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg)); + return (bus_space_read_4(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg)); } static uint8_t READ_REGISTER_UCHAR(uint8_t *reg) { - return(bus_space_read_1(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg)); + return (bus_space_read_1(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg)); } static void WRITE_REGISTER_UCHAR(uint8_t *reg, uint8_t val) { bus_space_write_1(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg, val); - return; } static int64_t @@ -2090,7 +2055,7 @@ ntoskrnl_pushsl(head, entry) head->slh_list.slh_depth++; head->slh_list.slh_seq++; - return(oldhead); + return (oldhead); } static slist_entry * @@ -2106,7 +2071,7 @@ ntoskrnl_popsl(head) head->slh_list.slh_seq++; } - return(first); + return (first); } /* @@ -2129,11 +2094,11 @@ ntoskrnl_findwrap(func) patch = ntoskrnl_functbl; while (patch->ipt_func != NULL) { if ((funcptr)patch->ipt_func == func) - return((funcptr)patch->ipt_wrap); + return ((funcptr)patch->ipt_wrap); patch++; } - return(NULL); + return (NULL); } static void @@ -2167,8 +2132,6 @@ ExInitializePagedLookasideList(paged_lookaside_list *lookaside, lookaside->nll_l.gl_type = NonPagedPool; lookaside->nll_l.gl_depth = depth; lookaside->nll_l.gl_maxdepth = LOOKASIDE_DEPTH; - - return; } static void @@ -2181,8 +2144,6 @@ ExDeletePagedLookasideList(lookaside) freefunc = lookaside->nll_l.gl_freefunc; while((buf = ntoskrnl_popsl(&lookaside->nll_l.gl_listhead)) != NULL) MSCALL1(freefunc, buf); - - return; } static void @@ -2216,8 +2177,6 @@ ExInitializeNPagedLookasideList(npaged_lookaside_list *lookaside, lookaside->nll_l.gl_type = NonPagedPool; lookaside->nll_l.gl_depth = depth; lookaside->nll_l.gl_maxdepth = LOOKASIDE_DEPTH; - - return; } static void @@ -2230,8 +2189,6 @@ ExDeleteNPagedLookasideList(lookaside) freefunc = lookaside->nll_l.gl_freefunc; while((buf = ntoskrnl_popsl(&lookaside->nll_l.gl_listhead)) != NULL) MSCALL1(freefunc, buf); - - return; } slist_entry * @@ -2245,7 +2202,7 @@ InterlockedPushEntrySList(head, entry) oldhead = ntoskrnl_pushsl(head, entry); mtx_unlock_spin(&ntoskrnl_interlock); - return(oldhead); + return (oldhead); } slist_entry * @@ -2258,7 +2215,7 @@ InterlockedPopEntrySList(head) first = ntoskrnl_popsl(head); mtx_unlock_spin(&ntoskrnl_interlock); - return(first); + return (first); } static slist_entry * @@ -2267,7 +2224,7 @@ ExInterlockedPushEntrySList(head, entry, lock) slist_entry *entry; kspin_lock *lock; { - return(InterlockedPushEntrySList(head, entry)); + return (InterlockedPushEntrySList(head, entry)); } static slist_entry * @@ -2275,7 +2232,7 @@ ExInterlockedPopEntrySList(head, lock) slist_header *head; kspin_lock *lock; { - return(InterlockedPopEntrySList(head)); + return (InterlockedPopEntrySList(head)); } uint16_t @@ -2288,7 +2245,7 @@ ExQueryDepthSList(head) depth = head->slh_list.slh_depth; mtx_unlock_spin(&ntoskrnl_interlock); - return(depth); + return (depth); } void @@ -2296,8 +2253,6 @@ KeInitializeSpinLock(lock) kspin_lock *lock; { *lock = 0; - - return; } #ifdef __i386__ @@ -2317,8 +2272,6 @@ KefAcquireSpinLockAtDpcLevel(lock) panic("DEADLOCK!"); #endif } - - return; } void @@ -2326,8 +2279,6 @@ KefReleaseSpinLockFromDpcLevel(lock) kspin_lock *lock; { atomic_store_rel_int((volatile u_int *)lock, 0); - - return; } uint8_t @@ -2341,7 +2292,7 @@ KeAcquireSpinLockRaiseToDpc(kspin_lock *lock) KeRaiseIrql(DISPATCH_LEVEL, &oldirql); KeAcquireSpinLockAtDpcLevel(lock); - return(oldirql); + return (oldirql); } #else void @@ -2349,16 +2300,12 @@ KeAcquireSpinLockAtDpcLevel(kspin_lock *lock) { while (atomic_cmpset_acq_int((volatile u_int *)lock, 0, 1) == 0) /* sit and spin */; - - return; } void KeReleaseSpinLockFromDpcLevel(kspin_lock *lock) { atomic_store_rel_int((volatile u_int *)lock, 0); - - return; } #endif /* __i386__ */ @@ -2374,7 +2321,7 @@ InterlockedExchange(dst, val) *dst = val; mtx_unlock_spin(&ntoskrnl_interlock); - return(r); + return (r); } static uint32_t @@ -2382,7 +2329,7 @@ InterlockedIncrement(addend) volatile uint32_t *addend; { atomic_add_long((volatile u_long *)addend, 1); - return(*addend); + return (*addend); } static uint32_t @@ -2390,7 +2337,7 @@ InterlockedDecrement(addend) volatile uint32_t *addend; { atomic_subtract_long((volatile u_long *)addend, 1); - return(*addend); + return (*addend); } static void @@ -2401,8 +2348,6 @@ ExInterlockedAddLargeStatistic(addend, inc) mtx_lock_spin(&ntoskrnl_interlock); *addend += inc; mtx_unlock_spin(&ntoskrnl_interlock); - - return; }; mdl * @@ -2462,8 +2407,6 @@ IoFreeMdl(m) uma_zfree(mdl_zone, m); else ExFreePool(m); - - return; } static void * @@ -2476,7 +2419,7 @@ MmAllocateContiguousMemory(size, highest) addr = ExAllocatePoolWithTag(NonPagedPool, pagelength, 0); - return(addr); + return (addr); } static void * @@ -2493,7 +2436,7 @@ MmAllocateContiguousMemorySpecifyCache(size, lowest, highest, addr = ExAllocatePoolWithTag(NonPagedPool, pagelength, 0); - return(addr); + return (addr); } static void @@ -2522,7 +2465,7 @@ MmSizeOfMdl(vaddr, len) l = sizeof(struct mdl) + (sizeof(vm_offset_t *) * SPAN_PAGES(vaddr, len)); - return(l); + return (l); } /* @@ -2551,22 +2494,20 @@ MmBuildMdlForNonPagedPool(m) m->mdl_flags |= MDL_SOURCE_IS_NONPAGED_POOL; m->mdl_mappedsystemva = MmGetMdlVirtualAddress(m); - - return; } static void * MmMapLockedPages(mdl *buf, uint8_t accessmode) { buf->mdl_flags |= MDL_MAPPED_TO_SYSTEM_VA; - return(MmGetMdlVirtualAddress(buf)); + return (MmGetMdlVirtualAddress(buf)); } static void * MmMapLockedPagesSpecifyCache(mdl *buf, uint8_t accessmode, uint32_t cachetype, void *vaddr, uint32_t bugcheck, uint32_t prio) { - return(MmMapLockedPages(buf, accessmode)); + return (MmMapLockedPages(buf, accessmode)); } static void @@ -2575,7 +2516,6 @@ MmUnmapLockedPages(vaddr, buf) mdl *buf; { buf->mdl_flags &= ~MDL_MAPPED_TO_SYSTEM_VA; - return; } /* @@ -2592,9 +2532,9 @@ MmIsAddressValid(vaddr) void *vaddr; { if (pmap_extract(kernel_map->pmap, (vm_offset_t)vaddr)) - return(TRUE); + return (TRUE); - return(FALSE); + return (FALSE); } void * @@ -2626,13 +2566,13 @@ MmMapIoSpace(paddr, len, cachetype) free(nexus_devs, M_TEMP); if (matching_dev == NULL) - return(NULL); + return (NULL); v = (vm_offset_t)rman_get_virtual(res); if (paddr > rman_get_start(res)) v += paddr - rman_get_start(res); - return((void *)v); + return ((void *)v); } void @@ -2640,7 +2580,6 @@ MmUnmapIoSpace(vaddr, len) void *vaddr; size_t len; { - return; } @@ -2662,7 +2601,7 @@ ntoskrnl_finddev(dev, paddr, res) /* We only want devices that have been successfully probed. */ if (device_is_alive(dev) == FALSE) - return(NULL); + return (NULL); rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); if (rl != NULL) { @@ -2685,7 +2624,7 @@ ntoskrnl_finddev(dev, paddr, res) bus_activate_resource(dev, SYS_RES_MEMORY, 0, r); *res = r; - return(dev); + return (dev); } } } @@ -2701,7 +2640,7 @@ ntoskrnl_finddev(dev, paddr, res) matching_dev = ntoskrnl_finddev(children[i], paddr, res); if (matching_dev != NULL) { free(children, M_TEMP); - return(matching_dev); + return (matching_dev); } } @@ -2711,7 +2650,7 @@ ntoskrnl_finddev(dev, paddr, res) if (children != NULL) free(children, M_TEMP); - return(NULL); + return (NULL); } /* @@ -2782,8 +2721,6 @@ ntoskrnl_destroy_workitem_threads(void) while (kq->kq_exit) tsleep(kq->kq_td->td_proc, PWAIT, "waitiw", hz/10); } - - return; } io_workitem * @@ -2794,7 +2731,7 @@ IoAllocateWorkItem(dobj) iw = uma_zalloc(iw_zone, M_NOWAIT); if (iw == NULL) - return(NULL); + return (NULL); InitializeListHead(&iw->iw_listentry); iw->iw_dobj = dobj; @@ -2804,7 +2741,7 @@ IoAllocateWorkItem(dobj) WORKIDX_INC(wq_idx); mtx_unlock(&ntoskrnl_dispatchlock); - return(iw); + return (iw); } void @@ -2812,7 +2749,6 @@ IoFreeWorkItem(iw) io_workitem *iw; { uma_zfree(iw_zone, iw); - return; } void @@ -2855,8 +2791,6 @@ IoQueueWorkItem(iw, iw_func, qtype, ctx) KeReleaseSpinLock(&kq->kq_lock, irql); KeSetEvent(&kq->kq_proc, IO_NO_INCREMENT, FALSE); - - return; } static void @@ -2873,8 +2807,6 @@ ntoskrnl_workitem(dobj, arg) f = (work_item_func)w->wqi_func; uma_zfree(iw_zone, iw); MSCALL2(f, w, w->wqi_ctx); - - return; } /* @@ -2945,8 +2877,6 @@ ExQueueWorkItem(w, qtype) iw->iw_idx = WORKITEM_LEGACY_THREAD; iwf = (io_workitem_func)ntoskrnl_findwrap((funcptr)ntoskrnl_workitem); IoQueueWorkItem(iw, iwf, qtype, iw); - - return; } static void @@ -2955,7 +2885,6 @@ RtlZeroMemory(dst, len) size_t len; { bzero(dst, len); - return; } static void @@ -2965,7 +2894,6 @@ RtlCopyMemory(dst, src, len) size_t len; { bcopy(src, dst, len); - return; } static size_t @@ -2984,7 +2912,7 @@ RtlCompareMemory(s1, s2, len) if (m1[i] == m2[i]) total++; } - return(total); + return (total); } void @@ -3004,8 +2932,6 @@ RtlInitAnsiString(dst, src) a->as_buf = src; a->as_len = a->as_maxlen = strlen(src); } - - return; } void @@ -3029,8 +2955,6 @@ RtlInitUnicodeString(dst, src) u->us_buf = src; u->us_len = u->us_maxlen = i * 2; } - - return; } ndis_status @@ -3084,7 +3008,7 @@ RtlUnicodeStringToInteger(ustr, base, val) ntoskrnl_unicode_to_ascii(uchr, astr, len); *val = strtoul(abuf, NULL, base); - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); } void @@ -3095,7 +3019,6 @@ RtlFreeUnicodeString(ustr) return; ExFreePool(ustr->us_buf); ustr->us_buf = NULL; - return; } void @@ -3106,7 +3029,6 @@ RtlFreeAnsiString(astr) return; ExFreePool(astr->as_buf); astr->as_buf = NULL; - return; } static int @@ -3130,7 +3052,7 @@ rand(void) microtime(&tv); srandom(tv.tv_usec); - return((int)random()); + return ((int)random()); } static void @@ -3138,15 +3060,14 @@ srand(seed) unsigned int seed; { srandom(seed); - return; } static uint8_t IoIsWdmVersionAvailable(uint8_t major, uint8_t minor) { if (major == WDM_MAJOR && minor == WDM_MINOR_WINXP) - return(TRUE); - return(FALSE); + return (TRUE); + return (FALSE); } static ndis_status @@ -3156,7 +3077,7 @@ IoGetDeviceObjectPointer(name, reqaccess, fileobj, devobj) void *fileobj; device_object *devobj; { - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); } static ndis_status @@ -3179,11 +3100,11 @@ IoGetDeviceProperty(devobj, regprop, buflen, prop, reslen) *reslen = drv->dro_drivername.us_len; break; default: - return(STATUS_INVALID_PARAMETER_2); + return (STATUS_INVALID_PARAMETER_2); break; } - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); } static void @@ -3198,7 +3119,6 @@ KeInitializeMutex(kmutex, level) kmutex->km_header.dh_type = DISP_TYPE_MUTANT; kmutex->km_header.dh_size = sizeof(kmutant) / sizeof(uint32_t); kmutex->km_ownerthread = NULL; - return; } static uint32_t @@ -3210,7 +3130,7 @@ KeReleaseMutex(kmutant *kmutex, uint8_t kwait) prevstate = kmutex->km_header.dh_sigstate; if (kmutex->km_ownerthread != curthread) { mtx_unlock(&ntoskrnl_dispatchlock); - return(STATUS_MUTANT_NOT_OWNED); + return (STATUS_MUTANT_NOT_OWNED); } kmutex->km_header.dh_sigstate++; @@ -3223,14 +3143,14 @@ KeReleaseMutex(kmutant *kmutex, uint8_t kwait) mtx_unlock(&ntoskrnl_dispatchlock); - return(prevstate); + return (prevstate); } static uint32_t KeReadStateMutex(kmutex) kmutant *kmutex; { - return(kmutex->km_header.dh_sigstate); + return (kmutex->km_header.dh_sigstate); } void @@ -3243,7 +3163,6 @@ KeInitializeEvent(nt_kevent *kevent, uint32_t type, uint8_t state) else kevent->k_header.dh_type = DISP_TYPE_SYNCHRONIZATION_EVENT; kevent->k_header.dh_size = sizeof(nt_kevent) / sizeof(uint32_t); - return; } uint32_t @@ -3257,7 +3176,7 @@ KeResetEvent(kevent) kevent->k_header.dh_sigstate = FALSE; mtx_unlock(&ntoskrnl_dispatchlock); - return(prevstate); + return (prevstate); } uint32_t @@ -3310,7 +3229,7 @@ KeSetEvent(nt_kevent *kevent, uint32_t increment, uint8_t kwait) mtx_unlock(&ntoskrnl_dispatchlock); - return(prevstate); + return (prevstate); } void @@ -3318,14 +3237,13 @@ KeClearEvent(kevent) nt_kevent *kevent; { kevent->k_header.dh_sigstate = FALSE; - return; } uint32_t KeReadStateEvent(kevent) nt_kevent *kevent; { - return(kevent->k_header.dh_sigstate); + return (kevent->k_header.dh_sigstate); } /* @@ -3370,7 +3288,7 @@ ObReferenceObjectByHandle(ndis_handle handle, uint32_t reqaccess, void *otype, nr = malloc(sizeof(nt_objref), M_DEVBUF, M_NOWAIT|M_ZERO); if (nr == NULL) - return(STATUS_INSUFFICIENT_RESOURCES); + return (STATUS_INSUFFICIENT_RESOURCES); InitializeListHead((&nr->no_dh.dh_waitlisthead)); nr->no_obj = handle; @@ -3381,7 +3299,7 @@ ObReferenceObjectByHandle(ndis_handle handle, uint32_t reqaccess, void *otype, TAILQ_INSERT_TAIL(&ntoskrnl_reflist, nr, link); *object = nr; - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); } static void @@ -3393,15 +3311,13 @@ ObfDereferenceObject(object) nr = object; TAILQ_REMOVE(&ntoskrnl_reflist, nr, link); free(nr, M_DEVBUF); - - return; } static uint32_t ZwClose(handle) ndis_handle handle; { - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); } static uint32_t @@ -3412,14 +3328,14 @@ WmiQueryTraceInformation(traceclass, traceinfo, infolen, reqlen, buf) uint32_t reqlen; void *buf; { - return(STATUS_NOT_FOUND); + return (STATUS_NOT_FOUND); } static uint32_t WmiTraceMessage(uint64_t loghandle, uint32_t messageflags, void *guid, uint16_t messagenum, ...) { - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); } static uint32_t @@ -3427,7 +3343,7 @@ IoWMIRegistrationControl(dobj, action) device_object *dobj; uint32_t action; { - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); } /* @@ -3472,7 +3388,7 @@ PsCreateSystemThread(handle, reqaccess, objattrs, phandle, tc = malloc(sizeof(thread_context), M_TEMP, M_NOWAIT); if (tc == NULL) - return(STATUS_INSUFFICIENT_RESOURCES); + return (STATUS_INSUFFICIENT_RESOURCES); tc->tc_thrctx = thrctx; tc->tc_thrfunc = thrfunc; @@ -3483,13 +3399,13 @@ PsCreateSystemThread(handle, reqaccess, objattrs, phandle, if (error) { free(tc, M_TEMP); - return(STATUS_INSUFFICIENT_RESOURCES); + return (STATUS_INSUFFICIENT_RESOURCES); } *handle = p; ntoskrnl_kth++; - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); } /* @@ -3522,7 +3438,7 @@ PsTerminateSystemThread(status) mtx_lock(&Giant); #endif kproc_exit(0); - return(0); /* notreached */ + return (0); /* notreached */ } static uint32_t @@ -3535,7 +3451,7 @@ DbgPrint(char *fmt, ...) vprintf(fmt, ap); } - return(STATUS_SUCCESS); + return (STATUS_SUCCESS); } static void @@ -3625,8 +3541,6 @@ ntoskrnl_timercall(arg) if (dpc != NULL) KeInsertQueueDpc(dpc, NULL, NULL); - - return; } #ifdef NTOSKRNL_DEBUG_TIMERS @@ -3661,8 +3575,6 @@ ntoskrnl_show_timers() printf("timer cancels: %qu\n", ntoskrnl_timer_cancels); printf("timer fires: %qu\n", ntoskrnl_timer_fires); printf("\n"); - - return; } #endif @@ -3700,8 +3612,6 @@ ntoskrnl_insert_timer(timer, ticks) callout_init(c, CALLOUT_MPSAFE); callout_reset(c, ticks, ntoskrnl_timercall, timer); - - return; } static void @@ -3716,8 +3626,6 @@ ntoskrnl_remove_timer(timer) mtx_lock_spin(&ntoskrnl_calllock); InsertHeadList((&ntoskrnl_calllist), (&e->ce_list)); mtx_unlock_spin(&ntoskrnl_calllock); - - return; } void @@ -3728,8 +3636,6 @@ KeInitializeTimer(timer) return; KeInitializeTimerEx(timer, EVENT_TYPE_NOTIFY); - - return; } void @@ -3749,8 +3655,6 @@ KeInitializeTimerEx(timer, type) else timer->k_header.dh_type = DISP_TYPE_SYNCHRONIZATION_TIMER; timer->k_header.dh_size = sizeof(ktimer) / sizeof(uint32_t); - - return; } /* @@ -3867,8 +3771,6 @@ ntoskrnl_destroy_dpc_threads(void) while (kq->kq_exit) tsleep(kq->kq_td->td_proc, PWAIT, "dpcw", hz/10); } - - return; } static uint8_t @@ -3883,7 +3785,7 @@ ntoskrnl_insert_dpc(head, dpc) while (l != head) { d = CONTAINING_RECORD(l, kdpc, k_dpclistentry); if (d == dpc) - return(FALSE); + return (FALSE); l = l->nle_flink; } @@ -3910,8 +3812,6 @@ KeInitializeDpc(dpc, dpcfunc, dpcctx) dpc->k_num = KDPC_CPU_DEFAULT; dpc->k_importance = KDPC_IMPORTANCE_MEDIUM; InitializeListHead((&dpc->k_dpclistentry)); - - return; } uint8_t @@ -3925,7 +3825,7 @@ KeInsertQueueDpc(dpc, sysarg1, sysarg2) uint8_t irql; if (dpc == NULL) - return(FALSE); + return (FALSE); kq = kq_queues; @@ -3954,11 +3854,11 @@ KeInsertQueueDpc(dpc, sysarg1, sysarg2) KeReleaseSpinLock(&kq->kq_lock, irql); if (r == FALSE) - return(r); + return (r); KeSetEvent(&kq->kq_proc, IO_NO_INCREMENT, FALSE); - return(r); + return (r); } uint8_t @@ -3969,7 +3869,7 @@ KeRemoveQueueDpc(dpc) uint8_t irql; if (dpc == NULL) - return(FALSE); + return (FALSE); #ifdef NTOSKRNL_MULTIPLE_DPCS KeRaiseIrql(DISPATCH_LEVEL, &irql); @@ -3985,7 +3885,7 @@ KeRemoveQueueDpc(dpc) if (dpc->k_dpclistentry.nle_flink == &dpc->k_dpclistentry) { KeReleaseSpinLockFromDpcLevel(&kq->kq_lock); KeLowerIrql(irql); - return(FALSE); + return (FALSE); } RemoveEntryList((&dpc->k_dpclistentry)); @@ -3993,7 +3893,7 @@ KeRemoveQueueDpc(dpc) KeReleaseSpinLock(&kq->kq_lock, irql); - return(TRUE); + return (TRUE); } void @@ -4007,7 +3907,6 @@ KeSetImportanceDpc(dpc, imp) return; dpc->k_importance = (uint8_t)imp; - return; } void @@ -4017,7 +3916,6 @@ KeSetTargetProcessorDpc(kdpc *dpc, uint8_t cpu) return; dpc->k_num = cpu; - return; } void @@ -4040,14 +3938,12 @@ KeFlushQueuedDpcs(void) KeSetEvent(&kq->kq_proc, IO_NO_INCREMENT, FALSE); KeWaitForSingleObject(&kq->kq_done, 0, 0, TRUE, NULL); } - - return; } uint32_t KeGetCurrentProcessorNumber(void) { - return((uint32_t)curthread->td_oncpu); + return ((uint32_t)curthread->td_oncpu); } uint8_t @@ -4062,7 +3958,7 @@ KeSetTimerEx(timer, duetime, period, dpc) uint8_t pending; if (timer == NULL) - return(FALSE); + return (FALSE); mtx_lock(&ntoskrnl_dispatchlock); @@ -4104,7 +4000,7 @@ KeSetTimerEx(timer, duetime, period, dpc) mtx_unlock(&ntoskrnl_dispatchlock); - return(pending); + return (pending); } uint8_t @@ -4129,7 +4025,7 @@ KeCancelTimer(timer) uint8_t pending; if (timer == NULL) - return(FALSE); + return (FALSE); mtx_lock(&ntoskrnl_dispatchlock); @@ -4145,14 +4041,14 @@ KeCancelTimer(timer) mtx_unlock(&ntoskrnl_dispatchlock); - return(pending); + return (pending); } uint8_t KeReadStateTimer(timer) ktimer *timer; { - return(timer->k_header.dh_sigstate); + return (timer->k_header.dh_sigstate); } static int32_t @@ -4222,8 +4118,7 @@ KeSetPriorityThread(td, pri) static void dummy() { - printf ("ntoskrnl dummy called...\n"); - return; + printf("ntoskrnl dummy called...\n"); } diff --git a/sys/compat/ndis/subr_pe.c b/sys/compat/ndis/subr_pe.c index 6a347a427eb2..fcbaef28acc3 100644 --- a/sys/compat/ndis/subr_pe.c +++ b/sys/compat/ndis/subr_pe.c @@ -89,7 +89,7 @@ pe_get_dos_header(imgbase, hdr) bcopy ((char *)imgbase, (char *)hdr, sizeof(image_dos_header)); - return(0); + return (0); } /* @@ -111,10 +111,10 @@ pe_is_nt_image(imgbase) dos_hdr = (image_dos_header *)imgbase; signature = *(uint32_t *)(imgbase + dos_hdr->idh_lfanew); if (signature == IMAGE_NT_SIGNATURE) - return(0); + return (0); } - return(ENOEXEC); + return (ENOEXEC); } /* @@ -132,7 +132,7 @@ pe_get_optional_header(imgbase, hdr) image_nt_header *nt_hdr; if (imgbase == 0 || hdr == NULL) - return(EINVAL); + return (EINVAL); if (pe_is_nt_image(imgbase)) return (EINVAL); @@ -143,7 +143,7 @@ pe_get_optional_header(imgbase, hdr) bcopy ((char *)&nt_hdr->inh_optionalhdr, (char *)hdr, nt_hdr->inh_filehdr.ifh_optionalhdrlen); - return(0); + return (0); } /* @@ -160,7 +160,7 @@ pe_get_file_header(imgbase, hdr) image_nt_header *nt_hdr; if (imgbase == 0 || hdr == NULL) - return(EINVAL); + return (EINVAL); if (pe_is_nt_image(imgbase)) return (EINVAL); @@ -179,7 +179,7 @@ pe_get_file_header(imgbase, hdr) bcopy ((char *)&nt_hdr->inh_filehdr, (char *)hdr, sizeof(image_file_header)); - return(0); + return (0); } /* @@ -197,7 +197,7 @@ pe_get_section_header(imgbase, hdr) image_section_header *sect_hdr; if (imgbase == 0 || hdr == NULL) - return(EINVAL); + return (EINVAL); if (pe_is_nt_image(imgbase)) return (EINVAL); @@ -208,7 +208,7 @@ pe_get_section_header(imgbase, hdr) bcopy ((char *)sect_hdr, (char *)hdr, sizeof(image_section_header)); - return(0); + return (0); } /* @@ -222,7 +222,7 @@ pe_numsections(imgbase) image_file_header file_hdr; if (pe_get_file_header(imgbase, &file_hdr)) - return(0); + return (0); return (file_hdr.ifh_numsections); } @@ -239,7 +239,7 @@ pe_imagebase(imgbase) image_optional_header optional_hdr; if (pe_get_optional_header(imgbase, &optional_hdr)) - return(0); + return (0); return (optional_hdr.ioh_imagebase); } @@ -258,14 +258,14 @@ pe_directory_offset(imgbase, diridx) vm_offset_t dir; if (pe_get_optional_header(imgbase, &opt_hdr)) - return(0); + return (0); if (diridx >= opt_hdr.ioh_rva_size_cnt) - return(0); + return (0); dir = opt_hdr.ioh_datadir[diridx].idd_vaddr; - return(pe_translate_addr(imgbase, dir)); + return (pe_translate_addr(imgbase, dir)); } vm_offset_t @@ -280,7 +280,7 @@ pe_translate_addr(imgbase, rva) int i = 0, sections, fixedlen; if (pe_get_optional_header(imgbase, &opt_hdr)) - return(0); + return (0); sections = pe_numsections(imgbase); @@ -310,9 +310,9 @@ pe_translate_addr(imgbase, rva) } if (i > sections) - return(0); + return (0); - return((vm_offset_t)(imgbase + rva - sect_hdr->ish_vaddr + + return ((vm_offset_t)(imgbase + rva - sect_hdr->ish_vaddr + sect_hdr->ish_rawdataaddr)); } @@ -335,7 +335,7 @@ pe_get_section(imgbase, hdr, name) int i, sections; if (imgbase == 0 || hdr == NULL) - return(EINVAL); + return (EINVAL); if (pe_is_nt_image(imgbase)) return (EINVAL); @@ -350,7 +350,7 @@ pe_get_section(imgbase, hdr, name) if (!strcmp ((char *)§_hdr->ish_name, name)) { bcopy((char *)sect_hdr, (char *)hdr, sizeof(image_section_header)); - return(0); + return (0); } else sect_hdr++; } @@ -420,7 +420,7 @@ pe_relocate(imgbase) break; default: - printf ("[%d]reloc type: %d\n",i, + printf("[%d]reloc type: %d\n",i, IMR_RELTYPE(rel)); break; } @@ -429,7 +429,7 @@ pe_relocate(imgbase) relhdr->ibr_blocksize); } while (relhdr->ibr_blocksize); - return(0); + return (0); } /* @@ -452,7 +452,7 @@ pe_get_import_descriptor(imgbase, desc, module) char *modname; if (imgbase == 0 || module == NULL || desc == NULL) - return(EINVAL); + return (EINVAL); offset = pe_directory_offset(imgbase, IMAGE_DIRECTORY_ENTRY_IMPORT); if (offset == 0) @@ -466,7 +466,7 @@ pe_get_import_descriptor(imgbase, desc, module) if (!strncasecmp(module, modname, strlen(module))) { bcopy((char *)imp_desc, (char *)desc, sizeof(image_import_descriptor)); - return(0); + return (0); } imp_desc++; } @@ -486,7 +486,7 @@ pe_get_messagetable(imgbase, md) int i; if (imgbase == 0) - return(EINVAL); + return (EINVAL); offset = pe_directory_offset(imgbase, IMAGE_DIRECTORY_ENTRY_RESOURCE); if (offset == 0) @@ -514,10 +514,10 @@ pe_get_messagetable(imgbase, md) dent2->irde_dataoff); *md = (message_resource_data *)pe_translate_addr(imgbase, rent->irde_offset); - return(0); + return (0); } - return(ENOENT); + return (ENOENT); } int @@ -536,7 +536,7 @@ pe_get_message(imgbase, id, str, len, flags) pe_get_messagetable(imgbase, &md); if (md == NULL) - return(ENOENT); + return (ENOENT); mb = (message_resource_block *)((uintptr_t)md + sizeof(message_resource_data)); @@ -551,12 +551,12 @@ pe_get_message(imgbase, id, str, len, flags) *str = me->mre_text; *len = me->mre_len; *flags = me->mre_flags; - return(0); + return (0); } mb++; } - return(ENOENT); + return (ENOENT); } /* @@ -573,16 +573,16 @@ pe_functbl_match(functbl, name) image_patch_table *p; if (functbl == NULL || name == NULL) - return(0); + return (0); p = functbl; while (p->ipt_name != NULL) { if (!strcmp(p->ipt_name, name)) - return((vm_offset_t)p->ipt_wrap); + return ((vm_offset_t)p->ipt_wrap); p++; } - printf ("no match for %s\n", name); + printf("no match for %s\n", name); /* * Return the wrapper pointer for this routine. @@ -591,7 +591,7 @@ pe_functbl_match(functbl, name) * that does calling convention translation and * then invokes the underlying routine. */ - return((vm_offset_t)p->ipt_wrap); + return ((vm_offset_t)p->ipt_wrap); } /* @@ -615,10 +615,10 @@ pe_patch_imports(imgbase, module, functbl) vm_offset_t func; if (imgbase == 0 || module == NULL || functbl == NULL) - return(EINVAL); + return (EINVAL); if (pe_get_import_descriptor(imgbase, &imp_desc, module)) - return(ENOEXEC); + return (ENOEXEC); nptr = (vm_offset_t *)pe_translate_addr(imgbase, imp_desc.iid_import_name_table_addr); @@ -632,11 +632,11 @@ pe_patch_imports(imgbase, module, functbl) *fptr = func; #ifdef notdef if (*fptr == 0) - return(ENOENT); + return (ENOENT); #endif nptr++; fptr++; } - return(0); + return (0); } diff --git a/sys/compat/ndis/subr_usbd.c b/sys/compat/ndis/subr_usbd.c index 1aae86865151..3b38aab7c801 100644 --- a/sys/compat/ndis/subr_usbd.c +++ b/sys/compat/ndis/subr_usbd.c @@ -206,7 +206,7 @@ usbd_libinit(void) usbd_driver.dro_dispatch[IRP_MJ_PNP] = (driver_dispatch)usbd_pnp_wrap; - return(0); + return (0); } int @@ -230,7 +230,7 @@ usbd_libfini(void) free(usbd_driver.dro_drivername.us_buf, M_DEVBUF); - return(0); + return (0); } static int32_t @@ -589,7 +589,7 @@ usbd_func_selconf(ip) intf->uii_len); } - return USBD_STATUS_SUCCESS; + return (USBD_STATUS_SUCCESS); } static usb_error_t @@ -1348,10 +1348,10 @@ USBD_CreateConfigurationRequest(conf, len) -1, -1, -1, -1, -1); urb = USBD_CreateConfigurationRequestEx(conf, list); if (urb == NULL) - return NULL; + return (NULL); *len = urb->uu_selconf.usc_hdr.uuh_len; - return urb; + return (urb); } static union usbd_urb * @@ -1375,7 +1375,7 @@ USBD_CreateConfigurationRequestEx(conf, list) selconf = ExAllocatePoolWithTag(NonPagedPool, size, 0); if (selconf == NULL) - return NULL; + return (NULL); selconf->usc_hdr.uuh_func = URB_FUNCTION_SELECT_CONFIGURATION; selconf->usc_hdr.uuh_len = size; selconf->usc_handle = conf; @@ -1421,8 +1421,6 @@ USBD_GetUSBDIVersion(ui) ui->uvi_usbdi_vers = USBDI_VERSION; ui->uvi_supported_vers = USB_VER_2_0; - - return; } static usb_interface_descriptor_t * @@ -1473,7 +1471,6 @@ static void dummy(void) { printf("USBD dummy called\n"); - return; } image_patch_table usbd_functbl[] = { diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index 2c8b32455d7b..7651145f6b0e 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include - #include #include #include @@ -137,7 +136,6 @@ static void ndis_linksts (ndis_handle, ndis_status, void *, uint32_t); static void ndis_linksts_done (ndis_handle); /* We need to wrap these functions for amd64. */ - static funcptr ndis_txeof_wrap; static funcptr ndis_rxeof_wrap; static funcptr ndis_rxeof_eth_wrap; @@ -210,7 +208,6 @@ static int ndisdrv_loaded = 0; * image, and create a Windows driver object which will be * saved in our driver database. */ - int ndisdrv_modevent(mod, cmd, arg) module_t mod; @@ -299,7 +296,7 @@ ndis_setmulti(sc) error = ndis_set_info(sc, OID_GEN_CURRENT_PACKET_FILTER, &sc->ndis_filter, &len); if (error) - device_printf (sc->ndis_dev, + device_printf(sc->ndis_dev, "set allmulti failed: %d\n", error); return; } @@ -339,7 +336,7 @@ ndis_setmulti(sc) len = len * ETHER_ADDR_LEN; error = ndis_set_info(sc, OID_802_3_MULTICAST_LIST, mclist, &len); if (error) { - device_printf (sc->ndis_dev, "set mclist failed: %d\n", error); + device_printf(sc->ndis_dev, "set mclist failed: %d\n", error); sc->ndis_filter |= NDIS_PACKET_TYPE_ALL_MULTICAST; sc->ndis_filter &= ~NDIS_PACKET_TYPE_MULTICAST; } @@ -351,9 +348,7 @@ ndis_setmulti(sc) error = ndis_set_info(sc, OID_GEN_CURRENT_PACKET_FILTER, &sc->ndis_filter, &len); if (error) - device_printf (sc->ndis_dev, "set multi failed: %d\n", error); - - return; + device_printf(sc->ndis_dev, "set multi failed: %d\n", error); } static int @@ -369,16 +364,16 @@ ndis_set_offload(sc) ifp = sc->ifp; if (!NDIS_INITIALIZED(sc)) - return(EINVAL); + return (EINVAL); /* See if there's anything to set. */ error = ndis_probe_offload(sc); if (error) - return(error); + return (error); if (sc->ndis_hwassist == 0 && ifp->if_capabilities == 0) - return(0); + return (0); len = sizeof(ndis_task_offload_hdr) + sizeof(ndis_task_offload) + sizeof(ndis_task_tcpip_csum); @@ -386,7 +381,7 @@ ndis_set_offload(sc) ntoh = malloc(len, M_TEMP, M_NOWAIT|M_ZERO); if (ntoh == NULL) - return(ENOMEM); + return (ENOMEM); ntoh->ntoh_vers = NDIS_TASK_OFFLOAD_VERSION; ntoh->ntoh_len = sizeof(ndis_task_offload_hdr); @@ -415,7 +410,7 @@ ndis_set_offload(sc) error = ndis_set_info(sc, OID_TCP_TASK_OFFLOAD, ntoh, &len); free(ntoh, M_TEMP); - return(error); + return (error); } static int @@ -434,12 +429,12 @@ ndis_probe_offload(sc) error = ndis_get_info(sc, OID_TCP_TASK_OFFLOAD, &dummy, &len); if (error != ENOSPC) - return(error); + return (error); ntoh = malloc(len, M_TEMP, M_NOWAIT|M_ZERO); if (ntoh == NULL) - return(ENOMEM); + return (ENOMEM); ntoh->ntoh_vers = NDIS_TASK_OFFLOAD_VERSION; ntoh->ntoh_len = sizeof(ndis_task_offload_hdr); @@ -451,12 +446,12 @@ ndis_probe_offload(sc) if (error) { free(ntoh, M_TEMP); - return(error); + return (error); } if (ntoh->ntoh_vers != NDIS_TASK_OFFLOAD_VERSION) { free(ntoh, M_TEMP); - return(EINVAL); + return (EINVAL); } nto = (ndis_task_offload *)((char *)ntoh + @@ -481,7 +476,7 @@ ndis_probe_offload(sc) if (nttc == NULL) { free(ntoh, M_TEMP); - return(ENOENT); + return (ENOENT); } sc->ndis_v4tx = nttc->nttc_v4tx; @@ -505,7 +500,7 @@ ndis_probe_offload(sc) ifp->if_capabilities |= IFCAP_RXCSUM; free(ntoh, M_TEMP); - return(0); + return (0); } static int @@ -632,7 +627,7 @@ ndis_attach(dev) /* Call driver's init routine. */ if (ndis_init_nic(sc)) { - device_printf (dev, "init handler failed\n"); + device_printf(dev, "init handler failed\n"); error = ENXIO; goto fail; } @@ -650,7 +645,7 @@ ndis_attach(dev) len = sizeof(sc->ndis_maxpkts); if (ndis_get_info(sc, OID_GEN_MAXIMUM_SEND_PACKETS, &sc->ndis_maxpkts, &len)) { - device_printf (dev, "failed to get max TX packets\n"); + device_printf(dev, "failed to get max TX packets\n"); error = ENXIO; goto fail; } @@ -659,7 +654,6 @@ ndis_attach(dev) * If this is a deserialized miniport, we don't have * to honor the OID_GEN_MAXIMUM_SEND_PACKETS result. */ - if (!NDIS_SERIALIZED(sc->ndis_block)) sc->ndis_maxpkts = NDIS_TXPKTS; @@ -698,12 +692,11 @@ ndis_attach(dev) * supported by this driver. If it is, then this an 802.11 * wireless driver, and we should set up media for wireless. */ - for (i = 0; i < sc->ndis_oidcnt; i++) { + for (i = 0; i < sc->ndis_oidcnt; i++) if (sc->ndis_oids[i] == OID_802_11_CONFIGURATION) { sc->ndis_80211++; break; } - } if (sc->ndis_80211) ifp = if_alloc(IFT_IEEE80211); @@ -783,7 +776,7 @@ ndis_attach(dev) r = ndis_get_info(sc, OID_802_11_SUPPORTED_RATES, (void *)rates, &len); if (r) - device_printf (dev, "get rates failed: 0x%x\n", r); + device_printf(dev, "get rates failed: 0x%x\n", r); /* * Since the supported rates only up to 8 can be supported, * if this is not 802.11b we're just going to be faking it @@ -975,7 +968,7 @@ ndis_attach(dev) ndis_halt_nic(sc); DPRINTF(("halting done.\n")); - return(error); + return (error); } static struct ieee80211vap * @@ -1116,7 +1109,7 @@ ndis_detach(dev) if (sc->ndis_iftype == PCIBus) bus_dma_tag_destroy(sc->ndis_parent_tag); - return(0); + return (0); } int @@ -1134,7 +1127,7 @@ ndis_suspend(dev) ndis_stop(sc); #endif - return(0); + return (0); } int @@ -1150,7 +1143,7 @@ ndis_resume(dev) if (NDIS_INITIALIZED(sc)) ndis_init(sc); - return(0); + return (0); } /* @@ -1160,7 +1153,6 @@ ndis_resume(dev) * serialized miniports, or IRQL <= DISPATCH_LEVEL for deserialized * miniports. */ - static void ndis_rxeof_eth(adapter, ctx, addr, hdr, hdrlen, lookahead, lookaheadlen, pktlen) ndis_handle adapter; @@ -1230,8 +1222,6 @@ ndis_rxeof_eth(adapter, ctx, addr, hdr, hdrlen, lookahead, lookaheadlen, pktlen) if (!NDIS_SERIALIZED(block)) KeReleaseSpinLock(&block->nmb_lock, irql); - - return; } /* @@ -1239,7 +1229,6 @@ ndis_rxeof_eth(adapter, ctx, addr, hdr, hdrlen, lookahead, lookaheadlen, pktlen) * for serialized miniports, or IRQL <= DISPATCH_LEVEL for deserialized * miniports. */ - static void ndis_rxeof_done(adapter) ndis_handle adapter; @@ -1254,8 +1243,6 @@ ndis_rxeof_done(adapter) sc = device_get_softc(block->nmb_physdeviceobj->do_devext); KeInsertQueueDpc(&sc->ndis_rxdpc, NULL, NULL); - - return; } /* @@ -1330,8 +1317,6 @@ ndis_rxeof_xfr(dpc, adapter, sysarg1, sysarg2) } KeReleaseSpinLockFromDpcLevel(&block->nmb_lock); - - return; } /* @@ -1370,8 +1355,6 @@ ndis_rxeof_xfr_done(adapter, packet, status, len) IoQueueWorkItem(sc->ndis_inputitem, (io_workitem_func)ndis_inputtask_wrap, WORKQUEUE_CRITICAL, ifp); - - return; } /* * A frame has been uploaded: pass the resulting mbuf chain up to @@ -1416,7 +1399,6 @@ ndis_rxeof(adapter, packets, pktcnt) * before we're completely ready to handle them. If we detect this, * we need to return them to the miniport and ignore them. */ - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { for (i = 0; i < pktcnt; i++) { p = packets[i]; @@ -1433,7 +1415,7 @@ ndis_rxeof(adapter, packets, pktcnt) /* Stash the softc here so ptom can use it. */ p->np_softc = sc; if (ndis_ptom(&m0, p)) { - device_printf (sc->ndis_dev, "ptom failed\n"); + device_printf(sc->ndis_dev, "ptom failed\n"); if (p->np_oob.npo_status == NDIS_STATUS_SUCCESS) ndis_return_packet(p, block); } else { @@ -1498,8 +1480,6 @@ ndis_rxeof(adapter, packets, pktcnt) WORKQUEUE_CRITICAL, ifp); } } - - return; } /* @@ -1508,7 +1488,6 @@ ndis_rxeof(adapter, packets, pktcnt) * with any locks held (at DISPATCH_LEVEL, we'll be holding the * 'dispatch level' per-cpu sleep lock). */ - static void ndis_inputtask(dobj, arg) device_object *dobj; @@ -1541,8 +1520,6 @@ ndis_inputtask(dobj, arg) KeAcquireSpinLock(&sc->ndis_rxlock, &irql); } KeReleaseSpinLock(&sc->ndis_rxlock, irql); - - return; } /* @@ -1591,8 +1568,6 @@ ndis_txeof(adapter, packet, status) IoQueueWorkItem(sc->ndis_startitem, (io_workitem_func)ndis_starttask_wrap, WORKQUEUE_CRITICAL, ifp); - - return; } static void @@ -1633,8 +1608,6 @@ ndis_linksts(adapter, status, sbuf, slen) sc->ndis_evt[sc->ndis_evtpidx].ne_len = slen; NDIS_EVTINC(sc->ndis_evtpidx); NDIS_UNLOCK(sc); - - return; } static void @@ -1674,8 +1647,6 @@ ndis_linksts_done(adapter) /* Notify possible listners of interface change. */ rt_ifmsg(ifp); - - return; } static void @@ -1765,8 +1736,6 @@ ndis_ticktask(d, xsc) } NDIS_UNLOCK(sc); - - return; } static void @@ -1792,8 +1761,6 @@ ndis_map_sclist(arg, segs, nseg, mapsize, error) sclist->nsl_elements[i].nse_addr.np_quad = segs[i].ds_addr; sclist->nsl_elements[i].nse_len = segs[i].ds_len; } - - return; } static int @@ -1803,7 +1770,7 @@ ndis_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, /* no support; just discard */ m_freem(m); ieee80211_free_node(ni); - return 0; + return (0); } static void @@ -1831,7 +1798,6 @@ ndis_starttask(d, arg) if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ndis_start(ifp); - return; } /* @@ -1846,7 +1812,6 @@ ndis_starttask(d, arg) * we need to perform busdma work here. Those that use map registers * will do the mapping themselves on a buffer by buffer basis. */ - static void ndis_start(ifp) struct ifnet *ifp; @@ -1860,7 +1825,6 @@ ndis_start(ifp) sc = ifp->if_softc; NDIS_LOCK(sc); - if (!sc->ndis_link || ifp->if_drv_flags & IFF_DRV_OACTIVE) { NDIS_UNLOCK(sc); return; @@ -1933,7 +1897,6 @@ ndis_start(ifp) * If there's a BPF listener, bounce a copy of this frame * to him. */ - if (!sc->ndis_80211) /* XXX handle 80211 */ BPF_MTAP(ifp, m); @@ -1944,7 +1907,6 @@ ndis_start(ifp) * so the this batch of packets can be transmitted, then * wait for txeof to ask us to send the rest. */ - if (sc->ndis_txidx == 0) break; } @@ -1970,7 +1932,6 @@ ndis_start(ifp) * a MiniportSend() routine (which sends just a single * packet). */ - if (sc->ndis_chars->nmc_sendmulti_func != NULL) ndis_send_packets(sc, p0, pcnt); else @@ -2029,12 +1990,11 @@ ndis_init(xsc) &sc->ndis_filter, &len); if (error) - device_printf (sc->ndis_dev, "set filter failed: %d\n", error); + device_printf(sc->ndis_dev, "set filter failed: %d\n", error); /* * Set lookahead. */ - i = ifp->if_mtu; len = sizeof(i); ndis_set_info(sc, OID_GEN_CURRENT_LOOKAHEAD, &i, &len); @@ -2091,7 +2051,7 @@ ndis_ifmedia_upd(ifp) if (NDIS_INITIALIZED(sc)) ndis_init(sc); - return(0); + return (0); } /* @@ -2105,7 +2065,7 @@ ndis_ifmedia_sts(ifp, ifmr) struct ndis_softc *sc; uint32_t media_info; ndis_media_state linkstate; - int error, len; + int len; ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; @@ -2115,17 +2075,17 @@ ndis_ifmedia_sts(ifp, ifmr) return; len = sizeof(linkstate); - error = ndis_get_info(sc, OID_GEN_MEDIA_CONNECT_STATUS, + ndis_get_info(sc, OID_GEN_MEDIA_CONNECT_STATUS, (void *)&linkstate, &len); len = sizeof(media_info); - error = ndis_get_info(sc, OID_GEN_LINK_SPEED, + ndis_get_info(sc, OID_GEN_LINK_SPEED, (void *)&media_info, &len); if (linkstate == nmc_connected) ifmr->ifm_status |= IFM_ACTIVE; - switch(media_info) { + switch (media_info) { case 100000: ifmr->ifm_active |= IFM_10_T; break; @@ -2139,8 +2099,6 @@ ndis_ifmedia_sts(ifp, ifmr) device_printf(sc->ndis_dev, "unknown speed: %d\n", media_info); break; } - - return; } static int @@ -2158,19 +2116,19 @@ ndis_set_cipher(sc, cipher) if (cipher == WPA_CSE_WEP40 || WPA_CSE_WEP104) { if (!(ic->ic_cryptocaps & IEEE80211_CRYPTO_WEP)) - return(ENOTSUP); + return (ENOTSUP); arg = NDIS_80211_WEPSTAT_ENC1ENABLED; } if (cipher == WPA_CSE_TKIP) { if (!(ic->ic_cryptocaps & IEEE80211_CRYPTO_TKIP)) - return(ENOTSUP); + return (ENOTSUP); arg = NDIS_80211_WEPSTAT_ENC2ENABLED; } if (cipher == WPA_CSE_CCMP) { if (!(ic->ic_cryptocaps & IEEE80211_CRYPTO_AES_CCM)) - return(ENOTSUP); + return (ENOTSUP); arg = NDIS_80211_WEPSTAT_ENC3ENABLED; } @@ -2179,7 +2137,7 @@ ndis_set_cipher(sc, cipher) rval = ndis_set_info(sc, OID_802_11_ENCRYPTION_STATUS, &arg, &len); if (rval) - return(rval); + return (rval); /* Check that the cipher was set correctly. */ @@ -2187,9 +2145,9 @@ ndis_set_cipher(sc, cipher) rval = ndis_get_info(sc, OID_802_11_ENCRYPTION_STATUS, &arg, &len); if (rval != 0 || arg != save) - return(ENODEV); + return (ENODEV); - return(0); + return (0); } /* @@ -2200,7 +2158,6 @@ ndis_set_cipher(sc, cipher) * of the WPA authentication modes isn't enabled, the driver * might not permit the TKIP or AES ciphers to be selected. */ - static int ndis_set_wpa(sc, ie, ielen) struct ndis_softc *sc; @@ -2226,7 +2183,7 @@ ndis_set_wpa(sc, ie, ielen) /* Check for the right kind of IE. */ if (w->wpa_id != IEEE80211_ELEMID_VENDOR) { DPRINTF(("Incorrect IE type %d\n", w->wpa_id)); - return(EINVAL); + return (EINVAL); } /* Skip over the ucast cipher OIDs. */ @@ -2254,7 +2211,7 @@ ndis_set_wpa(sc, ie, ielen) DPRINTF(("Setting WPA auth mode to %d\n", arg)); i = sizeof(arg); if (ndis_set_info(sc, OID_802_11_AUTHENTICATION_MODE, &arg, &i)) - return(ENOTSUP); + return (ENOTSUP); i = sizeof(arg); ndis_get_info(sc, OID_802_11_AUTHENTICATION_MODE, &arg, &i); @@ -2264,7 +2221,7 @@ ndis_set_wpa(sc, ie, ielen) n = (struct ndis_ie *)&w->wpa_mcipher[0]; if (ndis_set_cipher(sc, n->ni_val)) - return(ENOTSUP); + return (ENOTSUP); /* Now start looking around for the unicast ciphers. */ pos = (char *)&w->wpa_uciphers[0]; @@ -2272,11 +2229,11 @@ ndis_set_wpa(sc, ie, ielen) for (i = 0; i < w->wpa_uciphercnt; i++) { if (ndis_set_cipher(sc, n->ni_val)) - return(ENOTSUP); + return (ENOTSUP); n++; } - return(0); + return (0); } static void @@ -2301,7 +2258,6 @@ ndis_setstate_80211(sc) } /* Disassociate and turn off radio. */ - len = sizeof(arg); arg = 1; ndis_set_info(sc, OID_802_11_DISASSOCIATE, &arg, &len); @@ -2320,7 +2276,6 @@ ndis_setstate_80211(sc) device_printf (sc->ndis_dev, "set infra failed: %d\n", rval); /* Set power management */ - len = sizeof(arg); if (vap->iv_flags & IEEE80211_F_PMGTON) arg = NDIS_80211_POWERMODE_FAST_PSP; @@ -2340,7 +2295,6 @@ ndis_setstate_80211(sc) * Default encryption mode to off, authentication * to open and privacy to 'accept everything.' */ - len = sizeof(arg); arg = NDIS_80211_WEPSTAT_DISABLED; ndis_set_info(sc, OID_802_11_ENCRYPTION_STATUS, &arg, &len); @@ -2350,7 +2304,7 @@ ndis_setstate_80211(sc) ndis_set_info(sc, OID_802_11_AUTHENTICATION_MODE, &arg, &len); /* - * Note that OID_80211_PRIVACY_FILTER is optional: + * Note that OID_802_11_PRIVACY_FILTER is optional: * not all drivers implement it. */ len = sizeof(arg); @@ -2407,7 +2361,6 @@ ndis_setstate_80211(sc) if (rval) device_printf(sc->ndis_dev, "setting BSSID failed: %d\n", rval); - } static void @@ -2465,7 +2418,7 @@ ndis_auth_and_assoc(sc, vap) if (vap->iv_flags & IEEE80211_F_PRIVACY && !(vap->iv_flags & IEEE80211_F_WPA)) { - int keys_set = 0; + int keys_set = 0; if (ni->ni_authmode == IEEE80211_AUTH_SHARED) { len = sizeof(arg); @@ -2484,9 +2437,9 @@ ndis_auth_and_assoc(sc, vap) /* * 5, 13 and 16 are the only valid - * only valid key lengths. Anything - * in between will be zero padded out to - * the next highest boundary. + * key lengths. Anything in between + * will be zero padded out to the + * next highest boundary. */ if (vap->iv_nw_keys[i].wk_keylen < 5) wep.nw_keylen = 5; @@ -2569,7 +2522,7 @@ ndis_auth_and_assoc(sc, vap) rval = ndis_set_info(sc, OID_802_11_NETWORK_TYPE_IN_USE, &arg, &len); if (rval) - device_printf (sc->ndis_dev, + device_printf(sc->ndis_dev, "set nettype failed: %d\n", rval); } #endif @@ -2672,13 +2625,13 @@ ndis_get_assoc(sc, assoc) int i, len, error; if (!sc->ndis_link) - return(ENOENT); + return (ENOENT); len = sizeof(bssid); error = ndis_get_info(sc, OID_802_11_BSSID, &bssid, &len); if (error) { device_printf(sc->ndis_dev, "failed to get bssid\n"); - return(ENOENT); + return (ENOENT); } vap = TAILQ_FIRST(&ic->ic_vaps); @@ -2694,19 +2647,19 @@ ndis_get_assoc(sc, assoc) *assoc = malloc(bs->nwbx_len, M_TEMP, M_NOWAIT); if (*assoc == NULL) { free(bl, M_TEMP); - return(ENOMEM); + return (ENOMEM); } bcopy((char *)bs, (char *)*assoc, bs->nwbx_len); free(bl, M_TEMP); if (ic->ic_opmode == IEEE80211_M_STA) ni->ni_associd = 1 | 0xc000; /* fake associd */ - return(0); + return (0); } bs = (ndis_wlan_bssid_ex *)((char *)bs + bs->nwbx_len); } free(bl, M_TEMP); - return(ENOENT); + return (ENOENT); } static void @@ -2746,7 +2699,7 @@ ndis_getstate_80211(sc) len = sizeof(arg); rval = ndis_get_info(sc, OID_GEN_LINK_SPEED, &arg, &len); if (rval) - device_printf (sc->ndis_dev, "get link speed failed: %d\n", + device_printf(sc->ndis_dev, "get link speed failed: %d\n", rval); ni->ni_txrate = arg / 5000; @@ -2787,18 +2740,16 @@ ndis_getstate_80211(sc) free(bs, M_TEMP); /* - * Determine current authentication mode. Note: authmode - * reporting isn't supported prior to FreeBSD 6.x. + * Determine current authentication mode. */ - len = sizeof(arg); rval = ndis_get_info(sc, OID_802_11_AUTHENTICATION_MODE, &arg, &len); if (rval) - device_printf (sc->ndis_dev, + device_printf(sc->ndis_dev, "get authmode status failed: %d\n", rval); else { vap->iv_flags &= ~IEEE80211_F_WPA; - switch(arg) { + switch (arg) { case NDIS_80211_AUTHMODE_OPEN: ni->ni_authmode = IEEE80211_AUTH_OPEN; break; @@ -2829,14 +2780,13 @@ ndis_getstate_80211(sc) rval = ndis_get_info(sc, OID_802_11_WEP_STATUS, &arg, &len); if (rval) - device_printf (sc->ndis_dev, + device_printf(sc->ndis_dev, "get wep status failed: %d\n", rval); if (arg == NDIS_80211_WEPSTAT_ENABLED) vap->iv_flags |= IEEE80211_F_PRIVACY|IEEE80211_F_DROPUNENC; else vap->iv_flags &= ~(IEEE80211_F_PRIVACY|IEEE80211_F_DROPUNENC); - return; } static int @@ -2851,7 +2801,7 @@ ndis_ioctl(ifp, command, data) /*NDIS_LOCK(sc);*/ - switch(command) { + switch (command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING && @@ -2922,7 +2872,7 @@ ndis_ioctl_80211(ifp, command, data) void *oidbuf; int error = 0; - switch(command) { + switch (command) { case SIOCSIFFLAGS: /*NDIS_LOCK(sc);*/ if (ifp->if_flags & IFF_UP) { @@ -3045,7 +2995,7 @@ ndis_ioctl_80211(ifp, command, data) error = EINVAL; break; } - return(error); + return (error); } int @@ -3071,9 +3021,9 @@ ndis_del_key(vap, key) error = ndis_set_info(sc, OID_802_11_REMOVE_KEY, &rkey, &len); if (error) - return(0); + return (0); - return(1); + return (1); } /* @@ -3081,7 +3031,6 @@ ndis_del_key(vap, key) * only use it for WPA TKIP or AES keys. These need to be * set after initial authentication with the AP. */ - static int ndis_add_key(vap, key, mac) struct ieee80211vap *vap; @@ -3159,7 +3108,7 @@ ndis_add_key(vap, key, mac) /* We need to return 1 for success, 0 for failure. */ if (error) - return(0); + return (0); return (1); } @@ -3173,7 +3122,6 @@ ndis_resettask(d, arg) sc = arg; ndis_reset_nic(sc); - return; } /* @@ -3214,8 +3162,6 @@ ndis_stop(sc) sc->ndis_evtcidx = 0; sc->ndis_evtpidx = 0; NDIS_UNLOCK(sc); - - return; } /* @@ -3230,8 +3176,6 @@ ndis_shutdown(dev) sc = device_get_softc(dev); ndis_stop(sc); - - return; } static int @@ -3426,8 +3370,7 @@ ndis_scan_start(struct ieee80211com *ic) DPRINTF(("%s: set ESSID failed\n", __func__)); len = 0; - error = ndis_set_info(sc, OID_802_11_BSSID_LIST_SCAN, - NULL, &len); + error = ndis_set_info(sc, OID_802_11_BSSID_LIST_SCAN, NULL, &len); if (error) { DPRINTF(("%s: scan command failed\n", __func__)); ieee80211_cancel_scan(vap); @@ -3460,4 +3403,3 @@ ndis_scan_end(struct ieee80211com *ic) { /* ignore */ } - diff --git a/sys/dev/if_ndis/if_ndis_usb.c b/sys/dev/if_ndis/if_ndis_usb.c index be03919cc8ab..af5a284f4c07 100644 --- a/sys/dev/if_ndis/if_ndis_usb.c +++ b/sys/dev/if_ndis/if_ndis_usb.c @@ -194,9 +194,9 @@ ndisusb_attach(device_t self) } if (ndis_attach(self) != 0) - return ENXIO; + return (ENXIO); - return 0; + return (0); } static int