Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753327AbdLMPjL (ORCPT ); Wed, 13 Dec 2017 10:39:11 -0500 Received: from mail.skyhub.de ([5.9.137.197]:40782 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752860AbdLMPjJ (ORCPT ); Wed, 13 Dec 2017 10:39:09 -0500 Date: Wed, 13 Dec 2017 16:38:57 +0100 From: Borislav Petkov To: "Rafael J. Wysocki" Cc: Vasyl Gomonovych , lenb@kernel.org, tony.luck@intel.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ACPI, APEI, Fix use resource_size Message-ID: <20171213153857.2cftlirw7vbo5orm@pd.tnic> References: <1513007072-32020-1-git-send-email-gomonovych@gmail.com> <4222319.ltJQ6b6Cov@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4222319.ltJQ6b6Cov@aspire.rjw.lan> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1585 Lines: 47 On Wed, Dec 13, 2017 at 01:19:55AM +0100, Rafael J. Wysocki wrote: > On Monday, December 11, 2017 4:44:31 PM CET Vasyl Gomonovych wrote: > > Use resource_size function on resource object > > Underneath __request_region set res->end to start + n - 1 > > Lets use resourse_size to set value properly. > > > > Signed-off-by: Vasyl Gomonovych > > Boris, what do you think? So if MAINTAINERS says we review apei stuff, it doesn't mean that you should completely stop doing that! :-P So this looks like a fix to me since it didn't do the + 1 before. I don't believe this would break any APEI stuff but it should be tested a little just in case. > > --- > > drivers/acpi/apei/apei-base.c | 13 ++++++------- > > 1 file changed, 6 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c > > index da370e1..af712a8 100644 > > --- a/drivers/acpi/apei/apei-base.c > > +++ b/drivers/acpi/apei/apei-base.c > > @@ -506,8 +506,7 @@ int apei_resources_request(struct apei_resources *resources, > > > > rc = -EINVAL; > > list_for_each_entry(res, &resources->iomem, list) { > > - r = request_mem_region(res->start, res->end - res->start, > > - desc); > > + r = request_mem_region(res->start, resource_size(res), desc); Jeez, this is silly: we compute resource size just so that __request_region() can "uncompute" it back: res->start = start; res->end = start + n - 1; Lovely. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.