From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH v8 09/26] ACPI / APEI: Generalise the estatus queue's notify code Date: Fri, 1 Feb 2019 14:46:21 +0100 Message-ID: <20190201134602.GI31854@zn.tnic> References: <20190129184902.102850-1-james.morse@arm.com> <20190129184902.102850-10-james.morse@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20190129184902.102850-10-james.morse@arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu To: James Morse Cc: Rafael Wysocki , Tony Luck , linux-mm@kvack.org, Marc Zyngier , Catalin Marinas , Will Deacon , Dongjiu Geng , linux-acpi@vger.kernel.org, Naoya Horiguchi , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Len Brown List-Id: linux-acpi@vger.kernel.org On Tue, Jan 29, 2019 at 06:48:45PM +0000, James Morse wrote: > +static int ghes_in_nmi_spool_from_list(struct list_head *rcu_list) > +{ > + int err, ret = -ENOENT; > + struct ghes *ghes; > + > + rcu_read_lock(); > + list_for_each_entry_rcu(ghes, rcu_list, list) { > + err = ghes_in_nmi_queue_one_entry(ghes); > + if (!err) > + ret = 0; Do I understand this correctly that we want to do "ret = 0" for at least one record which ghes_in_nmi_queue_one_entry() has succeeded queueing? For those for which it has returned -ENOENT, estatus has been cleared, nothing has been queued so we don't have to do anything for that particular entry... Btw, you don't really need the err variable: if (!ghes_in_nmi_queue_one_entry(ghes)) ret = 0; -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.