Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Simplify like other drivers. NULL check of ifp->if_bpf i...



details:   https://anonhg.NetBSD.org/src/rev/55d6c90eb4fd
branches:  trunk
changeset: 323592:55d6c90eb4fd
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Jun 22 04:41:57 2018 +0000

description:
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.

diffstat:

 sys/arch/emips/ebus/if_le_ebus.c    |  7 +++----
 sys/arch/playstation2/dev/if_smap.c |  7 +++----
 sys/dev/ic/dm9000.c                 |  5 ++---
 3 files changed, 8 insertions(+), 11 deletions(-)

diffs (75 lines):

diff -r 69e3ee90e375 -r 55d6c90eb4fd sys/arch/emips/ebus/if_le_ebus.c
--- a/sys/arch/emips/ebus/if_le_ebus.c  Fri Jun 22 04:17:40 2018 +0000
+++ b/sys/arch/emips/ebus/if_le_ebus.c  Fri Jun 22 04:41:57 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le_ebus.c,v 1.14 2018/06/22 04:17:40 msaitoh Exp $  */
+/*     $NetBSD: if_le_ebus.c,v 1.15 2018/06/22 04:41:57 msaitoh Exp $  */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.14 2018/06/22 04:17:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le_ebus.c,v 1.15 2018/06/22 04:41:57 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -873,8 +873,7 @@
                 * If BPF is listening on this interface, let it see the packet
                 * before we commit it to the wire.
                 */
-               if (ifp->if_bpf)
-                       bpf_mtap(ifp, m);
+               bpf_mtap(ifp, m);
 
                /*
                 * Copy the mbuf chain into a contiguous transmit buffer.
diff -r 69e3ee90e375 -r 55d6c90eb4fd sys/arch/playstation2/dev/if_smap.c
--- a/sys/arch/playstation2/dev/if_smap.c       Fri Jun 22 04:17:40 2018 +0000
+++ b/sys/arch/playstation2/dev/if_smap.c       Fri Jun 22 04:41:57 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_smap.c,v 1.25 2018/06/22 04:17:41 msaitoh Exp $     */
+/*     $NetBSD: if_smap.c,v 1.26 2018/06/22 04:41:57 msaitoh Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.25 2018/06/22 04:17:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smap.c,v 1.26 2018/06/22 04:41:57 msaitoh Exp $");
 
 #include "debug_playstation2.h"
 
@@ -497,8 +497,7 @@
 
                IFQ_DEQUEUE(&ifp->if_snd, m0);
                KDASSERT(m0 != NULL);
-               if (ifp->if_bpf)
-                       bpf_mtap(ifp, m0);
+               bpf_mtap(ifp, m0);
 
                p = (u_int8_t *)sc->tx_buf;
                q = p + sz;
diff -r 69e3ee90e375 -r 55d6c90eb4fd sys/dev/ic/dm9000.c
--- a/sys/dev/ic/dm9000.c       Fri Jun 22 04:17:40 2018 +0000
+++ b/sys/dev/ic/dm9000.c       Fri Jun 22 04:41:57 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dm9000.c,v 1.13 2018/06/22 04:17:42 msaitoh Exp $      */
+/*     $NetBSD: dm9000.c,v 1.14 2018/06/22 04:41:57 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2009 Paul Fleischer
@@ -650,8 +650,7 @@
 
        /* Element has now been removed from the queue, so we better send it */
 
-       if (ifp->if_bpf)
-               bpf_mtap(ifp, bufChain);
+       bpf_mtap(ifp, bufChain);
 
        /* Setup the DM9000 to accept the writes, and then write each buf in
           the chain. */



Home | Main Index | Thread Index | Old Index