Date: Sun, 01 Feb 2009 12:57:12 -0700 (MST) From: "M. Warner Losh" <imp@bsdimp.com> To: thompsa@freebsd.org Cc: freebsd-usb@freebsd.org Subject: Re: USB2 patches Message-ID: <20090201.125712.-1002120178.imp@bsdimp.com> In-Reply-To: <20090201191851.GE32503@citylink.fud.org.nz> References: <20090201190820.GB32503@citylink.fud.org.nz> <200902012014.32190.hselasky@c2i.net> <20090201191851.GE32503@citylink.fud.org.nz>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20090201191851.GE32503@citylink.fud.org.nz> Andrew Thompson <thompsa@freebsd.org> writes: : > > xxx_set_channel() : > > { : > > ieee80211_channel c = wlan->curchan; : > > : > > hw_reg = array1[c]; : > > write USB register; : > > hw_reg = array2[c]; : > > write USB register; : > > } : > : > And don't forget "volatile" ... : : I dont understand this. c is a pointer to a valid net80211 channel which : will never disappear. "volatile" would be a bug here. There's no reason to use it at all, since wlan->curchan doesn't match what ANSI-C says a volatile is for. In addition, since it is only loaded once, there wouldn't be a need for it even if it did meet the definition. You *CANNOT* rely on 'volatile' fixing locking issues. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090201.125712.-1002120178.imp>