From owner-svn-src-all@FreeBSD.ORG Mon Jul 30 18:21:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88F6B1065686; Mon, 30 Jul 2012 18:21:49 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 742778FC0C; Mon, 30 Jul 2012 18:21:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6UILneP022244; Mon, 30 Jul 2012 18:21:49 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6UILnA8022241; Mon, 30 Jul 2012 18:21:49 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201207301821.q6UILnA8022241@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 30 Jul 2012 18:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238912 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2012 18:21:49 -0000 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 #include /* BIOCIMMEDIATE */ #include -#include -#include #include /* bus_dmamap_* */ MALLOC_DEFINE(M_NETMAP, "netmap", "Network memory map"); #endif /* __FreeBSD__ */ +#include +#include + /* * 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) {