aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/loopback.c
diff options
context:
space:
mode:
authorAlexandre Bailon <abailon@baylibre.com>2016-03-08 16:37:36 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-03-09 22:31:32 -0800
commit89ec14ceaedf887fb666f09e1b768afdc32cb291 (patch)
treed73e18ee395437a064fdc8cbf490d5342ecb5a07 /drivers/staging/greybus/loopback.c
parentgreybus: greybus_manifest: remove unused SVC class (diff)
downloadlinux-dev-89ec14ceaedf887fb666f09e1b768afdc32cb291.tar.xz
linux-dev-89ec14ceaedf887fb666f09e1b768afdc32cb291.zip
greybus: loopback: Fix warning on 32-bit build
gb_loopback_ro_avg_attr() is using "/" to divide two 64-bit integer, causing a reference to __aeabi_uldivmod() that is not availalbe on 32-bit. Instead, use do_div(). Signed-off-by: Alexandre Bailon <abailon@baylibre.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/loopback.c')
-rw-r--r--drivers/staging/greybus/loopback.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
index ba6e12a3648c..75bff56b48c3 100644
--- a/drivers/staging/greybus/loopback.c
+++ b/drivers/staging/greybus/loopback.c
@@ -164,7 +164,8 @@ static ssize_t name##_avg_show(struct device *dev, \
count = stats->count ? stats->count : 1; \
avg = stats->sum; \
rem = do_div(avg, count); \
- rem = 1000000 * rem / count; \
+ rem *= 1000000; \
+ do_div(rem, count); \
return sprintf(buf, "%llu.%06u\n", avg, (u32)rem); \
} \
static DEVICE_ATTR_RO(name##_avg)