Messages in this thread | | | Subject | Re: [RFC PATCH v2 2/4] acpi: apei: Split GHES handlers outside of ghes_do_proc | From | "Alex G." <> | Date | Thu, 19 Apr 2018 09:57:08 -0500 |
| |
On 04/19/2018 09:30 AM, Borislav Petkov wrote: > On Thu, Apr 19, 2018 at 09:19:03AM -0500, Alex G. wrote: >> On the other side, you lose readability as soon as you get a few more >> handlers and the function becomes too long. > > No you don't - you split it properly.
And that was the motivation behind my splitting it in this patch.
>> And more importantly, you lose generality: it's not obvious that >> there's ghes_edac_report_mem_error() which too wide a context. > > I don't understand what that means.
My apologies, sometimes my thought is too far ahead of my typing fingers. For the purpose of handling _one_ error, you need the CPER entry for that one error -- narrow context. You don't need the entire GHES structure -- wide context. Individual handlers should not be able to access the entire ghes.
When the handlers are restricted to a common signature --which doesn't include ghes--, it's obvious when functions try to bite more than they can chew.
Alex
| |