[PATCH] init_etherdev cleanups

From: Crutcher Dunnavant (crutcher+lkml@eng.ua.edu)
Date: Tue Jul 02 2002 - 22:05:08 EST


I'm walking through the network drivers, and cleaning up use of
init_etherdev() and its friends. That said, I gotta say I don't
have any of this hardware, and half of it is for arches I don't
have access to. The x86 stuff compiles, at least.

Attached is a block of patches, and below are my reasons:

skge.c:
        Should be NULL, not zero. Wouldn't bother if I wasn't
        churning this stuff.

xircom_cb.c:
        This driver does lots of cute shit to try and avoid
        malloc failures, but all it accomplishes is to re-order
        the cases so that it has to twice as much work, without
        gaining any protection.

bmac.c:
        This driver is calling memset to zero a chunk of its
        private data structure, but memset has already
        been called on it by init_etherdev.

au1000_eth.c:
        This driver is just a mess. My favorite part of it reads:

        kfree(dev);
        printk(KERN_ERR "%s: au1000_probe1 failed. Returns %d\n",
               dev->name, retval);

sunbmac.c:
        This driver checked for dev == NULL twice in a row,
        called ether_setup() redundantly, failed to free
        dev->priv, and did some meaningless stuff in bigmac_probe

atari_bionet.c:
        This driver includes a prototype to init_etherdev(),
        which A) comes from the headers, and B) it doesn't use.

sb1000.c:
        This driver is just alloctaing its own private structure.

myri_sbus.c:
        This driver is calling ether_setup() redundantly,
        and doesn't free dev->priv in its error handler.

macsonic.c:
        redundantly calls ether_setup(), and redundantly mallocs
        its own private structures, based upon this well meaning,
        but dumb, reasoning:

        /* methinks this will always be true but better safe than sorry */

etherh.c
        This driver is alloctaing its own private structure,
        and doesn't free dev->priv in its error handler.

-- 
Crutcher Dunnavant <crutcher+spam@eng.ua.edu>
ECSS System Hacker / UA COE CS Senior


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 07 2002 - 22:00:10 EST