svn commit: r238912 - head/sys/dev/netmap

Luigi Rizzo luigi at FreeBSD.org
Mon Jul 30 18:21:49 UTC 2012


Author: luigi
Date: Mon Jul 30 18:21:48 2012
New Revision: 238912
URL: http://svn.freebsd.org/changeset/base/238912

Log:
  - move the inclusion of netmap headers to the common part of the code;
  - more portable annotations for unused arguments;

Modified:
  head/sys/dev/netmap/netmap.c
  head/sys/dev/netmap/netmap_mem2.c

Modified: head/sys/dev/netmap/netmap.c
==============================================================================
--- head/sys/dev/netmap/netmap.c	Mon Jul 30 15:37:47 2012	(r238911)
+++ head/sys/dev/netmap/netmap.c	Mon Jul 30 18:21:48 2012	(r238912)
@@ -90,13 +90,14 @@ __FBSDID("$FreeBSD$");
 #include <net/if.h>
 #include <net/bpf.h>		/* BIOCIMMEDIATE */
 #include <net/vnet.h>
-#include <net/netmap.h>
-#include <dev/netmap/netmap_kern.h>
 #include <machine/bus.h>	/* bus_dmamap_* */
 
 MALLOC_DEFINE(M_NETMAP, "netmap", "Network memory map");
 #endif /* __FreeBSD__ */
 
+#include <net/netmap.h>
+#include <dev/netmap/netmap_kern.h>
+
 /*
  * lock and unlock for the netmap memory allocator
  */
@@ -764,8 +765,8 @@ netmap_set_ringid(struct netmap_priv_d *
  * Return 0 on success, errno otherwise.
  */
 static int
-netmap_ioctl(__unused struct cdev *dev, u_long cmd, caddr_t data,
-	__unused int fflag, struct thread *td)
+netmap_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
+	int fflag, struct thread *td)
 {
 	struct netmap_priv_d *priv = NULL;
 	struct ifnet *ifp;
@@ -775,6 +776,8 @@ netmap_ioctl(__unused struct cdev *dev, 
 	u_int i, lim;
 	struct netmap_if *nifp;
 
+	(void)dev;	/* UNUSED */
+	(void)fflag;	/* UNUSED */
 #ifdef linux
 #define devfs_get_cdevpriv(pp)				\
 	({ *(struct netmap_priv_d **)pp = ((struct file *)td)->private_data; 	\
@@ -1551,7 +1554,7 @@ linux_netmap_poll(struct file * file, st
 }
 
 static int
-netmap_mmap(__unused struct file *f, struct vm_area_struct *vma)
+netmap_mmap(struct file *f, struct vm_area_struct *vma)
 {
 	int lut_skip, i, j;
 	int user_skip = 0;
@@ -1565,6 +1568,7 @@ netmap_mmap(__unused struct file *f, str
 	 * vma->vm_end: end of the mapping user address space
 	 */
 
+	(void)f;	/* UNUSED */
 	// XXX security checks
 
 	for (i = 0; i < 3; i++) {  /* loop through obj_pools */
@@ -1599,7 +1603,7 @@ netmap_start_linux(struct sk_buff *skb, 
 }
 
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)	// XXX was 38
 #define LIN_IOCTL_NAME	.ioctl
 int
 linux_netmap_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long data /* arg */)
@@ -1623,8 +1627,9 @@ linux_netmap_ioctl(struct file *file, u_
 
 
 static int
-netmap_release(__unused struct inode *inode, struct file *file)
+netmap_release(struct inode *inode, struct file *file)
 {
+	(void)inode;	/* UNUSED */
 	if (file->private_data)
 		netmap_dtor(file->private_data);
 	return (0);

Modified: head/sys/dev/netmap/netmap_mem2.c
==============================================================================
--- head/sys/dev/netmap/netmap_mem2.c	Mon Jul 30 15:37:47 2012	(r238911)
+++ head/sys/dev/netmap/netmap_mem2.c	Mon Jul 30 18:21:48 2012	(r238912)
@@ -25,7 +25,7 @@
 
 /*
  * $FreeBSD$
- * $Id: netmap_mem2.c 10830 2012-03-22 18:06:01Z luigi $
+ * $Id: netmap_mem2.c 11445 2012-07-30 10:49:07Z luigi $
  *
  * New memory allocator for netmap
  */
@@ -300,12 +300,13 @@ netmap_obj_free_va(struct netmap_obj_poo
 
 
 static void
-netmap_new_bufs(struct netmap_if *nifp __unused,
+netmap_new_bufs(struct netmap_if *nifp,
                 struct netmap_slot *slot, u_int n)
 {
 	struct netmap_obj_pool *p = nm_mem->nm_buf_pool;
 	uint32_t i = 0;	/* slot counter */
 
+	(void)nifp;	/* UNUSED */
 	for (i = 0; i < n; i++) {
 		void *vaddr = netmap_buf_malloc();
 		if (vaddr == NULL) {


More information about the svn-src-all mailing list