lkml.org 
[lkml]   [2017]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] hp-wmi: Fix error value for hp_wmi_tablet_state
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.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2017-04-19 18:22    [W:0.114 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site