Skip to contentSkip to conversation

hw/display/cirrus_vga: Fix code mis-indentation

PATCH In review Philippe Mathieu-Daudé 3 participants 4 messages May 29, 2020 – Jun 5, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/display/cirrus_vga: Fix code mis-indentation

While replacing fprintf() by qemu_log_mask() in commit 2b55f4d3504, we incorrectly used a 'tab = 4 spaces' alignment, leading to misindented new code. Fix now.

---
 hw/display/cirrus_vga.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
hw/display/cirrus_vga.c +3 -3
index 92c197cdde..212d6f5e61 100644
@@ -1032,9 +1032,9 @@ static void cirrus_bitblt_start(CirrusVGAState * s)
         } else {
 	    if (s->cirrus_blt_mode & CIRRUS_BLTMODE_TRANSPARENTCOMP) {
 		if (s->cirrus_blt_pixelwidth > 2) {
-            qemu_log_mask(LOG_GUEST_ERROR,
-                          "cirrus: src transparent without colorexpand "
-                          "must be 8bpp or 16bpp\n");
+                    qemu_log_mask(LOG_GUEST_ERROR,
+                                  "cirrus: src transparent without colorexpand "
+                                  "must be 8bpp or 16bpp\n");
 		    goto bitblt_ignore;
 		}
 		if (s->cirrus_blt_mode & CIRRUS_BLTMODE_BACKWARDS) {
Signature · 1 line
2.21.3
#1 lore raw
Quoted 18 lines · Philippe Mathieu-Daudé

While replacing fprintf() by qemu_log_mask() in commit 2b55f4d3504, we incorrectly used a 'tab = 4 spaces' alignment, leading to misindented new code. Fix now.

---
 hw/display/cirrus_vga.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
hw/display/cirrus_vga.c +0 -0
index 92c197cdde..212d6f5e61 100644
@@ -1032,9 +1032,9 @@ static void cirrus_bitblt_start(CirrusVGAState * s)
         } else {
 	    if (s->cirrus_blt_mode & CIRRUS_BLTMODE_TRANSPARENTCOMP) {

hw/display/cirrus_vga.c static void cirrus_bitblt_start(CirrusVGAState * s) · line 1040

Quoted 10 lines
hw/display/cirrus_vga.c +3 -3
 		if (s->cirrus_blt_pixelwidth > 2) {
-            qemu_log_mask(LOG_GUEST_ERROR,
-                          "cirrus: src transparent without colorexpand "
-                          "must be 8bpp or 16bpp\n");
+                    qemu_log_mask(LOG_GUEST_ERROR,
+                                  "cirrus: src transparent without colorexpand "
+                                  "must be 8bpp or 16bpp\n");
 		    goto bitblt_ignore;
 		}
 		if (s->cirrus_blt_mode & CIRRUS_BLTMODE_BACKWARDS) {

I think it would be better to fix the TABs in the whole surounding area, too. Or maybe even in the whole file. Otherwise this problem will happen soon again...

Thomas

#2 lore raw
Quoted 25 lines · Thomas Huth
Quoted 24 lines · Philippe Mathieu-Daudé

While replacing fprintf() by qemu_log_mask() in commit 2b55f4d3504, we incorrectly used a 'tab = 4 spaces' alignment, leading to misindented new code. Fix now.

---
 hw/display/cirrus_vga.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
hw/display/cirrus_vga.c +3 -3
index 92c197cdde..212d6f5e61 100644
@@ -1032,9 +1032,9 @@ static void cirrus_bitblt_start(CirrusVGAState * s)
         } else {
 	    if (s->cirrus_blt_mode & CIRRUS_BLTMODE_TRANSPARENTCOMP) {
 		if (s->cirrus_blt_pixelwidth > 2) {
-            qemu_log_mask(LOG_GUEST_ERROR,
-                          "cirrus: src transparent without colorexpand "
-                          "must be 8bpp or 16bpp\n");
+                    qemu_log_mask(LOG_GUEST_ERROR,
+                                  "cirrus: src transparent without colorexpand "
+                                  "must be 8bpp or 16bpp\n");
Quoted 8 lines

hw/display/cirrus_vga.c static void cirrus_bitblt_start(CirrusVGAState * s) · line 1040

Quoted 4 lines
hw/display/cirrus_vga.c +0 -0
 		    goto bitblt_ignore;
 		}
 		if (s->cirrus_blt_mode & CIRRUS_BLTMODE_BACKWARDS) {

I think it would be better to fix the TABs in the whole surounding area, too. Or maybe even in the whole file. Otherwise this problem will happen soon again...

Well, this is a small step to unbreak alignment mistake from latest pull request because my editor was using a 1tab=4spaces configuration, and QEMU style expects 1tab=8spaces:
https://www.mail-archive.com/[email protected]/msg707941.html

Fixing the whole area is a different task IMO :)

Can this go via qemu-trivial?

Quoted 4 lines

Thomas