diff options
author | Thomas Meyer <thomas@m3y3r.de> | 2011-11-17 17:43:40 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2011-12-09 18:22:34 -0500 |
commit | b82a3ecdc54465c792326522d804d2eebaae9a23 (patch) | |
tree | 797c598f1262d045a7a38cfd246e7860bfb1aa27 /arch/ia64 | |
parent | ac0d1a48d8b18c4808ab73d990b83bb032f21c25 (diff) |
ia64: sn: 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: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/sn/kernel/irq.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c index 485c42d97e83..dfac09ab027a 100644 --- a/arch/ia64/sn/kernel/irq.c +++ b/arch/ia64/sn/kernel/irq.c | |||
@@ -150,12 +150,11 @@ struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *sn_irq_info, | |||
150 | * PROM does not support SAL_INTR_REDIRECT, or it failed. | 150 | * PROM does not support SAL_INTR_REDIRECT, or it failed. |
151 | * Revert to old method. | 151 | * Revert to old method. |
152 | */ | 152 | */ |
153 | new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); | 153 | new_irq_info = kmemdup(sn_irq_info, sizeof(struct sn_irq_info), |
154 | GFP_ATOMIC); | ||
154 | if (new_irq_info == NULL) | 155 | if (new_irq_info == NULL) |
155 | return NULL; | 156 | return NULL; |
156 | 157 | ||
157 | memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info)); | ||
158 | |||
159 | /* Free the old PROM new_irq_info structure */ | 158 | /* Free the old PROM new_irq_info structure */ |
160 | sn_intr_free(local_nasid, local_widget, new_irq_info); | 159 | sn_intr_free(local_nasid, local_widget, new_irq_info); |
161 | unregister_intr_pda(new_irq_info); | 160 | unregister_intr_pda(new_irq_info); |