Received: by 10.192.165.156 with SMTP id m28csp812763imm; Thu, 19 Apr 2018 07:59:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+yZR+8XYN9GFEY0LWoLLhA9GbTenXzWWL2aClAfL1BZpGCjuuIbevhVyQsdhHQSTsKUzVu X-Received: by 10.98.96.135 with SMTP id u129mr2314623pfb.141.1524149996014; Thu, 19 Apr 2018 07:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524149995; cv=none; d=google.com; s=arc-20160816; b=tr0F5owEiBMNN86StlQZN7Y0/UoKTf6AgvW2cs33YQTpeUvDTd+k0N2+1pFjhWW0Lx AAX5rFxvevppuVRyASzZlwSv2VgRrbJcSXJe13EnPWNkF8TEPGzJha8VIlKmL8FodYNI L0Ht56mCYx0H6a+A9v9t7P4N8l0LbA4gmwt9zT9aZlxp8Ru79dbl/q/RXwnqpAnmIl4y Tgck2S1KXo/KgZycicO+TCHRfniNW/qZuw4hQ4AyhmkWHaa0nkySHSCdm7pg4Zyd1kRc 5hhk3KoCU6Ahiz0L5kP8/tnyXhVVOYDyDgVzdU+I5f4gWutsXQbzWeziQnVZSxewyOMw DmLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=wfX/kuNmOYQ6TerWMvEC5PxVFPLckAT4+wmucjxtavc=; b=tB4XhiGv4P1DGeqGx8cSDjxsv+hwzsSuQ3BKpm7K3orFgEpR11c28VsCDWInVFpz8t creKsVYCXjC19BpaW95R233I6rS33MQQjx+hsJxMQNNbhHph/CsZD8fqY/1RqBQAajBZ fAYLl1iXVP/2leBxmhx4al/jZYhegCwziesrebiBaipXPYaEp6txOvHeBrDY+EjJfC26 T35Az+gXm9PtYjNxYVgThg4tI2FhcWnGLMuSKbDdKW2h8PMg8+KyFknsEMG2ZP7p2oJO eyxD0w9nhgnWE2SB6r5YRu89ySpapE6YOG5n+vjGkhKNhJ+Rkuh0GGOZeyfTY1dMnrcY YFFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zewi9BqL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x26si3018411pgc.97.2018.04.19.07.59.42; Thu, 19 Apr 2018 07:59:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zewi9BqL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753575AbeDSO5R (ORCPT + 99 others); Thu, 19 Apr 2018 10:57:17 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:42198 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752617AbeDSO5L (ORCPT ); Thu, 19 Apr 2018 10:57:11 -0400 Received: by mail-oi0-f65.google.com with SMTP id t27-v6so5088413oij.9; Thu, 19 Apr 2018 07:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wfX/kuNmOYQ6TerWMvEC5PxVFPLckAT4+wmucjxtavc=; b=Zewi9BqLFkKNsU+SPBDnC762V6AFBpf1O9WJJNLANlyNErq2d3NuMk9YnNdVvTFzVt m8d3XqGU9Gk94HDciboXkyqHIERMG1Lnd2J9GMNrGbmts++kX44jYenDkJ2qjH+8U0JH ZmREkuaC1xNEUlEoRLVb2ospFeSZ6Axqyuk9ZujFD7a+KdQ4fEeem+yzAa40Hi58eWHb 4/j1VC+p6QmPsw7noEkVGY2DKHsLW+5mSVR6NQUWOt/JnRr+m9MYN7haWBZQaZAIUwF2 iYOU63tWOV2TzevISER1W5LyvIlZGm1ubBMGPDYeuKwvGFiNoYWd3aIdAfA7MtE2pul3 ciEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wfX/kuNmOYQ6TerWMvEC5PxVFPLckAT4+wmucjxtavc=; b=PzQ+ttE5UdwUmOS25T9QFfPIlb3Sn5F8G5erVp2ptS1e3QU17iUDoDPGhv71RshpQZ DYp6yYL9iF0kn5in0mYeH15vtkv4HgxO2DgYgIdOxdGUiqeAFpngDnX/6XYpF8BH7Wox K/3jGw0pT9XAv8ZVB1PRJIuO89doeYDogFYwzLSTa/HqBSD7or9yanZpRXuqgmK/WLl8 QCSHLEEhCoWDIQtDkGutaVtVt3TRCFyEUa9+wjoo57py2LnWOlbQCqMldY6qK8/ysxMB vX/Cawfz3/SD1aEjovtHjNE1CI848xWUg0DSEKTqGnPPhtAWfAgH92xRIikRWkDlYGdt Mlmg== X-Gm-Message-State: ALQs6tBxcH3BYGAATWZac2nmfL1J/aec34McVPF3zQYzRlcQ5xvvAqEZ YOeOA6/59A8PLQgNRFOG5ck= X-Received: by 2002:aca:1a18:: with SMTP id a24-v6mr4053489oia.111.1524149830936; Thu, 19 Apr 2018 07:57:10 -0700 (PDT) Received: from nuclearis2_1.gtech (c-98-197-2-30.hsd1.tx.comcast.net. [98.197.2.30]) by smtp.gmail.com with ESMTPSA id w20-v6sm2239078otd.70.2018.04.19.07.57.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:57:09 -0700 (PDT) Subject: Re: [RFC PATCH v2 2/4] acpi: apei: Split GHES handlers outside of ghes_do_proc To: Borislav Petkov Cc: linux-acpi@vger.kernel.org, linux-edac@vger.kernel.org, rjw@rjwysocki.net, lenb@kernel.org, tony.luck@intel.com, tbaicar@codeaurora.org, will.deacon@arm.com, james.morse@arm.com, shiju.jose@huawei.com, zjzhang@codeaurora.org, gengdongjiu@huawei.com, linux-kernel@vger.kernel.org, alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, devel@acpica.org, mchehab@kernel.org, robert.moore@intel.com, erik.schmauss@intel.com References: <20180416215903.7318-1-mr.nuke.me@gmail.com> <20180416215903.7318-3-mr.nuke.me@gmail.com> <20180418175201.GI4795@pd.tnic> <5f26275c-5896-c552-69c4-78e5aaaa6558@gmail.com> <20180419143018.GC3600@pd.tnic> From: "Alex G." Message-ID: <8f467611-16a1-8fe7-ea12-e2e29023e4e8@gmail.com> Date: Thu, 19 Apr 2018 09:57:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180419143018.GC3600@pd.tnic> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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