drm/amdgpu: use %u rather than %d for sclk/mclk
Subsystems (2)
PATCH 1/1 drm/amdgpu: use %u rather than %d for sclk/mclk
Large clock values may overflow and show up as negative.
Reported by prOMiNd on IRC.
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2 -2
@@ -2960,7 +2960,7 @@ static ssize_t amdgpu_hwmon_show_sclk(struct device *dev,if (r)return r; -return snprintf (buf,PAGE_SIZE ,"%d\n" , sclk *10 *1000 ); +return snprintf (buf,PAGE_SIZE ,"%u\n" , sclk *10 *1000 ); } static ssize_t amdgpu_hwmon_show_sclk_label(struct device *dev,
@@ -2997,7 +2997,7 @@ static ssize_t amdgpu_hwmon_show_mclk(struct device *dev,if (r)return r; -return snprintf (buf,PAGE_SIZE ,"%d\n" , mclk *10 *1000 ); +return snprintf (buf,PAGE_SIZE ,"%u\n" , mclk *10 *1000 ); } static ssize_t amdgpu_hwmon_show_mclk_label(struct device *dev,
Signature · 6 lines
2.25.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Acked-by Nirmoy Das <[email protected]>
Quoted 23 lines · Alex Deucher
Large clock values may overflow and show up as negative.
Reported by prOMiNd on IRC.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +1
-1@@ -2960,7 +2960,7 @@ static ssize_t amdgpu_hwmon_show_sclk(struct device *dev,if (r)return r; -return snprintf (buf,PAGE_SIZE ,"%d\n" , sclk *10 *1000 ); +return snprintf (buf,PAGE_SIZE ,"%u\n" , sclk *10 *1000 ); } static ssize_t amdgpu_hwmon_show_sclk_label(struct device *dev,
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c static ssize_t amdgpu_hwmon_show_mclk(struct device *dev, · line 3003
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +1
-1@@ -2997,7 +2997,7 @@ static ssize_t amdgpu_hwmon_show_mclk(struct device *dev,if (r)return r; -return snprintf (buf,PAGE_SIZE ,"%d\n" , mclk *10 *1000 ); +return snprintf (buf,PAGE_SIZE ,"%u\n" , mclk *10 *1000 ); } static ssize_t amdgpu_hwmon_show_mclk_label(struct device *dev,
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx