diff mbox series

[3/6] sm501: Use BIT(x) macro to shorten constant

Message ID 6c63555cc4023d05e550d513112f472a2020a117.1589981990.git.balaton@eik.bme.hu
State New
Headers show
Series Misc display/sm501 clean ups and fixes | expand

Commit Message

BALATON Zoltan May 20, 2020, 1:39 p.m. UTC
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
 hw/display/sm501.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Philippe Mathieu-Daudé May 21, 2020, 2:10 p.m. UTC | #1
On 5/20/20 3:39 PM, BALATON Zoltan wrote:
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
>   hw/display/sm501.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/display/sm501.c b/hw/display/sm501.c
> index f42d05e1e4..97660090bb 100644
> --- a/hw/display/sm501.c
> +++ b/hw/display/sm501.c
> @@ -701,7 +701,7 @@ static void sm501_2d_operation(SM501State *s)
>   {
>       /* obtain operation parameters */
>       int cmd = (s->twoD_control >> 16) & 0x1F;
> -    int rtl = s->twoD_control & 0x8000000;
> +    int rtl = s->twoD_control & BIT(27);
>       int src_x = (s->twoD_source >> 16) & 0x01FFF;
>       int src_y = s->twoD_source & 0xFFFF;
>       int dst_x = (s->twoD_destination >> 16) & 0x01FFF;
> @@ -751,8 +751,7 @@ static void sm501_2d_operation(SM501State *s)
>           }
>       }
>   
> -    if ((s->twoD_source_base & 0x08000000) ||
> -        (s->twoD_destination_base & 0x08000000)) {
> +    if (s->twoD_source_base & BIT(27) || s->twoD_destination_base & BIT(27)) {
>           qemu_log_mask(LOG_UNIMP, "sm501: only local memory is supported.\n");
>           return;
>       }
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
diff mbox series

Patch

diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index f42d05e1e4..97660090bb 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -701,7 +701,7 @@  static void sm501_2d_operation(SM501State *s)
 {
     /* obtain operation parameters */
     int cmd = (s->twoD_control >> 16) & 0x1F;
-    int rtl = s->twoD_control & 0x8000000;
+    int rtl = s->twoD_control & BIT(27);
     int src_x = (s->twoD_source >> 16) & 0x01FFF;
     int src_y = s->twoD_source & 0xFFFF;
     int dst_x = (s->twoD_destination >> 16) & 0x01FFF;
@@ -751,8 +751,7 @@  static void sm501_2d_operation(SM501State *s)
         }
     }
 
-    if ((s->twoD_source_base & 0x08000000) ||
-        (s->twoD_destination_base & 0x08000000)) {
+    if (s->twoD_source_base & BIT(27) || s->twoD_destination_base & BIT(27)) {
         qemu_log_mask(LOG_UNIMP, "sm501: only local memory is supported.\n");
         return;
     }