Commit d6ee400e authored by Slava Abramov's avatar Slava Abramov Committed by Alex Deucher

drm/amdgpu: use div64_ul for 32-bit compatibility v1

v1: replace casting to unsigned long with div64_ul
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSlava Abramov <slava.abramov@amd.com>
Tested-by: default avatarSlava Abramov <slava.abramov@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a254bfa2
......@@ -764,8 +764,8 @@ static ssize_t amdgpu_ras_sysfs_badpages_read(struct file *f,
struct amdgpu_device *adev = con->adev;
const unsigned int element_size =
sizeof("0xabcdabcd : 0x12345678 : R\n") - 1;
unsigned int start = (ppos + element_size - 1) / element_size;
unsigned int end = (ppos + count - 1) / element_size;
unsigned int start = div64_ul(ppos + element_size - 1, element_size);
unsigned int end = div64_ul(ppos + count - 1, element_size);
ssize_t s = 0;
struct ras_badpage *bps = NULL;
unsigned int bps_count = 0;
......
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