diff options
author | Thomas Meyer <thomas@m3y3r.de> | 2011-11-17 12:43:40 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-04 10:46:56 -0800 |
commit | f0a4cf31017ac8179a2fe295c1bd8e821d7674f4 (patch) | |
tree | 1a640c00647cc7eb90d9849033071270f39f81d7 /arch/sparc/kernel/ds.c | |
parent | e5fd47bfab2df0c2184cc0bf4245d8e1bb7724fb (diff) |
sparc: Use kmemdup rather than duplicating its implementation
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/ds.c')
-rw-r--r-- | arch/sparc/kernel/ds.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index 7429b47c3ac..381edcd5bc2 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c @@ -1181,13 +1181,11 @@ static int __devinit ds_probe(struct vio_dev *vdev, dp->rcv_buf_len = 4096; - dp->ds_states = kzalloc(sizeof(ds_states_template), - GFP_KERNEL); + dp->ds_states = kmemdup(ds_states_template, + sizeof(ds_states_template), GFP_KERNEL); if (!dp->ds_states) goto out_free_rcv_buf; - memcpy(dp->ds_states, ds_states_template, - sizeof(ds_states_template)); dp->num_ds_states = ARRAY_SIZE(ds_states_template); for (i = 0; i < dp->num_ds_states; i++) |