[U-Boot] [PATCH 01/28] net: Remove volatile from all of net except the eth driver interface
Mike Frysinger
vapier at gentoo.org
Fri Feb 3 12:39:06 CET 2012
On Tuesday 24 January 2012 01:27:53 Joe Hershberger wrote:
> On Tue, Jan 24, 2012 at 12:09 AM, Simon Glass wrote:
> > On Fri, Jan 20, 2012 at 12:15 PM, Joe Hershberger wrote:
> >> On Fri, Jan 20, 2012 at 10:22 AM, Simon Glass wrote:
> >>> On Thu, Jan 19, 2012 at 4:53 PM, Joe Hershberger wrote:
> >>>> @@ -1454,9 +1454,9 @@ NetReceive(volatile uchar *inpkt, int len)
> >>>> <snip>
> >>>> - NetRxPacket = inpkt;
> >>>> + NetRxPacket = (uchar *)inpkt;
> >>
> >> All the assignments that need a non-volatile pointer now use
> >> NetRxPacket instead of inpkt, since it is already assigned and and the
> >> same type minus volatile.
> >
> > Yes, I am only sensitive to this because it is a global and there is
> > enough use of globals in the net code already.
>
> I chose to not add a local variable to hold the non-volatile pointer
> since there was already a global. Since u-boot is single threaded,
> this should not be a problem and could be easily changed later when
> the Ethernet driver interface is cleaned up.
funcs given a ptr should operate on that ptr. relying on global variables is
a step backwards imo.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120203/7f365f18/attachment.pgp>
More information about the U-Boot
mailing list