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

From: Hidetoshi Seto
Date: Mon May 30 2011 - 01:43:12 EST


(2011/05/27 16:54), Ingo Molnar wrote:
>
> * Borislav Petkov <bp@xxxxxxxxx> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/