mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 23:24:50 +00:00
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>
This commit is contained in:
parent
a23aa56452
commit
89ec14ceae
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue