From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965876AbcKJRql (ORCPT ); Thu, 10 Nov 2016 12:46:41 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:34002 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934615AbcKJRqi (ORCPT ); Thu, 10 Nov 2016 12:46:38 -0500 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, rt@linutronix.de, Sebastian Andrzej Siewior , Tony Luck , Borislav Petkov , linux-edac@vger.kernel.org, x86@kernel.org Subject: [PATCH 1/7] x86/mcheck: Move threshold_create_device() Date: Thu, 10 Nov 2016 18:44:41 +0100 Message-Id: <20161110174447.11848-2-bigeasy@linutronix.de> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161110174447.11848-1-bigeasy@linutronix.de> References: <20161110091809.vxyf3yiuxtjy3vqv@pd.tnic> <20161110174447.11848-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the threshold_create_device() so it can use threshold_remove_device() without a forward declaration. Cc: Tony Luck Cc: Borislav Petkov Cc: linux-edac@vger.kernel.org Cc: x86@kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/mcheck/mce_amd.c | 50 ++++++++++++++++++--------------= ---- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mch= eck/mce_amd.c index 9b5403462936..75a3e3eab81e 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c @@ -1010,31 +1010,6 @@ static int threshold_create_bank(unsigned int cpu, u= nsigned int bank) return err; } =20 -/* create dir/files for all valid threshold banks */ -static int threshold_create_device(unsigned int cpu) -{ - unsigned int bank; - struct threshold_bank **bp; - int err =3D 0; - - bp =3D kzalloc(sizeof(struct threshold_bank *) * mca_cfg.banks, - GFP_KERNEL); - if (!bp) - return -ENOMEM; - - per_cpu(threshold_banks, cpu) =3D bp; - - for (bank =3D 0; bank < mca_cfg.banks; ++bank) { - if (!(per_cpu(bank_map, cpu) & (1 << bank))) - continue; - err =3D threshold_create_bank(cpu, bank); - if (err) - return err; - } - - return err; -} - static void deallocate_threshold_block(unsigned int cpu, unsigned int bank) { @@ -1114,6 +1089,31 @@ static void threshold_remove_device(unsigned int cpu) kfree(per_cpu(threshold_banks, cpu)); } =20 +/* create dir/files for all valid threshold banks */ +static int threshold_create_device(unsigned int cpu) +{ + unsigned int bank; + struct threshold_bank **bp; + int err =3D 0; + + bp =3D kzalloc(sizeof(struct threshold_bank *) * mca_cfg.banks, + GFP_KERNEL); + if (!bp) + return -ENOMEM; + + per_cpu(threshold_banks, cpu) =3D bp; + + for (bank =3D 0; bank < mca_cfg.banks; ++bank) { + if (!(per_cpu(bank_map, cpu) & (1 << bank))) + continue; + err =3D threshold_create_bank(cpu, bank); + if (err) + return err; + } + + return err; +} + /* get notified when a cpu comes on/off */ static void amd_64_threshold_cpu_callback(unsigned long action, unsigned int cpu) --=20 2.10.2