public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Len Brown <lenb@kernel.org>,
	Calvin Johnson <calvin.johnson@oss.nxp.com>
Subject: Re: [PATCH v1 7/7] ACPI: property: Allow counting a single value as an array of 1 element
Date: Thu, 11 Feb 2021 17:42:18 +0200	[thread overview]
Message-ID: <YCVQWgg6L5YcAXO1@smile.fi.intel.com> (raw)
In-Reply-To: <CAJZ5v0iCe=GuauCVzLG83urBHghO0suabHcMg2Kw54XFjBqCbw@mail.gmail.com>

On Wed, Feb 10, 2021 at 04:44:34PM +0100, Rafael J. Wysocki wrote:
> On Wed, Feb 10, 2021 at 4:42 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Wed, Feb 10, 2021 at 04:01:16PM +0100, Rafael J. Wysocki wrote:
> > > On Wed, Feb 10, 2021 at 3:48 PM Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > On Wed, Feb 10, 2021 at 02:48:09PM +0100, Rafael J. Wysocki wrote:
> > > > > On Wednesday, February 10, 2021 2:31:48 PM CET Rafael J. Wysocki wrote:
> > > > > > On Wednesday, February 10, 2021 1:36:00 PM CET Rafael J. Wysocki wrote:
> > > > > > > On Wed, Feb 10, 2021 at 12:51 PM Andy Shevchenko
> > > > > > > <andriy.shevchenko@linux.intel.com> wrote:

...

> > > > > > > > -       if (val && nval == 1) {
> > > > > > > > +       /* Try to read as a single value first */
> > > > > > > > +       if (!val || nval == 1) {
> > > > > > > >                 ret = acpi_data_prop_read_single(data, propname, proptype, val);
> > > > > > >
> > > > > > > This returns -EINVAL if val is NULL.
> > > >
> > > > Nope. That's why it's a patch 7. Patch 6 solves this.
> > >
> > > That's my point.  Patch 7 should be the first one in the series.
> >
> > Ah, okay. Since you want this let me rebase.
> 
> Thanks!

I started rebasing and realised that your approach has swapped the error codes,
i.e. if it's a single-value and it is, e.g., 16-bit wide, the u8 read will
return 1, while it has to return -EOVERFLOW.

If you prefer, I can move two patches to the beginning, so one will be a good
prerequisite for this fix. And I'm still unsure about stable (Fixes tag is okay
to me), because the counting never worked from the day 1.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2021-02-11 15:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10 11:43 [PATCH v1 1/7] ACPI: property: Remove dead code Andy Shevchenko
2021-02-10 11:43 ` [PATCH v1 2/7] ACPI: property: Make acpi_node_prop_read() static Andy Shevchenko
2021-02-10 11:43 ` [PATCH v1 3/7] ACPI: property: Satisfy kernel doc validator (part 1) Andy Shevchenko
2021-02-10 11:43 ` [PATCH v1 4/7] ACPI: property: Satisfy kernel doc validator (part 2) Andy Shevchenko
2021-02-10 11:43 ` [PATCH v1 5/7] ACPI: property: Refactor acpi_data_prop_read_single() Andy Shevchenko
2021-02-10 11:43 ` [PATCH v1 6/7] ACPI: property: Allow to validate a single value Andy Shevchenko
2021-02-10 11:43 ` [PATCH v1 7/7] ACPI: property: Allow counting a single value as an array of 1 element Andy Shevchenko
2021-02-10 12:36   ` Rafael J. Wysocki
2021-02-10 13:31     ` Rafael J. Wysocki
2021-02-10 13:48       ` Rafael J. Wysocki
2021-02-10 14:48         ` Andy Shevchenko
2021-02-10 15:01           ` Rafael J. Wysocki
2021-02-10 15:41             ` Andy Shevchenko
2021-02-10 15:44               ` Rafael J. Wysocki
2021-02-11 15:42                 ` Andy Shevchenko [this message]
2021-02-11 16:39                   ` 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=YCVQWgg6L5YcAXO1@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=calvin.johnson@oss.nxp.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    /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