diff mbox

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

Message ID 1333374233-1238-1-git-send-email-berrange@redhat.com
State New
Headers show

Commit Message

Daniel P. Berrangé April 2, 2012, 1:43 p.m. UTC
From: "Daniel P. Berrange" <berrange@redhat.com>

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 hw/exynos4210_uart.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Comments

Peter Maydell April 2, 2012, 1:47 p.m. UTC | #1
On 2 April 2012 14:43, Daniel P. Berrange <berrange@redhat.com> wrote:
> From: "Daniel P. Berrange" <berrange@redhat.com>
>
> * hw/exynos4210_uart.c: s/&&/&/
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
and put into arm-devs.next. Thanks.

-- PMM
Maksim E. Kozlov April 2, 2012, 4:04 p.m. UTC | #2
02.04.2012 17:43, Daniel P. Berrange пишет:
> From: "Daniel P. Berrange"<berrange@redhat.com>
>
> * hw/exynos4210_uart.c: s/&&/&/
>
> Signed-off-by: Daniel P. Berrange<berrange@redhat.com>
> ---
>   hw/exynos4210_uart.c |    6 +++---
>   1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/exynos4210_uart.c b/hw/exynos4210_uart.c
> index 73a9c18..ccc4780 100644
> --- a/hw/exynos4210_uart.c
> +++ b/hw/exynos4210_uart.c
> @@ -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)) {
Thanks for fixing
diff mbox

Patch

diff --git a/hw/exynos4210_uart.c b/hw/exynos4210_uart.c
index 73a9c18..ccc4780 100644
--- a/hw/exynos4210_uart.c
+++ b/hw/exynos4210_uart.c
@@ -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)) {