Skip to contentSkip to conversation

tests: missing ; in if 0

PATCH In review Michael S. Tsirkin 2 participants 5 messages Oct 1, 2009 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/2 tests: missing ; in if 0

In reply to a message not in the archive

Fix missing ; in commented out code

---
 tests/sha1.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tests/sha1.c +1 -1
index 2557344..3a76555 100644
@@ -190,7 +190,7 @@ unsigned char c;
 	int j;
 
 	for (j = 0; j < 4; t >>= 8, j++)
-	    *--fcp = (unsigned char) t
+	    *--fcp = (unsigned char) t;
     }
 #else
     for (i = 0; i < 8; i++) {
Signature · 1 line
1.6.5.rc2
#2 lore raw

PATCH 2/2 hw/omap_dma: add matching {} in if 0

In reply to a message not in the archive

MULTI_REQ is never defined, so it doesn't matter much, but since we have an if statement there, let's add {} to clarify what it should do if it's uncommented.

---
 hw/omap_dma.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
hw/omap_dma.c +3 -1
index 205d010..ab5e925 100644
@@ -588,7 +588,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
 #ifdef MULTI_REQ
     /* TODO: should all of this only be done if dma->update, and otherwise
      * inside omap_dma_transfer_generic below - check what's faster.  */
-    if (dma->update)
+    if (dma->update) {
 #endif
 
     /* If the channel is element synchronized, deactivate it */
@@ -670,6 +670,8 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
          * bits on it.  */
 #ifndef MULTI_REQ
     }
+#else
+    }
 #endif
 
     omap_dma_interrupts_update(s);
Signature · 1 line
1.6.5.rc2
#3 lore raw

Re: [Qemu-devel] [PATCH 2/2] hw/omap_dma: add matching {} in if 0

Quoted 23 lines · Michael S. Tsirkin

MULTI_REQ is never defined, so it doesn't matter much, but since we have an if statement there, let's add {} to clarify what it should do if it's uncommented.

---
 hw/omap_dma.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
hw/omap_dma.c +1 -1
index 205d010..ab5e925 100644
@@ -588,7 +588,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
 #ifdef MULTI_REQ
     /* TODO: should all of this only be done if dma->update, and otherwise
      * inside omap_dma_transfer_generic below - check what's faster.  */
-    if (dma->update)
+    if (dma->update) {
 #endif
 
     /* If the channel is element synchronized, deactivate it */

hw/omap_dma.c static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma) · line 677

Quoted 8 lines
hw/omap_dma.c +2 -0
@@ -670,6 +670,8 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
          * bits on it.  */
 #ifndef MULTI_REQ
     }
+#else
+    }
 #endif
 
     omap_dma_interrupts_update(s);

Doesn't this look silly? Just close the brace :)

#4 lore raw

Re: [Qemu-devel] [PATCH 2/2] hw/omap_dma: add matching {} in if 0

Quoted 32 lines · Markus Armbruster
Quoted 30 lines · Michael S. Tsirkin

MULTI_REQ is never defined, so it doesn't matter much, but since we have an if statement there, let's add {} to clarify what it should do if it's uncommented.

---
 hw/omap_dma.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
hw/omap_dma.c +3 -1
index 205d010..ab5e925 100644
@@ -588,7 +588,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
 #ifdef MULTI_REQ
     /* TODO: should all of this only be done if dma->update, and otherwise
      * inside omap_dma_transfer_generic below - check what's faster.  */
-    if (dma->update)
+    if (dma->update) {
 #endif
 
     /* If the channel is element synchronized, deactivate it */
@@ -670,6 +670,8 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
          * bits on it.  */
 #ifndef MULTI_REQ
     }
+#else
+    }
 #endif
 
Quoted 3 lines

hw/omap_dma.c static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma) · line 677

Quoted 1 line
hw/omap_dma.c +0 -0
     omap_dma_interrupts_update(s);

Doesn't this look silly? Just close the brace :)

This way we get more {'s than }'s, which is even more ugly. We probably should indent the text within if (dma->update) though.

Signature · 1 line
MST
#5 lore raw

Re: [Qemu-devel] [PATCH 2/2] hw/omap_dma: add matching {} in if 0

Quoted 33 lines · Michael S. Tsirkin
Quoted 32 lines · Markus Armbruster
Quoted 30 lines · Michael S. Tsirkin

MULTI_REQ is never defined, so it doesn't matter much, but since we have an if statement there, let's add {} to clarify what it should do if it's uncommented.

---
 hw/omap_dma.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
hw/omap_dma.c +3 -1
index 205d010..ab5e925 100644
@@ -588,7 +588,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
 #ifdef MULTI_REQ
     /* TODO: should all of this only be done if dma->update, and otherwise
      * inside omap_dma_transfer_generic below - check what's faster.  */
-    if (dma->update)
+    if (dma->update) {
 #endif
 
     /* If the channel is element synchronized, deactivate it */
@@ -670,6 +670,8 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
          * bits on it.  */
 #ifndef MULTI_REQ
     }
+#else
+    }
 #endif
 
Quoted 6 lines
Quoted 3 lines

hw/omap_dma.c static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma) · line 677

Quoted 1 line
hw/omap_dma.c +0 -0
     omap_dma_interrupts_update(s);

Doesn't this look silly? Just close the brace :)

This way we get more {'s than }'s, which is even more ugly. We probably should indent the text within if (dma->update) though.

I'd just kill the dead code, keep only the TODO comment.