Commit beaf10ef authored by Alex Deucher's avatar Alex Deucher

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.
Acked-by: default avatarNirmoy Das <nirmoy.das@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent d7a6634a
...@@ -2784,7 +2784,7 @@ static ssize_t amdgpu_hwmon_show_sclk(struct device *dev, ...@@ -2784,7 +2784,7 @@ static ssize_t amdgpu_hwmon_show_sclk(struct device *dev,
if (r) if (r)
return 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, static ssize_t amdgpu_hwmon_show_sclk_label(struct device *dev,
...@@ -2819,7 +2819,7 @@ static ssize_t amdgpu_hwmon_show_mclk(struct device *dev, ...@@ -2819,7 +2819,7 @@ static ssize_t amdgpu_hwmon_show_mclk(struct device *dev,
if (r) if (r)
return 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, static ssize_t amdgpu_hwmon_show_mclk_label(struct device *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment