mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Vasyl Gomonovych <gomonovych@gmail.com>,
	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
Date: Wed, 13 Dec 2017 16:38:57 +0100	[thread overview]
Message-ID: <20171213153857.2cftlirw7vbo5orm@pd.tnic> (raw)
In-Reply-To: <4222319.ltJQ6b6Cov@aspire.rjw.lan>

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 <gomonovych@gmail.com>
> 
> 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.

  reply	other threads:[~2017-12-13 15:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 15:44 Vasyl Gomonovych
2017-12-13  0:19 ` Rafael J. Wysocki
2017-12-13 15:38   ` Borislav Petkov [this message]
2017-12-13 23:07     ` Rafael J. Wysocki
2017-12-14  9:37       ` Borislav Petkov
2017-12-16 10:34         ` Rafael J. Wysocki
2017-12-16 10:43           ` Rafael J. Wysocki
2017-12-16 11:56             ` Borislav Petkov
2017-12-16 15:54               ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171213153857.2cftlirw7vbo5orm@pd.tnic \
    --to=bp@alien8.de \
    --cc=gomonovych@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®