All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Carlo Caione <carlo@endlessm.com>
Cc: Carlo Caione <carlo@caione.org>,
	"dvhart@infradead.org" <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	Platform Driver <platform-driver-x86@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linux Upstreaming Team <linux@endlessm.com>
Subject: Re: [PATCH 1/2] hp-wmi: Fix error value for hp_wmi_tablet_state
Date: Wed, 19 Apr 2017 19:26:28 +0300	[thread overview]
Message-ID: <CAHp75VeuiwPBt2AU95X1KHWT3nm5LedG0n5aR9Vd+kPfQaRT-g@mail.gmail.com> (raw)
In-Reply-To: <CAL9uMOHuC5Phg8UcCvrDwqCiCcndEF4co8R_jgPQ+LTd8WN=BQ@mail.gmail.com>

On Wed, Apr 19, 2017 at 7:24 PM, Carlo Caione <carlo@endlessm.com> wrote:
> On Wed, Apr 19, 2017 at 6:21 PM, Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
>> On Sun, Apr 9, 2017 at 4:56 PM, Carlo Caione <carlo@caione.org> wrote:
>>> From: Carlo Caione <carlo@endlessm.com>
>>>
>>> hp_wmi_tablet_state() fails to return the correct error code when
>>> hp_wmi_perform_query() returns the HP WMI query specific error code
>>> that is a positive value.
>>
>>>         int ret = hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, 0, &state,
>>>                                        sizeof(state), sizeof(state));
>>>         if (ret)
>>> -               return ret;
>>> +               return -EINVAL;
>>
>> Shouldn't be something like
>>
>> if (ret)
>>  return ret < 0 ? ret : -EINVAL;
>>
>> Looking into the code it looks like it may return all possible values:
>> 0, negative, positive.
>
> When the HP WMI query returns a positive value something went wrong.
> hp_wmi_perform_query() returns 0 on success.

Yes, that's what I didn't object anyhow. My point is not to shadow
negative errors if any.

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2017-04-19 16:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-09 13:56 [PATCH 0/2] hp-wmi: Fix dock status and tablet mode reporting Carlo Caione
2017-04-09 13:56 ` [PATCH 1/2] hp-wmi: Fix error value for hp_wmi_tablet_state Carlo Caione
2017-04-19 16:21   ` Andy Shevchenko
2017-04-19 16:24     ` Carlo Caione
2017-04-19 16:26       ` Andy Shevchenko [this message]
2017-04-09 13:56 ` [PATCH 2/2] hp-wmi: Fix detection for dock and tablet mode Carlo Caione
2017-04-13 18:21   ` Darren Hart
2017-04-13 20:09     ` Carlo Caione
2017-04-13 23:07       ` Darren Hart
2017-04-19 16:23         ` Andy Shevchenko
2017-04-19 20:12           ` Darren Hart
2017-04-13  6:28 ` [PATCH 0/2] hp-wmi: Fix dock status and tablet mode reporting Carlo Caione
2017-04-13 17:23   ` Darren Hart

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=CAHp75VeuiwPBt2AU95X1KHWT3nm5LedG0n5aR9Vd+kPfQaRT-g@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=andy@infradead.org \
    --cc=carlo@caione.org \
    --cc=carlo@endlessm.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@endlessm.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.