Skip to contentSkip to conversation

Fix bit test in Exynos4210 UART emulation to use & instead of &&

PATCH In review Daniel P. Berrange 3 participants 3 messages Apr 2, 2012 Arm Samsung Exynos

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix bit test in Exynos4210 UART emulation to use & instead of &&

From: "Daniel P. Berrange" <[email protected]>

* hw/exynos4210_uart.c: s/&&/&/

---
 hw/exynos4210_uart.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
hw/exynos4210_uart.c +3 -3
index 73a9c18..ccc4780 100644
@@ -246,7 +246,7 @@ static uint32_t exynos4210_uart_Tx_FIFO_trigger_level(Exynos4210UartState *s)
     uint32_t level = 0;
     uint32_t reg;
 
-    reg = (s->reg[I_(UFCON)] && UFCON_Tx_FIFO_TRIGGER_LEVEL) >>
+    reg = (s->reg[I_(UFCON)] & UFCON_Tx_FIFO_TRIGGER_LEVEL) >>
             UFCON_Tx_FIFO_TRIGGER_LEVEL_SHIFT;
 
     switch (s->channel) {
@@ -275,9 +275,9 @@ static void exynos4210_uart_update_irq(Exynos4210UartState *s)
      * The Tx interrupt is always requested if the number of data in the
      * transmit FIFO is smaller than the trigger level.
      */
-    if (s->reg[I_(UFCON)] && UFCON_FIFO_ENABLE) {
+    if (s->reg[I_(UFCON)] & UFCON_FIFO_ENABLE) {
 
-        uint32_t count = (s->reg[I_(UFSTAT)] && UFSTAT_Tx_FIFO_COUNT) >>
+        uint32_t count = (s->reg[I_(UFSTAT)] & UFSTAT_Tx_FIFO_COUNT) >>
                 UFSTAT_Tx_FIFO_COUNT_SHIFT;
 
         if (count <= exynos4210_uart_Tx_FIFO_trigger_level(s)) {
Signature · 1 line
1.7.7.6
#2 lore raw
In reply to Daniel P. Berrange

02.04.2012 17:43, Daniel P. Berrange пишет:

Quoted 24 lines

From: "Daniel P. Berrange"<[email protected]>

* hw/exynos4210_uart.c: s/&&/&/

---
  hw/exynos4210_uart.c |    6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)
hw/exynos4210_uart.c +1 -1
index 73a9c18..ccc4780 100644
@@ -246,7 +246,7 @@ static uint32_t exynos4210_uart_Tx_FIFO_trigger_level(Exynos4210UartState *s)
      uint32_t level = 0;
      uint32_t reg;
 
-    reg = (s->reg[I_(UFCON)]&&  UFCON_Tx_FIFO_TRIGGER_LEVEL)>>
+    reg = (s->reg[I_(UFCON)]&  UFCON_Tx_FIFO_TRIGGER_LEVEL)>>
              UFCON_Tx_FIFO_TRIGGER_LEVEL_SHIFT;
 
      switch (s->channel) {
@@ -275,9 +275,9 @@ static void exynos4210_uart_update_irq(Exynos4210UartState *s)
       * The Tx interrupt is always requested if the number of data in the

hw/exynos4210_uart.c static void exynos4210_uart_update_irq(Exynos4210UartState *s) · line 283

Quoted 10 lines
hw/exynos4210_uart.c +2 -2
       * transmit FIFO is smaller than the trigger level.
       */
-    if (s->reg[I_(UFCON)]&&  UFCON_FIFO_ENABLE) {
+    if (s->reg[I_(UFCON)]&  UFCON_FIFO_ENABLE) {
 
-        uint32_t count = (s->reg[I_(UFSTAT)]&&  UFSTAT_Tx_FIFO_COUNT)>>
+        uint32_t count = (s->reg[I_(UFSTAT)]&  UFSTAT_Tx_FIFO_COUNT)>>
                  UFSTAT_Tx_FIFO_COUNT_SHIFT;
 
          if (count<= exynos4210_uart_Tx_FIFO_trigger_level(s)) {

Thanks for fixing