diff mbox

[U-Boot] ARM: Define change_bit routine

Message ID 1330335230-31379-1-git-send-email-amit.virdi@st.com
State Rejected
Delegated to: Albert ARIBAUD
Headers show

Commit Message

Amit Virdi Feb. 27, 2012, 9:33 a.m. UTC
From: Vipin KUMAR <vipin.kumar@st.com>

change_bit routine is left implementation dependent until now.
This routine is now defined for arm platforms in asm-arm/bitops.h

The Flexible Static memory controller driver, placed in
mtd/nand/fsmc_nand.c needs this routine. FSMC is a memory controller
peripheral from ST. The new driver implements the NAND interface part
of the peripheral.

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
---
 arch/arm/include/asm/bitops.h |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

Comments

Albert ARIBAUD Feb. 28, 2012, 11:19 p.m. UTC | #1
Hi Amit,

Le 27/02/2012 10:33, Amit Virdi a écrit :
> From: Vipin KUMAR<vipin.kumar@st.com>
>
> change_bit routine is left implementation dependent until now.
> This routine is now defined for arm platforms in asm-arm/bitops.h
>
> The Flexible Static memory controller driver, placed in
> mtd/nand/fsmc_nand.c needs this routine. FSMC is a memory controller
> peripheral from ST. The new driver implements the NAND interface part
> of the peripheral.
>
> Signed-off-by: Vipin Kumar<vipin.kumar@st.com>
> Signed-off-by: Amit Virdi<amit.virdi@st.com>
> ---
>   arch/arm/include/asm/bitops.h |   11 +++++++++--
>   1 files changed, 9 insertions(+), 2 deletions(-)

NAK as this is submitted as an isolated patch to dead code.

Provide it as a member of a patchset where some later patch uses it -- 
and justify that you really need this function.

Amicalement,
Amit Virdi Feb. 29, 2012, 5:21 a.m. UTC | #2
Hello Albert,

On 2/29/2012 4:49 AM, Albert ARIBAUD wrote:
> Hi Amit,
>
> Le 27/02/2012 10:33, Amit Virdi a écrit :
>> From: Vipin KUMAR<vipin.kumar@st.com>
>>
>> change_bit routine is left implementation dependent until now.
>> This routine is now defined for arm platforms in asm-arm/bitops.h
>>
>> The Flexible Static memory controller driver, placed in
>> mtd/nand/fsmc_nand.c needs this routine. FSMC is a memory controller
>> peripheral from ST. The new driver implements the NAND interface part
>> of the peripheral.
>>
>> Signed-off-by: Vipin Kumar<vipin.kumar@st.com>
>> Signed-off-by: Amit Virdi<amit.virdi@st.com>
>> ---
>>    arch/arm/include/asm/bitops.h |   11 +++++++++--
>>    1 files changed, 9 insertions(+), 2 deletions(-)
>
> NAK as this is submitted as an isolated patch to dead code.
>
> Provide it as a member of a patchset where some later patch uses it --
> and justify that you really need this function.
>

Ok. change_bit routine is used by FSMC driver. I should be re-sending it 
as a part of FSMC driver patchset.

Regards
Amit Virdi
diff mbox

Patch

diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index 879e20e..8ce1405 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -29,8 +29,6 @@  extern void set_bit(int nr, volatile void * addr);
 
 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,15 @@  static inline void __change_bit(int nr, volatile void *addr)
 	*p ^= mask;
 }
 
+static inline void change_bit(int nr, volatile void *addr)
+{
+	unsigned long flags;
+
+	local_irq_save(flags);
+	__change_bit(nr, addr);
+	local_irq_restore(flags);
+}
+
 static inline int __test_and_set_bit(int nr, volatile void *addr)
 {
 	unsigned long mask = BIT_MASK(nr);