mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 23:04:54 +01:00
Add 'const' to some function arguments and variables to make it easier to read the code. Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Miroslav Lichvar <[email protected]> Cc: Richard Cochran <[email protected]> Cc: Prarit Bhargava <[email protected]> Cc: Stephen Boyd <[email protected]> Signed-off-by: Ondrej Mosnacek <[email protected]> [jstultz: Also fixup pre-existing checkpatch warnings for prototype arguments with no variable name] Signed-off-by: John Stultz <[email protected]>
35 lines
784 B
C
35 lines
784 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _TIMEKEEPING_INTERNAL_H
|
|
#define _TIMEKEEPING_INTERNAL_H
|
|
/*
|
|
* timekeeping debug functions
|
|
*/
|
|
#include <linux/clocksource.h>
|
|
#include <linux/time.h>
|
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
extern void tk_debug_account_sleep_time(const struct timespec64 *t);
|
|
#else
|
|
#define tk_debug_account_sleep_time(x)
|
|
#endif
|
|
|
|
#ifdef CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE
|
|
static inline u64 clocksource_delta(u64 now, u64 last, u64 mask)
|
|
{
|
|
u64 ret = (now - last) & mask;
|
|
|
|
/*
|
|
* Prevent time going backwards by checking the MSB of mask in
|
|
* the result. If set, return 0.
|
|
*/
|
|
return ret & ~(mask >> 1) ? 0 : ret;
|
|
}
|
|
#else
|
|
static inline u64 clocksource_delta(u64 now, u64 last, u64 mask)
|
|
{
|
|
return (now - last) & mask;
|
|
}
|
|
#endif
|
|
|
|
#endif /* _TIMEKEEPING_INTERNAL_H */
|