Subject: Re: PPS diffs, round #3
To: Jonathan Stone <jonathan@dsg.stanford.edu>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 04/21/1998 21:56:27
On Tue, 21 Apr 1998 21:45:20 -0700 
 Jason Thorpe <thorpej@nas.nasa.gov> wrote:

 >  > + 			if (sc->sc_dopps && ISSET(delta, MSR_DCD) &&
 >  > + 			    (delta & MSR_DCD) == sc->sc_dcd_edgemask) {
 >  > + 				struct timeval tv;
 >  > + 
 >  > + 				microtime(&tv);
 >  > + 				sc->sc_dcd_timestamp = tv;
 >  > + #ifdef PPS_SYNC
 >  > + 				hardpps(&tv, tv.usec);
 >  > + #endif
 >  > + 			}

"Oh yah..."

Why bother with the automatic?  Why not just:

					microtime(&sc->sc_dcd_timestamp);
#ifdef PPS_SYNC
					hardpps(&sc->sc_dcd_timestamp,
					    sc->sc_dcd_timestamp.tv_usec);
#endif

(The argument to hardpps() should certainly be a `const struct timeval *')

Anyhow, that eliminates a copy.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-5                                       Work: +1 650 604 0935
Moffett Field, CA 94035                             Pager: +1 415 428 6939