From: Ingo Molnar <mingo@kernel.org>
To: "David E. Box" <david.e.box@linux.intel.com>
Cc: hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] x86: iosf: Make debugfs addition a separate config option
Date: Wed, 17 Sep 2014 14:26:43 +0200 [thread overview]
Message-ID: <20140917122643.GC2704@gmail.com> (raw)
In-Reply-To: <1410924386-16977-4-git-send-email-david.e.box@linux.intel.com>
* David E. Box <david.e.box@linux.intel.com> wrote:
> Signed-off-by: David E. Box <david.e.box@linux.intel.com>
> ---
> arch/x86/Kconfig | 6 ++++++
> arch/x86/kernel/iosf_mbi.c | 8 ++++++--
> 2 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 2db4b1d..3afcac3 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -494,6 +494,12 @@ config IOSF_MBI
> You should say Y if you are running a kernel on one of these
> platforms.
>
> +config IOSF_MBI_DEBUG
> + bool "Enable debugfs access to IOSF"
> + depends on IOSF_MBI && DEBUG_FS
> + ---help---
> + Select this option to enable iosf sideband debugging through debugfs.
Please also mention where the debug info is.
> -/********************** debugfs begin ****************************/
> +#if (IS_ENABLED(CONFIG_IOSF_MBI_DEBUG))
> static u32 dbg_mdr;
> static u32 dbg_mcr;
> static u32 dbg_mcrx;
> @@ -257,7 +257,7 @@ static void iosf_sideband_debug_init(void)
> cleanup:
> debugfs_remove_recursive(d);
> }
> -/********************** debugfs end ****************************/
> +#endif /* CONFIG_IOSF_MBI_DEBUG */
>
> static int iosf_mbi_probe(struct pci_dev *pdev,
> const struct pci_device_id *unused)
> @@ -290,13 +290,17 @@ static struct pci_driver iosf_mbi_pci_driver = {
>
> static int __init iosf_mbi_init(void)
> {
> +#if IS_ENABLED(CONFIG_IOSF_MBI_DEBUG)
> iosf_sideband_debug_init();
> +#endif
> return pci_register_driver(&iosf_mbi_pci_driver);
> }
>
> static void __exit iosf_mbi_exit(void)
> {
> +#if IS_ENABLED(CONFIG_IOSF_MBI_DEBUG)
> debugfs_remove_recursive(iosf_dbg);
> +#endif
The last two #ifdefs are pretty ugly, please make dummy !DEBUG
versions of those methods, so that the regular code is not
uglified with debugging details.
Also, because COFIG_IOSF_MBI_DEBUG is a bool, using:
#ifdef CONFIG_IOSF_MBI_DEBUG
should be enough in general.
Thanks,
Ingo
prev parent reply other threads:[~2014-09-17 12:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 21:40 [PATCH 0/2] x86: iosf: change Kconfig selection and add debugfs David E. Box
2014-08-27 21:40 ` [PATCH 1/2] x86: iosf: Add Kconfig prompt for IOSF_MBI selection David E. Box
2014-09-02 21:07 ` [tip:x86/platform] x86/iosf: " tip-bot for David E. Box
2014-08-27 21:40 ` [PATCH 2/2] x86: iosf: Add debugfs support David E. Box
2014-08-27 22:20 ` H. Peter Anvin
2014-09-02 21:07 ` [tip:x86/platform] x86/iosf: " tip-bot for David E. Box
2014-09-17 3:26 ` [PATCH 0/3] x86: iosf: Additions to iosf patch set David E. Box
2014-09-18 5:13 ` [PATCH V2 " David E. Box
2014-09-18 5:13 ` [PATCH V2 1/3] x86: iosf: Add Braswell PCI ID David E. Box
2014-09-19 11:49 ` [tip:x86/platform] x86/platform/intel/iosf: " tip-bot for David E. Box
2014-09-18 5:13 ` [PATCH V2 2/3] x86: iosf: Add better description of IOSF driver in config David E. Box
2014-09-19 11:49 ` [tip:x86/platform] x86/platform/intel/iosf: " tip-bot for David E. Box
2014-09-18 5:13 ` [PATCH V2 3/3] x86: iosf: Add debugfs config option for iosf David E. Box
2014-09-19 11:49 ` [tip:x86/platform] x86/platform/intel/iosf: Add debugfs config option for IOSF tip-bot for David E. Box
2014-09-17 3:26 ` [PATCH 1/3] x86: iosf: Add Braswell PCI ID David E. Box
2014-09-17 3:26 ` [PATCH 2/3] x86: iosf: Move Kconfig to proper submenu David E. Box
2014-09-17 12:31 ` Ingo Molnar
2014-09-17 3:26 ` [PATCH 3/3] x86: iosf: Make debugfs addition a separate config option David E. Box
2014-09-17 12:26 ` Ingo Molnar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140917122643.GC2704@gmail.com \
--to=mingo@kernel.org \
--cc=david.e.box@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.