Skip to content

Commit

Permalink
div64: add missing kernel-doc
Browse files Browse the repository at this point in the history
Add missing kernel-doc notation for 2 div() functions.

Signed-off-by: Randy Dunlap <[email protected]>
Signed-off-by: Jonathan Corbet <[email protected]>
  • Loading branch information
rddunlap authored and Jonathan Corbet committed Oct 7, 2017
1 parent a1c4d24 commit 6ec72e6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions include/asm-generic/div64.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@

#if BITS_PER_LONG == 64

/**
* do_div - returns 2 values: calculate remainder and update new dividend
* @n: pointer to uint64_t dividend (will be updated)
* @base: uint32_t divisor
*
* Summary:
* ``uint32_t remainder = *n % base;``
* ``*n = *n / base;``
*
* Return: (uint32_t)remainder
*
* NOTE: macro parameter @n is evaluated multiple times,
* beware of side effects!
*/
# define do_div(n,base) ({ \
uint32_t __base = (base); \
uint32_t __rem; \
Expand Down
6 changes: 6 additions & 0 deletions lib/div64.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ uint32_t __attribute__((weak)) __div64_32(uint64_t *n, uint32_t base)
EXPORT_SYMBOL(__div64_32);
#endif

/**
* div_s64_rem - signed 64bit divide with 64bit divisor and remainder
* @dividend: 64bit dividend
* @divisor: 64bit divisor
* @remainder: 64bit remainder
*/
#ifndef div_s64_rem
s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder)
{
Expand Down

0 comments on commit 6ec72e6

Please sign in to comment.