diff options
author | 2006-11-17 12:29:21 -0200 | |
---|---|---|
committer | 2006-12-02 21:24:00 -0800 | |
commit | c66b721a502cbbc15be8bd7c79c305fa40f1e6ce (patch) | |
tree | c1746a738973ae07fecfd9f1603054237b7d1e80 /net/decnet | |
parent | [DCCP]: Use kmemdup (diff) | |
download | linux-c66b721a502cbbc15be8bd7c79c305fa40f1e6ce.tar.gz linux-c66b721a502cbbc15be8bd7c79c305fa40f1e6ce.tar.bz2 linux-c66b721a502cbbc15be8bd7c79c305fa40f1e6ce.zip |
[DECNET]: Use kmemdup
Code diff stats:
[acme@newtoy net-2.6.20]$ codiff /tmp/decnet.ko.before /tmp/decnet.ko.after
/pub/scm/linux/kernel/git/acme/net-2.6.20/net/decnet/dn_dev.c:
dn_dev_sysctl_register | -51
1 function changed, 51 bytes removed
[acme@newtoy net-2.6.20]$
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/decnet')
-rw-r--r-- | net/decnet/dn_dev.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 01861feb608d..5b451e196fb9 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c @@ -255,12 +255,10 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms * struct dn_dev_sysctl_table *t; int i; - t = kmalloc(sizeof(*t), GFP_KERNEL); + t = kmemdup(&dn_dev_sysctl, sizeof(*t), GFP_KERNEL); if (t == NULL) return; - memcpy(t, &dn_dev_sysctl, sizeof(*t)); - for(i = 0; i < ARRAY_SIZE(t->dn_dev_vars) - 1; i++) { long offset = (long)t->dn_dev_vars[i].data; t->dn_dev_vars[i].data = ((char *)parms) + offset; |