Skip to contentSkip to conversation

hw/arm/pxa2xx: Add missing fallthrough comment

PATCH Applied Thomas Huth 3 participants 4 messages Sep 11, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm/pxa2xx: Add missing fallthrough comment

Let's make this file compilable with -Werror=implicit-fallthrough :
Looking at the code, it seems like the fallthrough is intended here, so we should add the corresponding "/* fallthrough */" comment here.

---
 hw/arm/pxa2xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/pxa2xx.c +1 -1
index 76975d17a4..c1f45b2adf 100644
@@ -443,7 +443,7 @@ static void pxa2xx_mm_write(void *opaque, hwaddr addr,
             s->mm_regs[addr >> 2] = value;
             break;
         }
-
+        /* fallthrough */
     default:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: Bad write offset 0x%"HWADDR_PRIx"\n",
Signature · 1 line
2.18.2
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 15 lines · Thomas Huth

Let's make this file compilable with -Werror=implicit-fallthrough :
Looking at the code, it seems like the fallthrough is intended here, so we should add the corresponding "/* fallthrough */" comment here.

---
 hw/arm/pxa2xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/pxa2xx.c +0 -0
index 76975d17a4..c1f45b2adf 100644

hw/arm/pxa2xx.c static void pxa2xx_mm_write(void *opaque, hwaddr addr, · line 449

Quoted 8 lines
hw/arm/pxa2xx.c +1 -1
@@ -443,7 +443,7 @@ static void pxa2xx_mm_write(void *opaque, hwaddr addr,
             s->mm_regs[addr >> 2] = value;
             break;
         }
-
+        /* fallthrough */
     default:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: Bad write offset 0x%"HWADDR_PRIx"\n",

I keep rebasing this one from Stefan, not sure why never upstreamed :/
https://repo.or.cz/qemu/ar7.git/blobdiff/2a9c928409..5ebb514633:/hw/arm/pxa2xx.c

#2 lore raw
Quoted 19 lines · Philippe Mathieu-Daudé
Quoted 18 lines · Thomas Huth

Let's make this file compilable with -Werror=implicit-fallthrough :
Looking at the code, it seems like the fallthrough is intended here, so we should add the corresponding "/* fallthrough */" comment here.

---
 hw/arm/pxa2xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/pxa2xx.c +0 -1
index 76975d17a4..c1f45b2adf 100644
@@ -443,7 +443,7 @@ static void pxa2xx_mm_write(void *opaque, hwaddr addr,
             s->mm_regs[addr >> 2] = value;
             break;
         }
-
Quoted 8 lines

hw/arm/pxa2xx.c static void pxa2xx_mm_write(void *opaque, hwaddr addr, · line 449

Quoted 5 lines
hw/arm/pxa2xx.c +1 -0
+        /* fallthrough */
     default:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: Bad write offset 0x%"HWADDR_PRIx"\n",

I keep rebasing this one from Stefan, not sure why never upstreamed :/
https://repo.or.cz/qemu/ar7.git/blobdiff/2a9c928409..5ebb514633:/hw/arm/pxa2xx.c

Are there more patches like this in that tree? If so, could you maybe send them upstream?

Quoted 2 lines

Thanks!

Thomas

#3 lore raw
In reply to Philippe Mathieu-Daudé

Le 11/09/2020 à 14:41, Philippe Mathieu-Daudé a écrit :

Quoted 19 lines · Thomas Huth
Quoted 18 lines

Let's make this file compilable with -Werror=implicit-fallthrough :
Looking at the code, it seems like the fallthrough is intended here, so we should add the corresponding "/* fallthrough */" comment here.

---
 hw/arm/pxa2xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/pxa2xx.c +0 -1
index 76975d17a4..c1f45b2adf 100644
@@ -443,7 +443,7 @@ static void pxa2xx_mm_write(void *opaque, hwaddr addr,
             s->mm_regs[addr >> 2] = value;
             break;
         }
-
Quoted 8 lines

hw/arm/pxa2xx.c static void pxa2xx_mm_write(void *opaque, hwaddr addr, · line 449

Quoted 5 lines
hw/arm/pxa2xx.c +1 -0
+        /* fallthrough */
     default:
         qemu_log_mask(LOG_GUEST_ERROR,
                       "%s: Bad write offset 0x%"HWADDR_PRIx"\n",

I keep rebasing this one from Stefan, not sure why never upstreamed :/
https://repo.or.cz/qemu/ar7.git/blobdiff/2a9c928409..5ebb514633:/hw/arm/pxa2xx.c

Has it been sent to qemu-trivial? I don't find it in my folder.

Quoted 5 lines

Applied to my trivial-patches branch.

Thanks,
Laurent