]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] kmemdup() cleanup in drivers/net
authorEric Sesterhenn <snakebyte@gmx.de>
Mon, 23 Oct 2006 20:20:15 +0000 (22:20 +0200)
committerJeff Garzik <jeff@garzik.org>
Sat, 2 Dec 2006 05:12:01 +0000 (00:12 -0500)
hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/tulip/de2104x.c
drivers/net/wireless/ipw2100.c

index f6b3a94e97bfe52727fa39c55772a8eac7d73bfc..9d67f11422ec5ed8317eb477eb3d1f524b034528 100644 (file)
@@ -1906,9 +1906,7 @@ fill_defaults:
                        de->media[i].csr15 = t21041_csr15[i];
        }
 
-       de->ee_data = kmalloc(DE_EEPROM_SIZE, GFP_KERNEL);
-       if (de->ee_data)
-               memcpy(de->ee_data, &ee_data[0], DE_EEPROM_SIZE);
+       de->ee_data = kmemdup(&ee_data[0], DE_EEPROM_SIZE, GFP_KERNEL);
 
        return;
 
index 4e4eaa2a99ca4da6220a2239785f823b50a2825b..5bf4d4119c3d0476163672d61ab0590376ea6df8 100644 (file)
@@ -7568,11 +7568,10 @@ static int ipw2100_wx_set_genie(struct net_device *dev,
                return -EINVAL;
 
        if (wrqu->data.length) {
-               buf = kmalloc(wrqu->data.length, GFP_KERNEL);
+               buf = kmemdup(extra, wrqu->data.length, GFP_KERNEL);
                if (buf == NULL)
                        return -ENOMEM;
 
-               memcpy(buf, extra, wrqu->data.length);
                kfree(ieee->wpa_ie);
                ieee->wpa_ie = buf;
                ieee->wpa_ie_len = wrqu->data.length;