Commit f51c1494 authored by Sridhar Samudrala's avatar Sridhar Samudrala

[SCTP] Convert tv_add from static inline to a macro to fix an obscure

assembler problem with parisc64.
parent 633dba2b
...@@ -495,22 +495,19 @@ for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \ ...@@ -495,22 +495,19 @@ for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \
#define tv_lt(s, t) \ #define tv_lt(s, t) \
(s.tv_sec < t.tv_sec || (s.tv_sec == t.tv_sec && s.tv_usec < t.tv_usec)) (s.tv_sec < t.tv_sec || (s.tv_sec == t.tv_sec && s.tv_usec < t.tv_usec))
/* Stolen from net/profile.h. Using it from there is more grief than /* Add tv1 to tv2. */
* it is worth. #define TIMEVAL_ADD(tv1, tv2) \
*/ ({ \
static inline void tv_add(const struct timeval *entered, struct timeval *leaved) suseconds_t usecs = (tv2).tv_usec + (tv1).tv_usec; \
{ time_t secs = (tv2).tv_sec + (tv1).tv_sec; \
time_t usecs = leaved->tv_usec + entered->tv_usec; \
time_t secs = leaved->tv_sec + entered->tv_sec; if (usecs >= 1000000) { \
usecs -= 1000000; \
if (usecs >= 1000000) { secs++; \
usecs -= 1000000; } \
secs++; (tv2).tv_sec = secs; \
} (tv2).tv_usec = usecs; \
leaved->tv_sec = secs; })
leaved->tv_usec = usecs;
}
/* External references. */ /* External references. */
......
...@@ -1288,7 +1288,7 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, ...@@ -1288,7 +1288,7 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
/* Set an expiration time for the cookie. */ /* Set an expiration time for the cookie. */
do_gettimeofday(&cookie->c.expiration); do_gettimeofday(&cookie->c.expiration);
tv_add(&asoc->cookie_life, &cookie->c.expiration); TIMEVAL_ADD(asoc->cookie_life, cookie->c.expiration);
/* Copy the peer's init packet. */ /* Copy the peer's init packet. */
memcpy(&cookie->c.peer_init[0], init_chunk->chunk_hdr, memcpy(&cookie->c.peer_init[0], init_chunk->chunk_hdr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment