YongHyeon PYUN <pyu...@gmail.com> wrote:
> On Wed, Oct 12, 2011 at 10:07:02AM -0400, Karim wrote:
> > ... why are we ORing the same call twice isn't the same thing
> > as calling it once:
> > 
> > bmsr = PHY_READ(sc, E1000_SR) | PHY_READ(sc, E1000_SR);
>
> The E1000_SR_LINK_STATUS bit is latched low so it should be read
> twice.

It might not be a bad idea to check the generated code to be sure
that the read _is_ being done twice.  An optimizer might well come
to the same conclusion as Karim, and discard the "redundant" second
instance (unless there's a "volatile" declaration somewhere in the
expansion of PHY_READ, to explicitly indicate that it has side
effects).
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to