mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Borislav Petkov <bp@amd64.org>
Cc: tony.luck@intel.com, andi@firstfloor.org,
	gong.chen@linux.intel.com, ananth@in.ibm.com,
	masbock@linux.vnet.ibm.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, lcm@us.ibm.com, mingo@redhat.com,
	tglx@linutronix.de, linux-edac@vger.kernel.org
Subject: Re: [PATCH 1/2] x86/mce: Pack boolean MCE boot flags into a structure
Date: Tue, 28 Aug 2012 12:47:30 +0530	[thread overview]
Message-ID: <503C708A.3010102@linux.vnet.ibm.com> (raw)
In-Reply-To: <20120827201840.GC9539@aftab.osrc.amd.com>

On 08/28/2012 01:48 AM, Borislav Petkov wrote:
> On Mon, Aug 27, 2012 at 10:44:40PM +0530, Naveen N. Rao wrote:
>> Looks good. Infact, I had actually added mce_ser and mce_disabled
>> into the bitfield, but backed off not wanting to overdo.
>>
>> We could pull in all the other configuration parameters into this
>> structure as long as everyone is ok with this.
>
> Well, if you'd like, you can make one change per patch so that they can
> be easily reviewable.

Ok.

>
>>> diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
>>> index a3ac52b29cbf..e5cfd241e508 100644
>>> --- a/arch/x86/include/asm/mce.h
>>> +++ b/arch/x86/include/asm/mce.h
>>> @@ -126,7 +126,6 @@ struct mce_log {
>>>   #define K8_MCE_THRESHOLD_BANK_5    (MCE_THRESHOLD_BASE + 5 * 9)
>>>   #define K8_MCE_THRESHOLD_DRAM_ECC  (MCE_THRESHOLD_BANK_4 + 0)
>>>
>>> -
>>>   #ifdef __KERNEL__
>>>
>>>   extern void mce_register_decode_chain(struct notifier_block *nb);
>>> @@ -169,8 +168,6 @@ DECLARE_PER_CPU(struct device *, mce_device);
>>>   #define MAX_NR_BANKS 32
>>>
>>>   #ifdef CONFIG_X86_MCE_INTEL
>>> -extern int mce_cmci_disabled;
>>> -extern int mce_ignore_ce;
>>>   void mce_intel_feature_init(struct cpuinfo_x86 *c);
>>>   void cmci_clear(void);
>>>   void cmci_reenable(void);
>>> diff --git a/arch/x86/kernel/cpu/mcheck/mce-internal.h b/arch/x86/kernel/cpu/mcheck/mce-internal.h
>>> index 6a05c1d327a9..3b25bcf452d9 100644
>>> --- a/arch/x86/kernel/cpu/mcheck/mce-internal.h
>>> +++ b/arch/x86/kernel/cpu/mcheck/mce-internal.h
>>> @@ -28,6 +28,15 @@ extern int mce_ser;
>>>
>>>   extern struct mce_bank *mce_banks;
>>>
>>> +struct mce_cfg {
>>> +	__u32	cmci_disabled		: 1,
>>> +		ignore_ce		: 1,
>>> +		dont_log_ce		: 1,
>>> +		__pad			: 29;
>>> +};
>>> +
>>> +extern struct mce_cfg cfg;
>>> +
>>
>> I'd prefer mce_cfg, rather than just cfg. I think it looks clearer
>> to say, for instance, mce_ser.ignore_ce rather than just
>> cfg.ignore_ce where the latter looks more like a global thing. But,
>> of course, the former is more concise...
>
> Yes,
>
> * it is more consise
> * it is private to mce so no ambiguity
> * having identical struct name and variable names is very confusing (at least
>   to me)
>
> so you can do
>
> extern struct mce_cfg m_cfg;
>
> or
>
> extern struct mce_config mcfg;
>
> or similar but please keep struct name and variable name different.

Sure - I thought this was commonly done, but it is indeed confusing. 
I'll change it.


Thanks,
Naveen

>
> Thanks.
>


      reply	other threads:[~2012-08-28  7:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-27 11:25 Naveen N. Rao
2012-08-27 11:25 ` [PATCH 2/2] x86/mce: Honour bios-set CMCI threshold Naveen N. Rao
2012-08-27 14:48   ` Borislav Petkov
2012-08-27 15:11     ` Naveen N. Rao
2012-08-27 15:21       ` Borislav Petkov
2012-08-27 13:58 ` [PATCH 1/2] x86/mce: Pack boolean MCE boot flags into a structure Andi Kleen
2012-08-27 14:18   ` Borislav Petkov
2012-08-28  6:55     ` Naveen N. Rao
2012-08-27 14:36 ` Borislav Petkov
2012-08-27 15:35   ` Naveen N. Rao
2012-08-27 15:47     ` Borislav Petkov
2012-08-27 16:01       ` Naveen N. Rao
2012-08-27 16:34         ` Borislav Petkov
2012-08-27 17:14           ` Naveen N. Rao
2012-08-27 20:18             ` Borislav Petkov
2012-08-28  7:17               ` Naveen N. Rao [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=503C708A.3010102@linux.vnet.ibm.com \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ananth@in.ibm.com \
    --cc=andi@firstfloor.org \
    --cc=bp@amd64.org \
    --cc=gong.chen@linux.intel.com \
    --cc=lcm@us.ibm.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masbock@linux.vnet.ibm.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome