From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934306AbcKPIkS (ORCPT ); Wed, 16 Nov 2016 03:40:18 -0500 Received: from terminus.zytor.com ([198.137.202.10]:58032 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbcKPIkQ (ORCPT ); Wed, 16 Nov 2016 03:40:16 -0500 Date: Wed, 16 Nov 2016 00:39:50 -0800 From: tip-bot for Sebastian Andrzej Siewior Message-ID: Cc: bp@alien8.de, tony.luck@intel.com, hpa@zytor.com, bigeasy@linutronix.de, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org Reply-To: bigeasy@linutronix.de, mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, bp@alien8.de, tony.luck@intel.com, hpa@zytor.com In-Reply-To: <20161110174447.11848-2-bigeasy@linutronix.de> References: <20161110174447.11848-2-bigeasy@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] x86/mcheck: Move threshold_create_device() Git-Commit-ID: 0943637293a05aa3d8fb47bc30c7c0104480829a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0943637293a05aa3d8fb47bc30c7c0104480829a Gitweb: http://git.kernel.org/tip/0943637293a05aa3d8fb47bc30c7c0104480829a Author: Sebastian Andrzej Siewior AuthorDate: Thu, 10 Nov 2016 18:44:41 +0100 Committer: Thomas Gleixner CommitDate: Wed, 16 Nov 2016 09:34:16 +0100 x86/mcheck: Move threshold_create_device() Move the threshold_create_device() so it can use threshold_remove_device() without a forward declaration. Signed-off-by: Sebastian Andrzej Siewior Acked-by: Borislav Petkov Cc: Tony Luck Cc: rt@linutronix.de Cc: linux-edac@vger.kernel.org Link: http://lkml.kernel.org/r/20161110174447.11848-2-bigeasy@linutronix.de 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/mcheck/mce_amd.c index 9b54034..75a3e3e 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, unsigned int bank) return err; } -/* 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 = 0; - - bp = kzalloc(sizeof(struct threshold_bank *) * mca_cfg.banks, - GFP_KERNEL); - if (!bp) - return -ENOMEM; - - per_cpu(threshold_banks, cpu) = bp; - - for (bank = 0; bank < mca_cfg.banks; ++bank) { - if (!(per_cpu(bank_map, cpu) & (1 << bank))) - continue; - err = 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)); } +/* 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 = 0; + + bp = kzalloc(sizeof(struct threshold_bank *) * mca_cfg.banks, + GFP_KERNEL); + if (!bp) + return -ENOMEM; + + per_cpu(threshold_banks, cpu) = bp; + + for (bank = 0; bank < mca_cfg.banks; ++bank) { + if (!(per_cpu(bank_map, cpu) & (1 << bank))) + continue; + err = 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)