diff --git a/sys/compat/linuxkpi/common/include/linux/jiffies.h b/sys/compat/linuxkpi/common/include/linux/jiffies.h --- a/sys/compat/linuxkpi/common/include/linux/jiffies.h +++ b/sys/compat/linuxkpi/common/include/linux/jiffies.h @@ -38,7 +38,7 @@ #define jiffies ticks #define jiffies_64 ticks -#define jiffies_to_msecs(x) ((unsigned int)(((int64_t)(int)(x)) * 1000 / hz)) +#define jiffies_to_msecs(x) ((unsigned int)(((int64_t)(unsigned long)(x)) * 1000 / hz)) #define MAX_JIFFY_OFFSET ((INT_MAX >> 1) - 1) @@ -68,7 +68,7 @@ extern uint64_t lkpi_msec2hz_div; extern uint64_t lkpi_msec2hz_max; -static inline int +static inline unsigned long timespec_to_jiffies(const struct timespec *ts) { u64 result; @@ -78,10 +78,10 @@ if (result > MAX_JIFFY_OFFSET) result = MAX_JIFFY_OFFSET; - return ((int)result); + return ((unsigned long)result); } -static inline int +static inline unsigned long msecs_to_jiffies(uint64_t msec) { uint64_t result; @@ -92,10 +92,10 @@ if (result > MAX_JIFFY_OFFSET) result = MAX_JIFFY_OFFSET; - return ((int)result); + return ((unsigned long)result); } -static inline int +static inline unsigned long usecs_to_jiffies(uint64_t usec) { uint64_t result; @@ -106,7 +106,7 @@ if (result > MAX_JIFFY_OFFSET) result = MAX_JIFFY_OFFSET; - return ((int)result); + return ((unsigned long)result); } static inline uint64_t @@ -133,17 +133,17 @@ } static inline uint64_t -jiffies_to_nsecs(int j) +jiffies_to_nsecs(const unsigned long j) { - return ((1000000000ULL / hz) * (uint64_t)(unsigned int)j); + return ((1000000000ULL / hz) * (const uint64_t)j); } static inline uint64_t -jiffies_to_usecs(int j) +jiffies_to_usecs(const unsigned long j) { - return ((1000000ULL / hz) * (uint64_t)(unsigned int)j); + return ((1000000ULL / hz) * (const uint64_t)j); } static inline uint64_t @@ -153,10 +153,10 @@ return ((uint64_t)(unsigned int)ticks); } -static inline int -linux_timer_jiffies_until(int expires) +static inline unsigned long +linux_timer_jiffies_until(unsigned long expires) { - int delta = expires - jiffies; + unsigned long delta = expires - jiffies; /* guard against already expired values */ if (delta < 1) delta = 1; diff --git a/sys/compat/linuxkpi/common/include/linux/timer.h b/sys/compat/linuxkpi/common/include/linux/timer.h --- a/sys/compat/linuxkpi/common/include/linux/timer.h +++ b/sys/compat/linuxkpi/common/include/linux/timer.h @@ -42,7 +42,7 @@ void (*function_415) (struct timer_list *); }; unsigned long data; - int expires; + unsigned long expires; }; extern unsigned long linux_timer_hz_mask; @@ -76,7 +76,7 @@ callout_init(&(timer)->callout, 1); \ } while (0) -extern int mod_timer(struct timer_list *, int); +extern int mod_timer(struct timer_list *, unsigned long); extern void add_timer(struct timer_list *); extern void add_timer_on(struct timer_list *, int cpu); extern int del_timer(struct timer_list *); diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1938,7 +1938,7 @@ } int -mod_timer(struct timer_list *timer, int expires) +mod_timer(struct timer_list *timer, unsigned long expires) { int ret;