diff options
author | luigi <luigi@FreeBSD.org> | 2012-01-13 11:58:06 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2012-01-13 11:58:06 +0000 |
commit | 0855aced7fcfa7ba48dcb95e88271881786093d6 (patch) | |
tree | 206ce1e71e1d8d4d9bc006984c42f872ab6ed168 /sys/dev/netmap | |
parent | 40d0a8311305f6ba5fa78b23c7fd6f2bd55e4d1c (diff) | |
download | FreeBSD-src-0855aced7fcfa7ba48dcb95e88271881786093d6.zip FreeBSD-src-0855aced7fcfa7ba48dcb95e88271881786093d6.tar.gz |
indentation and whitespace fixes
Diffstat (limited to 'sys/dev/netmap')
-rw-r--r-- | sys/dev/netmap/netmap.c | 4 | ||||
-rw-r--r-- | sys/dev/netmap/netmap_kern.h | 19 |
2 files changed, 11 insertions, 12 deletions
diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c index 83077a2..e5695b3 100644 --- a/sys/dev/netmap/netmap.c +++ b/sys/dev/netmap/netmap.c @@ -1056,6 +1056,7 @@ netmap_poll(__unused struct cdev *dev, int events, struct thread *td) struct netmap_kring *kring; u_int core_lock, i, check_all, want_tx, want_rx, revents = 0; void *adapter; + enum {NO_CL, NEED_CL, LOCKED_CL }; /* see below */ if (devfs_get_cdevpriv((void **)&priv) != 0 || priv == NULL) return POLLERR; @@ -1130,8 +1131,7 @@ netmap_poll(__unused struct cdev *dev, int events, struct thread *td) * to remember to release the lock once done. * LOCKED_CL core lock is set, so we need to release it. */ - enum {NO_CL, NEED_CL, LOCKED_CL }; - core_lock = (check_all || !na->separate_locks) ? NEED_CL:NO_CL; + core_lock = (check_all || !na->separate_locks) ? NEED_CL : NO_CL; /* * We start with a lock free round which is good if we have * data available. If this fails, then lock and call the sync diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index 4d91ec1..ff4b151 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -39,13 +39,13 @@ MALLOC_DECLARE(M_NETMAP); #endif #define ND(format, ...) -#define D(format, ...) \ - do { \ - struct timeval __xxts; \ +#define D(format, ...) \ + do { \ + struct timeval __xxts; \ microtime(&__xxts); \ - printf("%03d.%06d %s [%d] " format "\n",\ - (int)__xxts.tv_sec % 1000, (int)__xxts.tv_usec, \ - __FUNCTION__, __LINE__, ##__VA_ARGS__); \ + printf("%03d.%06d %s [%d] " format "\n", \ + (int)__xxts.tv_sec % 1000, (int)__xxts.tv_usec, \ + __FUNCTION__, __LINE__, ##__VA_ARGS__); \ } while (0) struct netmap_adapter; @@ -197,7 +197,7 @@ enum { /* verbose flags */ /* Callback invoked by the dma machinery after a successfull dmamap_load */ static void netmap_dmamap_cb(__unused void *arg, - __unused bus_dma_segment_t * segs, __unused int nseg, __unused int error) + __unused bus_dma_segment_t * segs, __unused int nseg, __unused int error) { } @@ -209,7 +209,7 @@ netmap_load_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf) { if (map) bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE, - netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT); + netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT); } /* update the map when a buffer changes. */ @@ -219,7 +219,7 @@ netmap_reload_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf) if (map) { bus_dmamap_unload(tag, map); bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE, - netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT); + netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT); } } @@ -227,7 +227,6 @@ netmap_reload_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf) /* * NMB return the virtual address of a buffer (buffer 0 on bad index) * PNMB also fills the physical address - * XXX this is a special version with hardwired 2k bufs */ static inline void * NMB(struct netmap_slot *slot) |