diff options
| -rw-r--r-- | include/linux/math64.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/math64.h b/include/linux/math64.h index 80690c96c734..8dd2488bf289 100644 --- a/include/linux/math64.h +++ b/include/linux/math64.h | |||
| @@ -11,6 +11,11 @@ | |||
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder | 13 | * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder |
| 14 | * @dividend: unsigned 64bit dividend | ||
| 15 | * @divisor: unsigned 32bit divisor | ||
| 16 | * @remainder: pointer to unsigned 32bit remainder | ||
| 17 | * | ||
| 18 | * Return: sets ``*remainder``, then returns dividend / divisor | ||
| 14 | * | 19 | * |
| 15 | * This is commonly provided by 32bit archs to provide an optimized 64bit | 20 | * This is commonly provided by 32bit archs to provide an optimized 64bit |
| 16 | * divide. | 21 | * divide. |
| @@ -23,6 +28,11 @@ static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) | |||
| 23 | 28 | ||
| 24 | /** | 29 | /** |
| 25 | * div_s64_rem - signed 64bit divide with 32bit divisor with remainder | 30 | * div_s64_rem - signed 64bit divide with 32bit divisor with remainder |
| 31 | * @dividend: signed 64bit dividend | ||
| 32 | * @divisor: signed 32bit divisor | ||
| 33 | * @remainder: pointer to signed 32bit remainder | ||
| 34 | * | ||
| 35 | * Return: sets ``*remainder``, then returns dividend / divisor | ||
| 26 | */ | 36 | */ |
| 27 | static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) | 37 | static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) |
| 28 | { | 38 | { |
| @@ -32,6 +42,11 @@ static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) | |||
| 32 | 42 | ||
| 33 | /** | 43 | /** |
| 34 | * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder | 44 | * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder |
| 45 | * @dividend: unsigned 64bit dividend | ||
| 46 | * @divisor: unsigned 64bit divisor | ||
| 47 | * @remainder: pointer to unsigned 64bit remainder | ||
| 48 | * | ||
| 49 | * Return: sets ``*remainder``, then returns dividend / divisor | ||
| 35 | */ | 50 | */ |
| 36 | static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) | 51 | static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) |
| 37 | { | 52 | { |
| @@ -41,6 +56,10 @@ static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) | |||
| 41 | 56 | ||
| 42 | /** | 57 | /** |
| 43 | * div64_u64 - unsigned 64bit divide with 64bit divisor | 58 | * div64_u64 - unsigned 64bit divide with 64bit divisor |
| 59 | * @dividend: unsigned 64bit dividend | ||
| 60 | * @divisor: unsigned 64bit divisor | ||
| 61 | * | ||
| 62 | * Return: dividend / divisor | ||
| 44 | */ | 63 | */ |
| 45 | static inline u64 div64_u64(u64 dividend, u64 divisor) | 64 | static inline u64 div64_u64(u64 dividend, u64 divisor) |
| 46 | { | 65 | { |
| @@ -49,6 +68,10 @@ static inline u64 div64_u64(u64 dividend, u64 divisor) | |||
| 49 | 68 | ||
| 50 | /** | 69 | /** |
| 51 | * div64_s64 - signed 64bit divide with 64bit divisor | 70 | * div64_s64 - signed 64bit divide with 64bit divisor |
| 71 | * @dividend: signed 64bit dividend | ||
| 72 | * @divisor: signed 64bit divisor | ||
| 73 | * | ||
| 74 | * Return: dividend / divisor | ||
| 52 | */ | 75 | */ |
| 53 | static inline s64 div64_s64(s64 dividend, s64 divisor) | 76 | static inline s64 div64_s64(s64 dividend, s64 divisor) |
| 54 | { | 77 | { |
| @@ -88,6 +111,8 @@ extern s64 div64_s64(s64 dividend, s64 divisor); | |||
| 88 | 111 | ||
| 89 | /** | 112 | /** |
| 90 | * div_u64 - unsigned 64bit divide with 32bit divisor | 113 | * div_u64 - unsigned 64bit divide with 32bit divisor |
| 114 | * @dividend: unsigned 64bit dividend | ||
| 115 | * @divisor: unsigned 32bit divisor | ||
| 91 | * | 116 | * |
| 92 | * This is the most common 64bit divide and should be used if possible, | 117 | * This is the most common 64bit divide and should be used if possible, |
| 93 | * as many 32bit archs can optimize this variant better than a full 64bit | 118 | * as many 32bit archs can optimize this variant better than a full 64bit |
| @@ -103,6 +128,8 @@ static inline u64 div_u64(u64 dividend, u32 divisor) | |||
| 103 | 128 | ||
| 104 | /** | 129 | /** |
| 105 | * div_s64 - signed 64bit divide with 32bit divisor | 130 | * div_s64 - signed 64bit divide with 32bit divisor |
| 131 | * @dividend: signed 64bit dividend | ||
| 132 | * @divisor: signed 32bit divisor | ||
| 106 | */ | 133 | */ |
| 107 | #ifndef div_s64 | 134 | #ifndef div_s64 |
| 108 | static inline s64 div_s64(s64 dividend, s32 divisor) | 135 | static inline s64 div_s64(s64 dividend, s32 divisor) |
