summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authordyoung <dyoung@NetBSD.org>2007-09-01 07:32:22 +0000
committerdyoung <dyoung@NetBSD.org>2007-09-01 07:32:22 +0000
commitdcd89234297aa3b534c5ebf5dbeed011892cf0f0 (patch)
tree99d2ce40cafbafb96449da886d2559788f9cf586 /sys/dev/usb
parent9bee2cd7f153f3c94c3828d72228f8a2461c68f5 (diff)
Change a bazillion occurrences of code resembling this,
error = (cmd == SIOCADDMULTI) ? ether_addmulti(ifr, &sc->sc_ec) : ether_delmulti(ifr, &sc->sc_ec); if (error == ENETRESET) { to this, if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { which does the same thing. (A bazillion is a very large number. This seems to make the i386 ALL kernel smaller by 3kB to 4kB.) Use ifreq_getaddr() twice in es(4). Whitespace nits.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/if_aue.c9
-rw-r--r--sys/dev/usb/if_axe.c8
2 files changed, 6 insertions, 11 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index 8a91f8e91b3..861aa1b90a6 100644
--- a/sys/dev/usb/if_aue.c
+++ b/sys/dev/usb/if_aue.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_aue.c,v 1.103 2007/08/29 22:33:43 dyoung Exp $ */
+/* $NetBSD: if_aue.c,v 1.104 2007/09/01 07:32:32 dyoung Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.103 2007/08/29 22:33:43 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.104 2007/09/01 07:32:32 dyoung Exp $");
#if defined(__NetBSD__)
#include "opt_inet.h"
@@ -1613,10 +1613,7 @@ aue_ioctl(struct ifnet *ifp, u_long command, void *data)
break;
case SIOCADDMULTI:
case SIOCDELMULTI:
- error = (command == SIOCADDMULTI) ?
- ether_addmulti(ifr, &sc->aue_ec) :
- ether_delmulti(ifr, &sc->aue_ec);
- if (error == ENETRESET) {
+ if ((error = ether_ioctl(ifp, command, data)) == ENETRESET) {
if (ifp->if_flags & IFF_RUNNING) {
#if defined(__NetBSD__)
workqueue_enqueue(sc->wqp,&sc->wk, NULL);
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c
index 9c9e0dec09c..0ee6db45c58 100644
--- a/sys/dev/usb/if_axe.c
+++ b/sys/dev/usb/if_axe.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_axe.c,v 1.19 2007/03/13 13:51:54 drochner Exp $ */
+/* $NetBSD: if_axe.c,v 1.20 2007/09/01 07:32:32 dyoung Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.19 2007/03/13 13:51:54 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.20 2007/09/01 07:32:32 dyoung Exp $");
#if defined(__NetBSD__)
#include "opt_inet.h"
@@ -1239,9 +1239,7 @@ axe_ioctl(struct ifnet *ifp, u_long cmd, void *data)
case SIOCADDMULTI:
case SIOCDELMULTI:
#ifdef __NetBSD__
- error = (cmd == SIOCADDMULTI) ?
- ether_addmulti(ifr, &sc->axe_ec) :
- ether_delmulti(ifr, &sc->axe_ec);
+ error = ether_ioctl(ifp, cmd, data);
#else
error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->arpcom) :