Patchwork hw/pl110: Fix spelling of 'palette'

login
register
mail settings
Submitter Peter Maydell
Date Aug. 26, 2012, 9:30 p.m.
Message ID <1346016621-20415-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/180089/
State New
Headers show

Comments

Peter Maydell - Aug. 26, 2012, 9:30 p.m.
Fix the spelling of 'palette' used in various local variables
and structure members.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/pl110.c          | 28 ++++++++++++++--------------
 hw/pl110_template.h | 22 +++++++++++-----------
 2 files changed, 25 insertions(+), 25 deletions(-)
Stefan Weil - Aug. 27, 2012, 5:19 a.m.
Am 26.08.2012 23:30, schrieb Peter Maydell:
> Fix the spelling of 'palette' used in various local variables
> and structure members.

... and in a comment. See below.

>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   hw/pl110.c          | 28 ++++++++++++++--------------
>   hw/pl110_template.h | 22 +++++++++++-----------
>   2 files changed, 25 insertions(+), 25 deletions(-)
>
> diff --git a/hw/pl110.c b/hw/pl110.c
> index f94608c..11037d1 100644
> --- a/hw/pl110.c
> +++ b/hw/pl110.c
> @@ -55,8 +55,8 @@ typedef struct {
>       enum pl110_bppmode bpp;
>       int invalidate;
>       uint32_t mux_ctrl;
> -    uint32_t pallette[256];
> -    uint32_t raw_pallette[128];
> +    uint32_t palette[256];
> +    uint32_t raw_palette[128];
>       qemu_irq irq;
>   } pl110_state;
>   
> @@ -79,8 +79,8 @@ static const VMStateDescription vmstate_pl110 = {
>           VMSTATE_INT32(rows, pl110_state),
>           VMSTATE_UINT32(bpp, pl110_state),
>           VMSTATE_INT32(invalidate, pl110_state),
> -        VMSTATE_UINT32_ARRAY(pallette, pl110_state, 256),
> -        VMSTATE_UINT32_ARRAY(raw_pallette, pl110_state, 128),
> +        VMSTATE_UINT32_ARRAY(palette, pl110_state, 256),
> +        VMSTATE_UINT32_ARRAY(raw_palette, pl110_state, 128),
>           VMSTATE_UINT32_V(mux_ctrl, pl110_state, 2),
>           VMSTATE_END_OF_LIST()
>       }
> @@ -236,7 +236,7 @@ static void pl110_update_display(void *opaque)
>                                  s->upbase, s->cols, s->rows,
>                                  src_width, dest_width, 0,
>                                  s->invalidate,
> -                               fn, s->pallette,
> +                               fn, s->palette,
>                                  &first, &last);
>       if (first >= 0) {
>           dpy_update(s->ds, 0, first, s->cols, last - first + 1);
> @@ -253,13 +253,13 @@ static void pl110_invalidate_display(void * opaque)
>       }
>   }
>   
> -static void pl110_update_pallette(pl110_state *s, int n)
> +static void pl110_update_palette(pl110_state *s, int n)
>   {
>       int i;
>       uint32_t raw;
>       unsigned int r, g, b;
>   
> -    raw = s->raw_pallette[n];
> +    raw = s->raw_palette[n];
>       n <<= 1;
>       for (i = 0; i < 2; i++) {
>           r = (raw & 0x1f) << 3;
> @@ -271,17 +271,17 @@ static void pl110_update_pallette(pl110_state *s, int n)
>           raw >>= 6;
>           switch (ds_get_bits_per_pixel(s->ds)) {
>           case 8:
> -            s->pallette[n] = rgb_to_pixel8(r, g, b);
> +            s->palette[n] = rgb_to_pixel8(r, g, b);
>               break;
>           case 15:
> -            s->pallette[n] = rgb_to_pixel15(r, g, b);
> +            s->palette[n] = rgb_to_pixel15(r, g, b);
>               break;
>           case 16:
> -            s->pallette[n] = rgb_to_pixel16(r, g, b);
> +            s->palette[n] = rgb_to_pixel16(r, g, b);
>               break;
>           case 24:
>           case 32:
> -            s->pallette[n] = rgb_to_pixel32(r, g, b);
> +            s->palette[n] = rgb_to_pixel32(r, g, b);
>               break;
>           }
>           n++;
> @@ -314,7 +314,7 @@ static uint64_t pl110_read(void *opaque, target_phys_addr_t offset,
>           return idregs[s->version][(offset - 0xfe0) >> 2];
>       }
>       if (offset >= 0x200 && offset < 0x400) {
> -        return s->raw_pallette[(offset - 0x200) >> 2];
> +        return s->raw_palette[(offset - 0x200) >> 2];
>       }
>       switch (offset >> 2) {
>       case 0: /* LCDTiming0 */
> @@ -366,8 +366,8 @@ static void pl110_write(void *opaque, target_phys_addr_t offset,
>       if (offset >= 0x200 && offset < 0x400) {
>           /* Pallette.  */

What about this one? For V2 of your patch, you may add a

Reviewed-by: Stefan Weil <sw@weilnetz.de>


>           n = (offset - 0x200) >> 2;
> -        s->raw_pallette[(offset - 0x200) >> 2] = val;
> -        pl110_update_pallette(s, n);
> +        s->raw_palette[(offset - 0x200) >> 2] = val;
> +        pl110_update_palette(s, n);
>           return;
>       }
>       switch (offset >> 2) {
> diff --git a/hw/pl110_template.h b/hw/pl110_template.h
> index 1dce32a..e738e4a 100644
> --- a/hw/pl110_template.h
> +++ b/hw/pl110_template.h
> @@ -129,14 +129,14 @@ static drawfn glue(pl110_draw_fn_,BITS)[48] =
>   
>   static void glue(pl110_draw_line1_,NAME)(void *opaque, uint8_t *d, const uint8_t *src, int width, int deststep)
>   {
> -    uint32_t *pallette = opaque;
> +    uint32_t *palette = opaque;
>       uint32_t data;
>       while (width > 0) {
>           data = *(uint32_t *)src;
>   #ifdef SWAP_PIXELS
> -#define FN(x, y) COPY_PIXEL(d, pallette[(data >> (y + 7 - (x))) & 1]);
> +#define FN(x, y) COPY_PIXEL(d, palette[(data >> (y + 7 - (x))) & 1]);
>   #else
> -#define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x) + y)) & 1]);
> +#define FN(x, y) COPY_PIXEL(d, palette[(data >> ((x) + y)) & 1]);
>   #endif
>   #ifdef SWAP_WORDS
>           FN_8(24)
> @@ -157,14 +157,14 @@ static void glue(pl110_draw_line1_,NAME)(void *opaque, uint8_t *d, const uint8_t
>   
>   static void glue(pl110_draw_line2_,NAME)(void *opaque, uint8_t *d, const uint8_t *src, int width, int deststep)
>   {
> -    uint32_t *pallette = opaque;
> +    uint32_t *palette = opaque;
>       uint32_t data;
>       while (width > 0) {
>           data = *(uint32_t *)src;
>   #ifdef SWAP_PIXELS
> -#define FN(x, y) COPY_PIXEL(d, pallette[(data >> (y + 6 - (x)*2)) & 3]);
> +#define FN(x, y) COPY_PIXEL(d, palette[(data >> (y + 6 - (x)*2)) & 3]);
>   #else
> -#define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x)*2 + y)) & 3]);
> +#define FN(x, y) COPY_PIXEL(d, palette[(data >> ((x)*2 + y)) & 3]);
>   #endif
>   #ifdef SWAP_WORDS
>           FN_4(0, 24)
> @@ -185,14 +185,14 @@ static void glue(pl110_draw_line2_,NAME)(void *opaque, uint8_t *d, const uint8_t
>   
>   static void glue(pl110_draw_line4_,NAME)(void *opaque, uint8_t *d, const uint8_t *src, int width, int deststep)
>   {
> -    uint32_t *pallette = opaque;
> +    uint32_t *palette = opaque;
>       uint32_t data;
>       while (width > 0) {
>           data = *(uint32_t *)src;
>   #ifdef SWAP_PIXELS
> -#define FN(x, y) COPY_PIXEL(d, pallette[(data >> (y + 4 - (x)*4)) & 0xf]);
> +#define FN(x, y) COPY_PIXEL(d, palette[(data >> (y + 4 - (x)*4)) & 0xf]);
>   #else
> -#define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x)*4 + y)) & 0xf]);
> +#define FN(x, y) COPY_PIXEL(d, palette[(data >> ((x)*4 + y)) & 0xf]);
>   #endif
>   #ifdef SWAP_WORDS
>           FN_2(0, 24)
> @@ -213,11 +213,11 @@ static void glue(pl110_draw_line4_,NAME)(void *opaque, uint8_t *d, const uint8_t
>   
>   static void glue(pl110_draw_line8_,NAME)(void *opaque, uint8_t *d, const uint8_t *src, int width, int deststep)
>   {
> -    uint32_t *pallette = opaque;
> +    uint32_t *palette = opaque;
>       uint32_t data;
>       while (width > 0) {
>           data = *(uint32_t *)src;
> -#define FN(x) COPY_PIXEL(d, pallette[(data >> (x)) & 0xff]);
> +#define FN(x) COPY_PIXEL(d, palette[(data >> (x)) & 0xff]);
>   #ifdef SWAP_WORDS
>           FN(24)
>           FN(16)
Peter Maydell - Aug. 27, 2012, 9:18 a.m.
On 27 August 2012 06:19, Stefan Weil <sw@weilnetz.de> wrote:
> Am 26.08.2012 23:30, schrieb Peter Maydell:
>
>> Fix the spelling of 'palette' used in various local variables
>> and structure members.
>>       if (offset >= 0x200 && offset < 0x400) {
>>           /* Pallette.  */
>
>
> What about this one? For V2 of your patch, you may add a
>
> Reviewed-by: Stefan Weil <sw@weilnetz.de>

Thanks; as you may have guessed I didn't do a case-insensitive
search...

-- PMM

Patch

diff --git a/hw/pl110.c b/hw/pl110.c
index f94608c..11037d1 100644
--- a/hw/pl110.c
+++ b/hw/pl110.c
@@ -55,8 +55,8 @@  typedef struct {
     enum pl110_bppmode bpp;
     int invalidate;
     uint32_t mux_ctrl;
-    uint32_t pallette[256];
-    uint32_t raw_pallette[128];
+    uint32_t palette[256];
+    uint32_t raw_palette[128];
     qemu_irq irq;
 } pl110_state;
 
@@ -79,8 +79,8 @@  static const VMStateDescription vmstate_pl110 = {
         VMSTATE_INT32(rows, pl110_state),
         VMSTATE_UINT32(bpp, pl110_state),
         VMSTATE_INT32(invalidate, pl110_state),
-        VMSTATE_UINT32_ARRAY(pallette, pl110_state, 256),
-        VMSTATE_UINT32_ARRAY(raw_pallette, pl110_state, 128),
+        VMSTATE_UINT32_ARRAY(palette, pl110_state, 256),
+        VMSTATE_UINT32_ARRAY(raw_palette, pl110_state, 128),
         VMSTATE_UINT32_V(mux_ctrl, pl110_state, 2),
         VMSTATE_END_OF_LIST()
     }
@@ -236,7 +236,7 @@  static void pl110_update_display(void *opaque)
                                s->upbase, s->cols, s->rows,
                                src_width, dest_width, 0,
                                s->invalidate,
-                               fn, s->pallette,
+                               fn, s->palette,
                                &first, &last);
     if (first >= 0) {
         dpy_update(s->ds, 0, first, s->cols, last - first + 1);
@@ -253,13 +253,13 @@  static void pl110_invalidate_display(void * opaque)
     }
 }
 
-static void pl110_update_pallette(pl110_state *s, int n)
+static void pl110_update_palette(pl110_state *s, int n)
 {
     int i;
     uint32_t raw;
     unsigned int r, g, b;
 
-    raw = s->raw_pallette[n];
+    raw = s->raw_palette[n];
     n <<= 1;
     for (i = 0; i < 2; i++) {
         r = (raw & 0x1f) << 3;
@@ -271,17 +271,17 @@  static void pl110_update_pallette(pl110_state *s, int n)
         raw >>= 6;
         switch (ds_get_bits_per_pixel(s->ds)) {
         case 8:
-            s->pallette[n] = rgb_to_pixel8(r, g, b);
+            s->palette[n] = rgb_to_pixel8(r, g, b);
             break;
         case 15:
-            s->pallette[n] = rgb_to_pixel15(r, g, b);
+            s->palette[n] = rgb_to_pixel15(r, g, b);
             break;
         case 16:
-            s->pallette[n] = rgb_to_pixel16(r, g, b);
+            s->palette[n] = rgb_to_pixel16(r, g, b);
             break;
         case 24:
         case 32:
-            s->pallette[n] = rgb_to_pixel32(r, g, b);
+            s->palette[n] = rgb_to_pixel32(r, g, b);
             break;
         }
         n++;
@@ -314,7 +314,7 @@  static uint64_t pl110_read(void *opaque, target_phys_addr_t offset,
         return idregs[s->version][(offset - 0xfe0) >> 2];
     }
     if (offset >= 0x200 && offset < 0x400) {
-        return s->raw_pallette[(offset - 0x200) >> 2];
+        return s->raw_palette[(offset - 0x200) >> 2];
     }
     switch (offset >> 2) {
     case 0: /* LCDTiming0 */
@@ -366,8 +366,8 @@  static void pl110_write(void *opaque, target_phys_addr_t offset,
     if (offset >= 0x200 && offset < 0x400) {
         /* Pallette.  */
         n = (offset - 0x200) >> 2;
-        s->raw_pallette[(offset - 0x200) >> 2] = val;
-        pl110_update_pallette(s, n);
+        s->raw_palette[(offset - 0x200) >> 2] = val;
+        pl110_update_palette(s, n);
         return;
     }
     switch (offset >> 2) {
diff --git a/hw/pl110_template.h b/hw/pl110_template.h
index 1dce32a..e738e4a 100644
--- a/hw/pl110_template.h
+++ b/hw/pl110_template.h
@@ -129,14 +129,14 @@  static drawfn glue(pl110_draw_fn_,BITS)[48] =
 
 static void glue(pl110_draw_line1_,NAME)(void *opaque, uint8_t *d, const uint8_t *src, int width, int deststep)
 {
-    uint32_t *pallette = opaque;
+    uint32_t *palette = opaque;
     uint32_t data;
     while (width > 0) {
         data = *(uint32_t *)src;
 #ifdef SWAP_PIXELS
-#define FN(x, y) COPY_PIXEL(d, pallette[(data >> (y + 7 - (x))) & 1]);
+#define FN(x, y) COPY_PIXEL(d, palette[(data >> (y + 7 - (x))) & 1]);
 #else
-#define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x) + y)) & 1]);
+#define FN(x, y) COPY_PIXEL(d, palette[(data >> ((x) + y)) & 1]);
 #endif
 #ifdef SWAP_WORDS
         FN_8(24)
@@ -157,14 +157,14 @@  static void glue(pl110_draw_line1_,NAME)(void *opaque, uint8_t *d, const uint8_t
 
 static void glue(pl110_draw_line2_,NAME)(void *opaque, uint8_t *d, const uint8_t *src, int width, int deststep)
 {
-    uint32_t *pallette = opaque;
+    uint32_t *palette = opaque;
     uint32_t data;
     while (width > 0) {
         data = *(uint32_t *)src;
 #ifdef SWAP_PIXELS
-#define FN(x, y) COPY_PIXEL(d, pallette[(data >> (y + 6 - (x)*2)) & 3]);
+#define FN(x, y) COPY_PIXEL(d, palette[(data >> (y + 6 - (x)*2)) & 3]);
 #else
-#define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x)*2 + y)) & 3]);
+#define FN(x, y) COPY_PIXEL(d, palette[(data >> ((x)*2 + y)) & 3]);
 #endif
 #ifdef SWAP_WORDS
         FN_4(0, 24)
@@ -185,14 +185,14 @@  static void glue(pl110_draw_line2_,NAME)(void *opaque, uint8_t *d, const uint8_t
 
 static void glue(pl110_draw_line4_,NAME)(void *opaque, uint8_t *d, const uint8_t *src, int width, int deststep)
 {
-    uint32_t *pallette = opaque;
+    uint32_t *palette = opaque;
     uint32_t data;
     while (width > 0) {
         data = *(uint32_t *)src;
 #ifdef SWAP_PIXELS
-#define FN(x, y) COPY_PIXEL(d, pallette[(data >> (y + 4 - (x)*4)) & 0xf]);
+#define FN(x, y) COPY_PIXEL(d, palette[(data >> (y + 4 - (x)*4)) & 0xf]);
 #else
-#define FN(x, y) COPY_PIXEL(d, pallette[(data >> ((x)*4 + y)) & 0xf]);
+#define FN(x, y) COPY_PIXEL(d, palette[(data >> ((x)*4 + y)) & 0xf]);
 #endif
 #ifdef SWAP_WORDS
         FN_2(0, 24)
@@ -213,11 +213,11 @@  static void glue(pl110_draw_line4_,NAME)(void *opaque, uint8_t *d, const uint8_t
 
 static void glue(pl110_draw_line8_,NAME)(void *opaque, uint8_t *d, const uint8_t *src, int width, int deststep)
 {
-    uint32_t *pallette = opaque;
+    uint32_t *palette = opaque;
     uint32_t data;
     while (width > 0) {
         data = *(uint32_t *)src;
-#define FN(x) COPY_PIXEL(d, pallette[(data >> (x)) & 0xff]);
+#define FN(x) COPY_PIXEL(d, palette[(data >> (x)) & 0xff]);
 #ifdef SWAP_WORDS
         FN(24)
         FN(16)