Skip to contentSkip to conversation

MIPS: ralink: mt7621: use bitwise NOT instead of logical

PATCH Applied Ilya Lipnitskiy 3 participants 3 messages Mar 1, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: ralink: mt7621: use bitwise NOT instead of logical

It was the intention to reverse the bits, not make them all zero by using logical NOT operator.

Fixes cc19db8b312a ("MIPS: ralink: mt7621: do memory detection on KSEG1")
---
 arch/mips/ralink/mt7621.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/ralink/mt7621.c +1 -1
index 12c8808e0dea..fb0565bc34fd 100644
@@ -69,7 +69,7 @@ static bool __init mt7621_addr_wraparound_test(phys_addr_t size)
 	__raw_writel(MT7621_MEM_TEST_PATTERN, dm);
 	if (__raw_readl(dm) != __raw_readl(dm + size))
 		return false;
-	__raw_writel(!MT7621_MEM_TEST_PATTERN, dm);
+	__raw_writel(~MT7621_MEM_TEST_PATTERN, dm);
 	return __raw_readl(dm) == __raw_readl(dm + size);
 }
 
Signature · 1 line
2.35.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi Ilya,

Quoted 10 lines · Ilya Lipnitskiy

It was the intention to reverse the bits, not make them all zero by using logical NOT operator.

Fixes cc19db8b312a ("MIPS: ralink: mt7621: do memory detection on KSEG1")
---
 arch/mips/ralink/mt7621.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks,
Sergio Paracuellos

maintainer Applied
#2 lore raw
In reply to Ilya Lipnitskiy
Quoted 25 lines · Ilya Lipnitskiy

It was the intention to reverse the bits, not make them all zero by using logical NOT operator.

Fixes cc19db8b312a ("MIPS: ralink: mt7621: do memory detection on KSEG1")
---
 arch/mips/ralink/mt7621.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/ralink/mt7621.c +1 -1
index 12c8808e0dea..fb0565bc34fd 100644
@@ -69,7 +69,7 @@ static bool __init mt7621_addr_wraparound_test(phys_addr_t size)
 	__raw_writel(MT7621_MEM_TEST_PATTERN, dm);
 	if (__raw_readl(dm) != __raw_readl(dm + size))
 		return false;
-	__raw_writel(!MT7621_MEM_TEST_PATTERN, dm);
+	__raw_writel(~MT7621_MEM_TEST_PATTERN, dm);
 	return __raw_readl(dm) == __raw_readl(dm + size);
 }
 
Signature · 1 line
2.35.1

applied to mips-fixes

Thomas.

Signature · 7 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek