From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amit Virdi Date: Tue, 22 May 2012 15:44:42 +0530 Subject: [U-Boot] [PATCH V4 1/4] ARM: Define change_bit routine In-Reply-To: <4FB66E11.50003@freescale.com> References: <4FB66E11.50003@freescale.com> Message-ID: <4FBB6712.3040005@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de >> >> extern void clear_bit(int nr, volatile void * addr); >> >> -extern void change_bit(int nr, volatile void * addr); >> - >> static inline void __change_bit(int nr, volatile void *addr) >> { >> unsigned long mask = BIT_MASK(nr); >> @@ -39,6 +37,11 @@ static inline void __change_bit(int nr, volatile void *addr) >> *p ^= mask; >> } >> >> +static inline void change_bit(int nr, volatile void *addr) >> +{ >> + __change_bit(nr, addr); >> +} >> + >> static inline int __test_and_set_bit(int nr, volatile void *addr) >> { >> unsigned long mask = BIT_MASK(nr); > > While they're not used much, U-Boot does have interrupt support (at > least on powerpc -- not sure about ARM), so this should be atomic > against interrupts. > > The NAND driver should be using __change_bit() instead. > Alright, I shall be soon sending V5 that drops this patch and uses __change_bit directly. Thanks Amit Virdi