提交 c66b721a 编写于 作者: A Arnaldo Carvalho de Melo 提交者: David S. Miller

[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: NArnaldo Carvalho de Melo <acme@mandriva.com>
上级 eed73417
...@@ -255,12 +255,10 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms * ...@@ -255,12 +255,10 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
struct dn_dev_sysctl_table *t; struct dn_dev_sysctl_table *t;
int i; int i;
t = kmalloc(sizeof(*t), GFP_KERNEL); t = kmemdup(&dn_dev_sysctl, sizeof(*t), GFP_KERNEL);
if (t == NULL) if (t == NULL)
return; return;
memcpy(t, &dn_dev_sysctl, sizeof(*t));
for(i = 0; i < ARRAY_SIZE(t->dn_dev_vars) - 1; i++) { for(i = 0; i < ARRAY_SIZE(t->dn_dev_vars) - 1; i++) {
long offset = (long)t->dn_dev_vars[i].data; long offset = (long)t->dn_dev_vars[i].data;
t->dn_dev_vars[i].data = ((char *)parms) + offset; t->dn_dev_vars[i].data = ((char *)parms) + offset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册