Linux Audio

Check our new training course

Loading...
Note: File does not exist in v3.1.
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/*
 3 * Copyright (C) 2012 Fujitsu.  All rights reserved.
 4 * Written by Miao Xie <miaox@cn.fujitsu.com>
 5 */
 6
 7#ifndef BTRFS_MATH_H
 8#define BTRFS_MATH_H
 9
10#include <asm/div64.h>
11
12static inline u64 div_factor(u64 num, int factor)
13{
14	if (factor == 10)
15		return num;
16	num *= factor;
17	return div_u64(num, 10);
18}
19
20static inline u64 div_factor_fine(u64 num, int factor)
21{
22	if (factor == 100)
23		return num;
24	num *= factor;
25	return div_u64(num, 100);
26}
27
28#endif