Subject: kern/13411: unnecessary include files in network drivers
To: None <gnats-bugs@gnats.netbsd.org>
From: Onno van der Linden <onno@quicknet.nl>
List: netbsd-bugs
Date: 07/08/2001 15:42:00
>Number: 13411
>Category: kern
>Synopsis: unnecessary include files in network drivers
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jul 08 06:42:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Onno van der Linden
>Release: 2 July 2001 <NetBSD-current source date>
>Organization:
>Environment:
System: NetBSD sheep 1.5W NetBSD 1.5W (SHEEP) #0: Mon Jul 2 15:52:08 MEST 2001 root@sheep:/usr/src/sys/arch/i386/compile/SHEEP i386
Architecture: i386
Machine: i386
>Description:
about 20 network drivers include files that are not really necessary
>How-To-Repeat:
>Fix:
apply the appended patch
*** /sys/dev/ic/depca.c Wed Jun 13 12:38:09 2001
--- /sys/dev/ic/depca.c.new Sun Jul 8 10:51:26 2001
***************
*** 75,82 ****
* @(#)if_le.c 8.2 (Berkeley) 11/16/93
*/
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 75,80 ----
*** /sys/dev/ic/dl10019.c Wed Jun 13 12:38:10 2001
--- /sys/dev/ic/dl10019.c.new Sun Jul 8 10:51:47 2001
***************
*** 36,43 ****
* POSSIBILITY OF SUCH DAMAGE.
*/
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 36,41 ----
*** /sys/dev/ic/rtl80x9.c Wed Jun 13 12:38:12 2001
--- /sys/dev/ic/rtl80x9.c.new Sun Jul 8 10:52:17 2001
***************
*** 37,44 ****
* POSSIBILITY OF SUCH DAMAGE.
*/
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 37,42 ----
*** /sys/dev/isa/if_ec.c Mon Jun 11 13:09:21 2001
--- /sys/dev/isa/if_ec.c.new Sun Jul 8 10:39:50 2001
***************
*** 54,64 ****
* Device driver for the 3Com Etherlink II (3c503).
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
- #include "rnd.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
--- 54,59 ----
***************
*** 72,95 ****
#include <net/if_media.h>
#include <net/if_ether.h>
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/in_systm.h>
- #include <netinet/in_var.h>
- #include <netinet/ip.h>
- #include <netinet/if_inarp.h>
- #endif
-
- #ifdef NS
- #include <netns/ns.h>
- #include <netns/ns_if.h>
- #endif
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/bus.h>
#include <machine/intr.h>
--- 67,72 ----
*** /sys/dev/isa/if_ep_isa.c Wed May 26 00:29:51 1999
--- /sys/dev/isa/if_ep_isa.c.new Sun Jul 8 10:41:12 2001
***************
*** 68,77 ****
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 68,73 ----
***************
*** 87,110 ****
#include <net/if_dl.h>
#include <net/if_ether.h>
#include <net/if_media.h>
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/in_systm.h>
- #include <netinet/in_var.h>
- #include <netinet/ip.h>
- #include <netinet/if_inarp.h>
- #endif
-
- #ifdef NS
- #include <netns/ns.h>
- #include <netns/ns_if.h>
- #endif
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/cpu.h>
#include <machine/bus.h>
--- 83,88 ----
*** /sys/dev/isa/if_lc_isa.c Thu Jun 14 13:00:57 2001
--- /sys/dev/isa/if_lc_isa.c.new Sun Jul 8 10:43:19 2001
***************
*** 32,41 ****
* This driver supports the LEMAC (DE203, DE204, and DE205) cards.
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 32,37 ----
***************
*** 51,75 ****
#include <net/if_dl.h>
#include <net/if_ether.h>
#include <net/if_media.h>
-
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/in_systm.h>
- #include <netinet/in_var.h>
- #include <netinet/ip.h>
- #include <netinet/if_inarp.h>
- #endif
-
- #ifdef NS
- #include <netns/ns.h>
- #include <netns/ns_if.h>
- #endif
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/cpu.h>
#include <machine/bus.h>
--- 47,52 ----
*** /sys/dev/isa/if_le_isa.c Thu May 31 13:01:45 2001
--- /sys/dev/isa/if_le_isa.c.new Sun Jul 8 10:43:52 2001
***************
*** 75,83 ****
* @(#)if_le.c 8.2 (Berkeley) 11/16/93
*/
- #include "opt_inet.h"
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 75,80 ----
***************
*** 90,100 ****
#include <net/if.h>
#include <net/if_ether.h>
#include <net/if_media.h>
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/if_inarp.h>
- #endif
#include <machine/cpu.h>
#include <machine/intr.h>
--- 87,92 ----
*** /sys/dev/isa/if_ne_isa.c Tue Feb 13 12:36:27 2001
--- /sys/dev/isa/if_ne_isa.c.new Sun Jul 8 10:44:24 2001
***************
*** 37,46 ****
* POSSIBILITY OF SUCH DAMAGE.
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 37,42 ----
***************
*** 55,78 ****
#include <net/if_dl.h>
#include <net/if_ether.h>
#include <net/if_media.h>
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/in_systm.h>
- #include <netinet/in_var.h>
- #include <netinet/ip.h>
- #include <netinet/if_inarp.h>
- #endif
-
- #ifdef NS
- #include <netns/ns.h>
- #include <netns/ns_if.h>
- #endif
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/intr.h>
#include <machine/bus.h>
--- 51,56 ----
*** /sys/dev/isa/if_sm_isa.c Thu Aug 3 00:35:04 2000
--- /sys/dev/isa/if_sm_isa.c.new Sun Jul 8 10:45:00 2001
***************
*** 37,46 ****
* POSSIBILITY OF SUCH DAMAGE.
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 37,42 ----
***************
*** 55,78 ****
#include <net/if_dl.h>
#include <net/if_ether.h>
#include <net/if_media.h>
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/in_systm.h>
- #include <netinet/in_var.h>
- #include <netinet/ip.h>
- #include <netinet/if_inarp.h>
- #endif
-
- #ifdef NS
- #include <netns/ns.h>
- #include <netns/ns_if.h>
- #endif
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/intr.h>
#include <machine/bus.h>
--- 51,56 ----
*** /sys/dev/isa/if_we_isa.c Sun Jul 1 12:51:30 2001
--- /sys/dev/isa/if_we_isa.c.new Sun Jul 8 10:50:04 2001
***************
*** 55,64 ****
* and the SMC Elite Ultra (8216).
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
--- 55,60 ----
***************
*** 72,95 ****
#include <net/if_media.h>
#include <net/if_ether.h>
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/in_systm.h>
- #include <netinet/in_var.h>
- #include <netinet/ip.h>
- #include <netinet/if_inarp.h>
- #endif
-
- #ifdef NS
- #include <netns/ns.h>
- #include <netns/ns_if.h>
- #endif
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/bus.h>
#include <machine/bswap.h>
--- 68,73 ----
*** /sys/dev/isapnp/if_an_isapnp.c Fri Jun 22 12:33:50 2001
--- /sys/dev/isapnp/if_an_isapnp.c.new Sun Jul 8 15:03:03 2001
***************
*** 42,55 ****
* decoder hack.
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
-
- #ifdef INET
- #define ANCACHE /* XXX: should be defined elsewhere */
- #endif
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 42,47 ----
***************
*** 66,85 ****
#include <net/if_media.h>
#include <net/if_ether.h>
#include <net/if_ieee80211.h>
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #endif
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/if_inarp.h>
- #endif
-
- #ifdef NS
- #include <netns/ns.h>
- #include <netns/ns_if.h>
- #endif
#include <machine/bus.h>
#include <machine/intr.h>
--- 58,63 ----
*** /sys/dev/isapnp/if_ep_isapnp.c Mon Mar 22 12:13:03 1999
--- /sys/dev/isapnp/if_ep_isapnp.c.new Sun Jul 8 15:03:38 2001
***************
*** 30,39 ****
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 30,35 ----
***************
*** 48,70 ****
#include <net/if_dl.h>
#include <net/if_ether.h>
#include <net/if_media.h>
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/in_systm.h>
- #include <netinet/in_var.h>
- #include <netinet/ip.h>
- #endif
-
- #ifdef NS
- #include <netns/ns.h>
- #include <netns/ns_if.h>
- #endif
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/cpu.h>
#include <machine/bus.h>
--- 44,49 ----
*** /sys/dev/isapnp/if_le_isapnp.c Sat Nov 18 13:56:25 2000
--- /sys/dev/isapnp/if_le_isapnp.c.new Sun Jul 8 15:04:04 2001
***************
*** 67,76 ****
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 67,72 ----
***************
*** 87,109 ****
#include <net/if_dl.h>
#include <net/if_ether.h>
#include <net/if_media.h>
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/in_systm.h>
- #include <netinet/in_var.h>
- #include <netinet/ip.h>
- #endif
-
- #ifdef NS
- #include <netns/ns.h>
- #include <netns/ns_if.h>
- #endif
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/cpu.h>
#include <machine/bus.h>
--- 83,88 ----
*** /sys/dev/isapnp/if_ne_isapnp.c Tue Feb 13 12:36:35 2001
--- /sys/dev/isapnp/if_ne_isapnp.c.new Sun Jul 8 15:04:36 2001
***************
*** 37,46 ****
* POSSIBILITY OF SUCH DAMAGE.
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 37,42 ----
***************
*** 55,78 ****
#include <net/if_dl.h>
#include <net/if_ether.h>
#include <net/if_media.h>
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/in_systm.h>
- #include <netinet/in_var.h>
- #include <netinet/ip.h>
- #include <netinet/if_inarp.h>
- #endif
-
- #ifdef NS
- #include <netns/ns.h>
- #include <netns/ns_if.h>
- #endif
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/intr.h>
#include <machine/bus.h>
--- 51,56 ----
*** /sys/dev/isapnp/if_tr_isapnp.c Fri Jun 9 12:09:30 2000
--- /sys/dev/isapnp/if_tr_isapnp.c.new Sun Jul 8 15:05:02 2001
***************
*** 36,45 ****
* POSSIBILITY OF SUCH DAMAGE.
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/callout.h>
--- 36,41 ----
***************
*** 55,77 ****
#include <net/if_dl.h>
#include <net/if_ether.h>
#include <net/if_media.h>
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/in_systm.h>
- #include <netinet/in_var.h>
- #include <netinet/ip.h>
- #endif
-
- #ifdef NS
- #include <netns/ns.h>
- #include <netns/ns_if.h>
- #endif
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/cpu.h>
#include <machine/bus.h>
--- 51,56 ----
*** /sys/dev/pci/if_an_pci.c Tue Jun 19 13:07:03 2001
--- /sys/dev/pci/if_an_pci.c.new Sun Jul 8 10:13:14 2001
***************
*** 42,55 ****
* PCI to "dumb bus" bridge chip.
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
-
- #ifdef INET
- #define ANCACHE /* XXX: should be defined elsewhere */
- #endif
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 42,47 ----
***************
*** 68,82 ****
#include <net/if_media.h>
#include <net/if_ether.h>
#include <net/if_ieee80211.h>
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #endif
-
- #ifdef INET
- #include <netinet/in.h>
- #include <netinet/if_inarp.h>
- #endif
#include <machine/bus.h>
#include <machine/intr.h>
--- 60,65 ----
*** /sys/dev/pci/if_ep_pci.c Wed Jun 13 12:38:19 2001
--- /sys/dev/pci/if_ep_pci.c.new Sun Jul 8 10:14:29 2001
***************
*** 68,75 ****
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 68,73 ----
***************
*** 84,94 ****
#include <net/if_dl.h>
#include <net/if_ether.h>
#include <net/if_media.h>
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/cpu.h>
#include <machine/bus.h>
--- 82,87 ----
*** /sys/dev/pci/if_epic_pci.c Wed Jun 13 12:38:19 2001
--- /sys/dev/pci/if_epic_pci.c.new Sun Jul 8 10:16:08 2001
***************
*** 42,49 ****
* Ethernet PCI Integrated Controller (EPIC/100) driver.
*/
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 42,47 ----
***************
*** 58,67 ****
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_ether.h>
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #endif
#include <machine/bus.h>
#include <machine/intr.h>
--- 56,61 ----
*** /sys/dev/pci/if_esh_pci.c Wed Jun 13 12:38:20 2001
--- /sys/dev/pci/if_esh_pci.c.new Sun Jul 8 10:17:07 2001
***************
*** 41,48 ****
*/
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 41,46 ----
***************
*** 58,68 ****
#include <net/if_dl.h>
#include <net/if_hippi.h>
#include <net/if_media.h>
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/cpu.h>
#include <machine/bus.h>
--- 56,61 ----
*** /sys/dev/pci/if_ex_pci.c Wed Jun 13 12:38:20 2001
--- /sys/dev/pci/if_ex_pci.c.new Sun Jul 8 10:17:51 2001
***************
*** 37,44 ****
* POSSIBILITY OF SUCH DAMAGE.
*/
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 37,42 ----
***************
*** 53,63 ****
#include <net/if_dl.h>
#include <net/if_ether.h>
#include <net/if_media.h>
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #include <net/bpfdesc.h>
- #endif
#include <machine/cpu.h>
#include <machine/bus.h>
--- 51,56 ----
*** /sys/dev/pci/if_fxp_pci.c Wed Jun 13 12:38:20 2001
--- /sys/dev/pci/if_fxp_pci.c.new Sun Jul 8 15:29:46 2001
***************
*** 42,48 ****
* driver. Works with Intel Etherexpress Pro 10+, 100B, 100+ cards.
*/
- #include "bpfilter.h"
#include "rnd.h"
#include <sys/param.h>
--- 42,47 ----
***************
*** 65,74 ****
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_ether.h>
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #endif
#include <machine/bus.h>
#include <machine/intr.h>
--- 64,69 ----
*** /sys/dev/pci/if_le_pci.c Tue Jun 19 13:07:03 2001
--- /sys/dev/pci/if_le_pci.c.new Sun Jul 8 10:24:47 2001
***************
*** 75,83 ****
* @(#)if_le.c 8.2 (Berkeley) 11/16/93
*/
- #include "opt_inet.h"
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 75,80 ----
*** /sys/dev/pci/if_ne_pci.c Wed Jun 13 12:38:21 2001
--- /sys/dev/pci/if_ne_pci.c.new Sun Jul 8 10:26:43 2001
***************
*** 38,45 ****
*/
#include "opt_ipkdb.h"
- #include "opt_inet.h"
- #include "bpfilter.h"
#include <sys/param.h>
#include <sys/systm.h>
--- 38,43 ----
*** /sys/dev/pci/if_rtk_pci.c Wed Jun 13 12:38:21 2001
--- /sys/dev/pci/if_rtk_pci.c.new Sun Jul 8 10:30:20 2001
***************
*** 85,95 ****
* to select which interface to use depending on the chip type.
*/
- #include "opt_inet.h"
- #include "opt_ns.h"
- #include "bpfilter.h"
- #include "rnd.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/callout.h>
--- 85,90 ----
***************
*** 105,122 ****
#include <net/if_ether.h>
#include <net/if_dl.h>
#include <net/if_media.h>
-
- #ifdef NS
- #include <netns/ns.h>
- #include <netns/ns_if.h>
- #endif
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #endif
- #if NRND > 0
- #include <sys/rnd.h>
- #endif
#include <machine/bus.h>
--- 100,105 ----
*** /sys/dev/pci/if_sf_pci.c Tue Jun 19 00:05:37 2001
--- /sys/dev/pci/if_sf_pci.c.new Sun Jul 8 10:33:53 2001
***************
*** 41,48 ****
* 10/100 Ethernet controller.
*/
- #include "bpfilter.h"
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
--- 41,46 ----
***************
*** 57,66 ****
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_ether.h>
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #endif
#include <machine/bus.h>
#include <machine/intr.h>
--- 55,60 ----
*** /sys/dev/pci/if_tlp_pci.c Wed Jun 13 12:38:22 2001
--- /sys/dev/pci/if_tlp_pci.c.new Sun Jul 8 10:34:59 2001
***************
*** 42,48 ****
* Ethernet controller family driver.
*/
- #include "bpfilter.h"
#include "opt_tlp.h"
#include <sys/param.h>
--- 42,47 ----
***************
*** 61,70 ****
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_ether.h>
-
- #if NBPFILTER > 0
- #include <net/bpf.h>
- #endif
#include <machine/bus.h>
#include <machine/intr.h>
--- 60,65 ----
>Release-Note:
>Audit-Trail:
>Unformatted: