public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: "José Pekkarinen" <jose.pekkarinen@foxhound.fi>,
	evan.quan@amd.com, alexander.deucher@amd.com,
	christian.koenig@amd.com, Xinhui.Pan@amd.com,
	skhan@linuxfoundation.org
Cc: jdelvare@suse.com, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	daniel@ffwll.ch, airlied@gmail.com, linux@roeck-us.net,
	linux-kernel-mentees@lists.linux.dev
Subject: Re: [PATCH] drm/amd/pm: make power values signed
Date: Fri, 10 Nov 2023 13:55:22 +0530	[thread overview]
Message-ID: <6e26746d-5e4a-cc9e-fe5f-20187313fbfe@amd.com> (raw)
In-Reply-To: <20231109084110.4056-1-jose.pekkarinen@foxhound.fi>



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@foxhound.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

Thanks,
Lijo

>   
>   	val = amdgpu_hwmon_get_power(dev, AMDGPU_PP_SENSOR_GPU_AVG_POWER);
>   
> @@ -2806,7 +2806,7 @@ static ssize_t amdgpu_hwmon_show_power_input(struct device *dev,
>   					     struct device_attribute *attr,
>   					     char *buf)
>   {
> -	unsigned int val;
> +	int val;
>   
>   	val = amdgpu_hwmon_get_power(dev, AMDGPU_PP_SENSOR_GPU_INPUT_POWER);
>   

  reply	other threads:[~2023-11-10 19:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09  8:41 [PATCH] drm/amd/pm: make power values signed José Pekkarinen
2023-11-10  8:25 ` Lazar, Lijo [this message]
2023-11-10 11:27   ` José Pekkarinen

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=6e26746d-5e4a-cc9e-fe5f-20187313fbfe@amd.com \
    --to=lijo.lazar@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=evan.quan@amd.com \
    --cc=jdelvare@suse.com \
    --cc=jose.pekkarinen@foxhound.fi \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=skhan@linuxfoundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox