Re: [PATCH 03/12] mce-severity: cleanup severity table

Hidetoshi Seto
2011-05-30T05:42:58Z

(2011/05/27 16:54), Ingo Molnar wrote:
>
> * Borislav Petkov <bp@alien8.de> wrote:
>
>>> - BITSET(
>>> - MCI_STATUS_PCC,
>>> - PANIC, "Processor context corrupt"
>>> + MCESEV(
>>> + PANIC, "Processor context corrupt",
>>> + BITSET(MCI_STATUS_PCC)
>>> ),
>>
>> I'm still wondering whether using the gcc struct assignment syntax could
>> make those much more readable instead of changing the macro inclusion:
>>
>> {
>> .sev = MCE_PANIC_SEVERITY,
>> .msg = "Processor context corrupt",
>> .mask = MCI_STATUS_PCC,
>> .result = MCI_STATUS_PCC,
>> },
>> ...
>
> Hidetoshi's version was already an improvement over what we have
> currently (what we have now is largely unreadable), but your variant
> looks even more readable and isnt all that much longer either.
>
> So, the case for macros is where the initialization can be compressed
> into a single *readable* line. If that cannot be done then the least
> obfuscated version is generally the better one.

Maybe in later we can have another patch to make this table to use
the gcc's syntax if it is really required. And also it would worth
considering to re-implement this severity-leveling without the table.

Since this is a part of "minor" change set and I still like my version
with existing packed conditions, so at the moment I'd like to keep this
patch as a non-intrusive change.

Thanks,
H.Seto