diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2016-09-16 05:09:12 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-10-12 03:29:30 -0400 |
commit | 321c258e9192377cff2cb34b9d12fca0ee60b13f (patch) | |
tree | 056ac7053c4746d48f21af5724a62f11fbd898a4 | |
parent | d6c6035af7ccadd647832681d6b2a53d4c8705de (diff) |
drm/nouveau/volt: use kernel's 64-bit signed division function
Doing direct 64 bit divisions in kernel code leads to references to
undefined symbols on 32 bit architectures. Replace such divisions with
calls to div64_s64 to make the module usable on 32 bit archs.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c index 90d234231eed..e8569b04b55d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c | |||
@@ -116,9 +116,9 @@ nvkm_volt_map(struct nvkm_volt *volt, u8 id, u8 temp) | |||
116 | return volt->speedo; | 116 | return volt->speedo; |
117 | 117 | ||
118 | if (ver == 0x10 || (ver == 0x20 && info.mode == 0)) { | 118 | if (ver == 0x10 || (ver == 0x20 && info.mode == 0)) { |
119 | result = (s64)info.arg[0] / 10; | 119 | result = div64_s64((s64)info.arg[0], 10); |
120 | result += ((s64)info.arg[1] * volt->speedo) / 10; | 120 | result += div64_s64((s64)info.arg[1] * volt->speedo, 10); |
121 | result += ((s64)info.arg[2] * volt->speedo * volt->speedo) / 100000; | 121 | result += div64_s64((s64)info.arg[2] * volt->speedo * volt->speedo, 100000); |
122 | } else if (ver == 0x20) { | 122 | } else if (ver == 0x20) { |
123 | switch (info.mode) { | 123 | switch (info.mode) { |
124 | /* 0x0 handled above! */ | 124 | /* 0x0 handled above! */ |