[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY8PR11MB713409872B826AF7A527CB97894D2@CY8PR11MB7134.namprd11.prod.outlook.com>
Date: Wed, 23 Oct 2024 07:43:05 +0000
From: "Zhuo, Qiuxu" <qiuxu.zhuo@...el.com>
To: "Mehta, Sohil" <sohil.mehta@...el.com>, "Luck, Tony" <tony.luck@...el.com>
CC: "bp@...en8.de" <bp@...en8.de>, "tglx@...utronix.de" <tglx@...utronix.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"mingo@...hat.com" <mingo@...hat.com>, "hpa@...or.com" <hpa@...or.com>,
"x86@...nel.org" <x86@...nel.org>, "linux-edac@...r.kernel.org"
<linux-edac@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2 06/10] x86/mce: Convert multiple if () statements into
a switch() statement
> From: Mehta, Sohil <sohil.mehta@...el.com>
> [...]
> As Dave mentioned, change this to make the use of vfm consistent in the
> entire function and probably update the comment as well to make it explicit:
>
> /* Older CPUs (prior to family 6) don't need quirks */
Yes, the improved comment is better.
> if (c->x86_vfm < INTEL_PENTIUM_PRO)
> return;
>
> [...]
> > - if ((c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xe)) &&
> > - cfg->monarch_timeout < 0)
> > + if (c->x86_vfm >= INTEL_CORE_YONAH && cfg->monarch_timeout <
> > + 0)
> > cfg->monarch_timeout = USEC_PER_SEC;
> >
>
> Instead of keeping this open-ended we could tweak this a bit as follows:
>
> if (!(c->x86_vfm < INTEL_CORE_YONAH)) && cfg->monarch_timeout < 0)
> cfg->monarch_timeout = USEC_PER_SEC;
>
> Essentially the same: if (new_cpu) vs if (!old_cpu) Don't have a strong
> preference. Will leave it to you and Tony.
>
I prefer the single, straightforward '>=' operation over the '<' and then '!' two operations.
- Qiuxu
Powered by blists - more mailing lists