ipmi: Update timespec usage to timespec64
As part of the internal y2038 cleanup, this patch removes timespec usage in the ipmi driver, replacing it timespec64 Cc: openipmi-developer@lists.sourceforge.net Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Corey Minyard <minyard@mvista.com>
This commit is contained in:
parent
f93aae9f8d
commit
48862ea2ce
@ -324,10 +324,10 @@ static void cleanup_ipmi_si(void);
|
|||||||
#ifdef DEBUG_TIMING
|
#ifdef DEBUG_TIMING
|
||||||
void debug_timestamp(char *msg)
|
void debug_timestamp(char *msg)
|
||||||
{
|
{
|
||||||
struct timeval t;
|
struct timespec64 t;
|
||||||
|
|
||||||
do_gettimeofday(&t);
|
getnstimeofday64(&t);
|
||||||
pr_debug("**%s: %d.%9.9d\n", msg, t.tv_sec, t.tv_usec);
|
pr_debug("**%s: %lld.%9.9ld\n", msg, (long long) t.tv_sec, t.tv_nsec);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define debug_timestamp(x)
|
#define debug_timestamp(x)
|
||||||
@ -985,18 +985,18 @@ static void set_run_to_completion(void *send_info, bool i_run_to_completion)
|
|||||||
* we are spinning in kipmid looking for something and not delaying
|
* we are spinning in kipmid looking for something and not delaying
|
||||||
* between checks
|
* between checks
|
||||||
*/
|
*/
|
||||||
static inline void ipmi_si_set_not_busy(struct timespec *ts)
|
static inline void ipmi_si_set_not_busy(struct timespec64 *ts)
|
||||||
{
|
{
|
||||||
ts->tv_nsec = -1;
|
ts->tv_nsec = -1;
|
||||||
}
|
}
|
||||||
static inline int ipmi_si_is_busy(struct timespec *ts)
|
static inline int ipmi_si_is_busy(struct timespec64 *ts)
|
||||||
{
|
{
|
||||||
return ts->tv_nsec != -1;
|
return ts->tv_nsec != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int ipmi_thread_busy_wait(enum si_sm_result smi_result,
|
static inline int ipmi_thread_busy_wait(enum si_sm_result smi_result,
|
||||||
const struct smi_info *smi_info,
|
const struct smi_info *smi_info,
|
||||||
struct timespec *busy_until)
|
struct timespec64 *busy_until)
|
||||||
{
|
{
|
||||||
unsigned int max_busy_us = 0;
|
unsigned int max_busy_us = 0;
|
||||||
|
|
||||||
@ -1005,12 +1005,13 @@ static inline int ipmi_thread_busy_wait(enum si_sm_result smi_result,
|
|||||||
if (max_busy_us == 0 || smi_result != SI_SM_CALL_WITH_DELAY)
|
if (max_busy_us == 0 || smi_result != SI_SM_CALL_WITH_DELAY)
|
||||||
ipmi_si_set_not_busy(busy_until);
|
ipmi_si_set_not_busy(busy_until);
|
||||||
else if (!ipmi_si_is_busy(busy_until)) {
|
else if (!ipmi_si_is_busy(busy_until)) {
|
||||||
getnstimeofday(busy_until);
|
getnstimeofday64(busy_until);
|
||||||
timespec_add_ns(busy_until, max_busy_us*NSEC_PER_USEC);
|
timespec64_add_ns(busy_until, max_busy_us*NSEC_PER_USEC);
|
||||||
} else {
|
} else {
|
||||||
struct timespec now;
|
struct timespec64 now;
|
||||||
getnstimeofday(&now);
|
|
||||||
if (unlikely(timespec_compare(&now, busy_until) > 0)) {
|
getnstimeofday64(&now);
|
||||||
|
if (unlikely(timespec64_compare(&now, busy_until) > 0)) {
|
||||||
ipmi_si_set_not_busy(busy_until);
|
ipmi_si_set_not_busy(busy_until);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1033,7 +1034,7 @@ static int ipmi_thread(void *data)
|
|||||||
struct smi_info *smi_info = data;
|
struct smi_info *smi_info = data;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
enum si_sm_result smi_result;
|
enum si_sm_result smi_result;
|
||||||
struct timespec busy_until;
|
struct timespec64 busy_until;
|
||||||
|
|
||||||
ipmi_si_set_not_busy(&busy_until);
|
ipmi_si_set_not_busy(&busy_until);
|
||||||
set_user_nice(current, MAX_NICE);
|
set_user_nice(current, MAX_NICE);
|
||||||
|
Loading…
Reference in New Issue
Block a user