From b82a3ecdc54465c792326522d804d2eebaae9a23 Mon Sep 17 00:00:00 2001 From: Thomas Meyer Date: Thu, 17 Nov 2011 23:43:40 +0100 Subject: [PATCH] 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 Signed-off-by: Tony Luck --- arch/ia64/sn/kernel/irq.c | 5 ++--- 1 file 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, * PROM does not support SAL_INTR_REDIRECT, or it failed. * Revert to old method. */ - new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); + new_irq_info = kmemdup(sn_irq_info, sizeof(struct sn_irq_info), + GFP_ATOMIC); if (new_irq_info == NULL) return NULL; - memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info)); - /* Free the old PROM new_irq_info structure */ sn_intr_free(local_nasid, local_widget, new_irq_info); unregister_intr_pda(new_irq_info);