[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0e8b9aea-4d6d-7c2b-2e16-f30171357c06@collabora.co.uk>
Date: Thu, 3 Nov 2016 17:41:31 +0100
From: Andrew Shadura <andrew.shadura@...labora.co.uk>
To: "Deucher, Alexander" <Alexander.Deucher@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"Koenig, Christian" <Christian.Koenig@....com>,
David Airlie <airlied@...ux.ie>
Cc: "Zhu, Rex" <Rex.Zhu@....com>, Jammy Zhou <Jammy.Zhou@....com>
Subject: Re: [PATCH] drm/amd/powerplay: return false instead of -EINVAL
On 03/11/16 17:39, Deucher, Alexander wrote:
>> Returning -EINVAL from a bool-returning function
>> phm_check_smc_update_required_for_display_configuration has an
>> unexpected
>> effect of returning true, which is probably not what was intended.
>> Replace -EINVAL by false.
>>
>> The only place this function is called from is
>> psm_adjust_power_state_dynamic in
>> drivers/gpu/drm/amd/powerplay/eventmgr/psm.c:106:
>>
>> if (!equal ||
>> phm_check_smc_update_required_for_display_configuration(hwmgr)) {
>> phm_apply_state_adjust_rules(hwmgr, requested,
>> pcurrent);
>> phm_set_power_state(hwmgr, &pcurrent->hardware,
>> &requested->hardware);
>> hwmgr->current_ps = requested;
>> }
>>
>> It seems to expect a boolean value here.
>>
>> This issue has been found using the following Coccinelle semantic patch
>> written by Peter Senna Tschudin:
>> <smpl>
>> @@
>> identifier f;
>> constant C;
>> typedef bool;
>> @@
>> bool f (...){
>> <+...
>> * return -C;
>> ...+>
>> }
>> </smpl>
>>
>> Signed-off-by: Andrew Shadura <andrew.shadura@...labora.co.uk>
>
> Reviewed-by: Alex Deucher <alexander.deucher@....com>
>
> I'll pick this up shortly. Thanks!
Great, thanks! I wonder who should I prod for this one:
https://patchwork.kernel.org/patch/7206081/
--
Cheers,
Andrew
Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)
Powered by blists - more mailing lists