From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aneesh V Date: Tue, 14 Jun 2011 14:15:51 +0530 Subject: [U-Boot] [PATCH v3 02/10] armv7: add miscellaneous utility macros In-Reply-To: <20110608214124.849821B993A8@gemini.denx.de> References: <1299589658-30896-1-git-send-email-aneesh@ti.com> <1305202276-27784-3-git-send-email-aneesh@ti.com> <20110515184421.D7AB91491B06@gemini.denx.de> <4DD13DA3.3030505@ti.com> <4DECF8DA.9030806@ti.com> <20110606185046.BB8991736815@gemini.denx.de> <4DEDE8D9.7030306@ti.com> <20110607103923.7E1CC1B993A8@gemini.denx.de> <4DEE161B.2050402@ti.com> <20110607154028.D6540195494F@gemini.denx.de> <4DEF62A6.7060706@ti.com> <20110608214124.849821B993A8@gemini.denx.de> Message-ID: <4DF71FBF.6030408@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Wolfgang, On Thursday 09 June 2011 03:11 AM, Wolfgang Denk wrote: > Dear Aneesh V, > > In message<4DEF62A6.7060706@ti.com> you wrote: >> >> I still don't think this is the 'right' solution for my problem. I don't >> like the fact that clrsetbits_le32() introduces a lot of un-necessary >> 'volatile's. > > Well, with this argument you would also have to refuse using readl() > and writel() and all other I/O accessor macros. The only place where > volatile is used is in the __arch_get*() and __arch_put*() macros, and > ther eit is supposed to be ok. > > >> Yes, it's about the 'efficiency'. May be it doesn't count in some >> cases. But, may be it counts in some other cases. Basically, I don't >> like to sacrifice 'efficiency' unless the cost for achieving it is very > > Try and show me a single case where you see a measurable difference in > performance. > >> If you still insist, I can use clrsetbits_le32() in the interest >> of getting this to a closure. > > Please do. Thanks. As I start re-working on my patches I realize that there is no alternative to get_bit_field(). clrsetbits_le32() works as an alternative for set_bit_field() but I couldn't find anything in io.h that could replace get_bit_field(). The only option I seem to have is to mask and shift directly every time. Is that what you prefer over get_bit_field()? best regards, Aneesh