[PATCH] chelsio: use kzalloc
authorStephen Hemminger <shemminger@osdl.org>
Sat, 2 Dec 2006 00:36:14 +0000 (16:36 -0800)
committerJeff Garzik <jeff@garzik.org>
Sat, 2 Dec 2006 05:24:49 +0000 (00:24 -0500)
Use kzalloc in several places.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/chelsio/mv88x201x.c
drivers/net/chelsio/pm3393.c

index db5034282782431709689082b2bc749e7a0b5850..bf7d8538885d36d39bc499be2a52d337a7c0e8a2 100644 (file)
@@ -205,11 +205,11 @@ static struct cphy *mv88x201x_phy_create(adapter_t *adapter, int phy_addr,
                                         struct mdio_ops *mdio_ops)
 {
        u32 val;
-       struct cphy *cphy = kmalloc(sizeof(*cphy), GFP_KERNEL);
+       struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL);
 
        if (!cphy)
                return NULL;
-       memset(cphy, 0, sizeof(*cphy));
+
        cphy_init(cphy, adapter, phy_addr, &mv88x201x_ops, mdio_ops);
 
        /* Commands the PHY to enable XFP's clock. */
index b442b585b4b11ce5cdeaa522707a844bdba107f0..50983f9ce4bc536d6685a1ab1cf30be1afb8735f 100644 (file)
@@ -631,10 +631,9 @@ static struct cmac *pm3393_mac_create(adapter_t *adapter, int index)
 {
        struct cmac *cmac;
 
-       cmac = kmalloc(sizeof(*cmac) + sizeof(cmac_instance), GFP_KERNEL);
+       cmac = kzalloc(sizeof(*cmac) + sizeof(cmac_instance), GFP_KERNEL);
        if (!cmac)
                return NULL;
-       memset(cmac, 0, sizeof(*cmac));
 
        cmac->ops = &pm3393_ops;
        cmac->instance = (cmac_instance *) (cmac + 1);