diff options
| author | Sridhar Samudrala <sri@us.ibm.com> | 2003-09-28 20:23:40 -0700 |
|---|---|---|
| committer | Sridhar Samudrala <sri@us.ibm.com> | 2003-09-28 20:23:40 -0700 |
| commit | f51c1494a14208d976d6bf3eef9fb83ee166ac97 (patch) | |
| tree | ed5f3a36a088e7b055eb1fd8097c05a9402236e9 /include/net | |
| parent | 633dba2b1debe2b0660f6bd03a92bd90a7dbd575 (diff) | |
[SCTP] Convert tv_add from static inline to a macro to fix an obscure
assembler problem with parisc64.
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/sctp/sctp.h | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 3f21f1985699..d17452eaa36d 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -495,22 +495,19 @@ for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \ #define tv_lt(s, t) \ (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 - * it is worth. - */ -static inline void tv_add(const struct timeval *entered, struct timeval *leaved) -{ - time_t usecs = leaved->tv_usec + entered->tv_usec; - time_t secs = leaved->tv_sec + entered->tv_sec; - - if (usecs >= 1000000) { - usecs -= 1000000; - secs++; - } - leaved->tv_sec = secs; - leaved->tv_usec = usecs; -} - +/* Add tv1 to tv2. */ +#define TIMEVAL_ADD(tv1, tv2) \ +({ \ + suseconds_t usecs = (tv2).tv_usec + (tv1).tv_usec; \ + time_t secs = (tv2).tv_sec + (tv1).tv_sec; \ +\ + if (usecs >= 1000000) { \ + usecs -= 1000000; \ + secs++; \ + } \ + (tv2).tv_sec = secs; \ + (tv2).tv_usec = usecs; \ +}) /* External references. */ |
