[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <334c8e5e3fcc99752d28ecf0937c53dd@foxhound.fi>
Date: Fri, 10 Nov 2023 13:27:23 +0200
From: José Pekkarinen <jose.pekkarinen@...hound.fi>
To: "Lazar, Lijo" <lijo.lazar@....com>
Cc: evan.quan@....com, alexander.deucher@....com,
christian.koenig@....com, Xinhui.Pan@....com,
skhan@...uxfoundation.org, jdelvare@...e.com,
linux-kernel@...r.kernel.org, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, daniel@...ll.ch,
airlied@...il.com, linux@...ck-us.net,
linux-kernel-mentees@...ts.linux.dev
Subject: Re: [PATCH] drm/amd/pm: make power values signed
On 2023-11-10 10:25, Lazar, Lijo wrote:
> On 11/9/2023 2:11 PM, José Pekkarinen wrote:
>> The following patch will convert the power values returned by
>> amdgpu_hwmon_get_power to signed, fixing the following warnings
>> reported
>> by coccinelle:
>>
>> drivers/gpu/drm/amd/pm/amdgpu_pm.c:2801:5-8: WARNING: Unsigned
>> expression compared with zero: val < 0
>> drivers/gpu/drm/amd/pm/amdgpu_pm.c:2814:5-8: WARNING: Unsigned
>> expression compared with zero: val < 0
>>
>> Signed-off-by: José Pekkarinen <jose.pekkarinen@...hound.fi>
>> ---
>> drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
>> b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
>> index e7bb1d324084..913ff62d5d5e 100644
>> --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
>> +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
>> @@ -2795,7 +2795,7 @@ static ssize_t
>> amdgpu_hwmon_show_power_avg(struct device *dev,
>> struct device_attribute *attr,
>> char *buf)
>> {
>> - unsigned int val;
>> + int val;
>
> Hi Alex,
>
> It's a different code in drm-next.
>
> https://gitlab.freedesktop.org/agd5f/linux/-/blob/amd-staging-drm-next/drivers/gpu/drm/amd/pm/amdgpu_pm.c#L2936
I checked it, and ssize_t also removes the warning,
so you can stay with whatever is in the amd-staging-drm-next
tree and ignore this.
Thanks!
José.
Powered by blists - more mailing lists