diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-02-05 08:56:20 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-02-09 03:03:56 -0500 |
commit | 88cb42901f1572c95f5933f363cfebd5044c716a (patch) | |
tree | 8eed3d46c81996e780375ff91ae1955f3265629d /sound/soc/soc-dapm.c | |
parent | 1ab774e049085da6facfaf3b24d54158c3f0f5b3 (diff) |
[ALSA] soc - Clean up with kmemdup()
Clean up by replacing with kmemdup().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index d0162a4cb7fd..7caf8c7b0ac5 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -87,16 +87,10 @@ module_param(dapm_status, int, 0); | |||
87 | MODULE_PARM_DESC(dapm_status, "enable DPM sysfs entries"); | 87 | MODULE_PARM_DESC(dapm_status, "enable DPM sysfs entries"); |
88 | 88 | ||
89 | /* create a new dapm widget */ | 89 | /* create a new dapm widget */ |
90 | static struct snd_soc_dapm_widget *dapm_cnew_widget( | 90 | static inline struct snd_soc_dapm_widget *dapm_cnew_widget( |
91 | const struct snd_soc_dapm_widget *_widget) | 91 | const struct snd_soc_dapm_widget *_widget) |
92 | { | 92 | { |
93 | struct snd_soc_dapm_widget* widget; | 93 | return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL); |
94 | widget = kmalloc(sizeof(struct snd_soc_dapm_widget), GFP_KERNEL); | ||
95 | if (!widget) | ||
96 | return NULL; | ||
97 | |||
98 | memcpy(widget, _widget, sizeof(struct snd_soc_dapm_widget)); | ||
99 | return widget; | ||
100 | } | 94 | } |
101 | 95 | ||
102 | /* set up initial codec paths */ | 96 | /* set up initial codec paths */ |