From d07c19e566a75750a79a72fc8d33995afa625551 Mon Sep 17 00:00:00 2001 From: Maxime Henrion Date: Fri, 13 Jun 2003 20:46:34 +0000 Subject: [PATCH] Remove code that tries to detect if the MCLSHIFT and MSIZE macros are the same that those of the kernel in the KLD_MODULE case. If we ever want to detect that kind of problems, this is not the right place to do this since every network driver would be affected by such desynchronisation. --- sys/dev/ti/if_ti.c | 46 ---------------------------------------------- sys/pci/if_ti.c | 46 ---------------------------------------------- 2 files changed, 92 deletions(-) diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index 29806e01016..ba090440499 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -2056,38 +2056,6 @@ ti_probe(dev) return(ENXIO); } -#ifdef KLD_MODULE -static int -log2rndup(int len) -{ - int log2size = 0, t = len; - while (t > 1) { - log2size++; - t >>= 1; - } - if (len != (1 << log2size)) - log2size++; - return log2size; -} - -static int -ti_mbuf_sanity(device_t dev) -{ - if ((mbstat.m_msize != MSIZE) || mbstat.m_mclbytes != MCLBYTES){ - device_printf(dev, "\n"); - device_printf(dev, "This module was compiled with " - "-DMCLSHIFT=%d -DMSIZE=%d\n", MCLSHIFT, - MSIZE); - device_printf(dev, "The kernel was compiled with MCLSHIFT=%d," - " MSIZE=%d\n", log2rndup(mbstat.m_mclbytes), - (int)mbstat.m_msize); - return(EINVAL); - } - return(0); -} -#endif - - static int ti_attach(dev) device_t dev; @@ -2096,20 +2064,6 @@ ti_attach(dev) struct ti_softc *sc; int unit, error = 0, rid; - sc = NULL; - -#ifdef KLD_MODULE - if (ti_mbuf_sanity(dev)){ - device_printf(dev, "Module mbuf constants do not match " - "kernel constants!\n"); - device_printf(dev, "Rebuild the module or the kernel so " - "they match\n"); - device_printf(dev, "\n"); - error = EINVAL; - goto fail; - } -#endif - sc = device_get_softc(dev); unit = device_get_unit(dev); diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c index 29806e01016..ba090440499 100644 --- a/sys/pci/if_ti.c +++ b/sys/pci/if_ti.c @@ -2056,38 +2056,6 @@ ti_probe(dev) return(ENXIO); } -#ifdef KLD_MODULE -static int -log2rndup(int len) -{ - int log2size = 0, t = len; - while (t > 1) { - log2size++; - t >>= 1; - } - if (len != (1 << log2size)) - log2size++; - return log2size; -} - -static int -ti_mbuf_sanity(device_t dev) -{ - if ((mbstat.m_msize != MSIZE) || mbstat.m_mclbytes != MCLBYTES){ - device_printf(dev, "\n"); - device_printf(dev, "This module was compiled with " - "-DMCLSHIFT=%d -DMSIZE=%d\n", MCLSHIFT, - MSIZE); - device_printf(dev, "The kernel was compiled with MCLSHIFT=%d," - " MSIZE=%d\n", log2rndup(mbstat.m_mclbytes), - (int)mbstat.m_msize); - return(EINVAL); - } - return(0); -} -#endif - - static int ti_attach(dev) device_t dev; @@ -2096,20 +2064,6 @@ ti_attach(dev) struct ti_softc *sc; int unit, error = 0, rid; - sc = NULL; - -#ifdef KLD_MODULE - if (ti_mbuf_sanity(dev)){ - device_printf(dev, "Module mbuf constants do not match " - "kernel constants!\n"); - device_printf(dev, "Rebuild the module or the kernel so " - "they match\n"); - device_printf(dev, "\n"); - error = EINVAL; - goto fail; - } -#endif - sc = device_get_softc(dev); unit = device_get_unit(dev);