Skip to contentSkip to conversation

disas/sh4: Add missing fallthrough annotations

PATCH In review Thomas Huth 3 participants 3 messages Jun 30, 2020 – Jul 9, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 disas/sh4: Add missing fallthrough annotations

Add fallthrough annotations to be able to compile the code without warnings with -Wimplicit-fallthrough. Looking at the code, it seems like the fallthrough is indeed intended here, so the comments should be appropriate.

---
Note: The new lines use TABs since all the surounding code uses TABs, too. Please ignore the checkpatch warnings.

 disas/sh4.c | 2 ++
 1 file changed, 2 insertions(+)
disas/sh4.c +2 -0
index 55ef865a36..dcdbdf26d8 100644
@@ -1963,6 +1963,7 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info)
 		  fprintf_fn (stream, "xd%d", rn & ~1);
 		  break;
 		}
+	      /* fallthrough */
 	    case D_REG_N:
 	      fprintf_fn (stream, "dr%d", rn);
 	      break;
@@ -1972,6 +1973,7 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info)
 		  fprintf_fn (stream, "xd%d", rm & ~1);
 		  break;
 		}
+	      /* fallthrough */
 	    case D_REG_M:
 	      fprintf_fn (stream, "dr%d", rm);
 	      break;
Signature · 1 line
2.18.1
#1 lore raw
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Subject: [PATCH] disas/sh4: Add missing fallthrough annotations
Type: series
Message-id: [email protected]

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu

   e765115..fc1bff9  master     -> master
 - [tag update]      patchew/[email protected] -> patchew/[email protected]
 * [new tag]         patchew/[email protected] -> patchew/[email protected]

Switched to a new branch 'test'
82643b9 disas/sh4: Add missing fallthrough annotations

=== OUTPUT BEGIN ===
ERROR: code indent should never use tabs
#23: FILE: disas/sh4.c:1966:
+^I /* fallthrough */$

ERROR: code indent should never use tabs
#31: FILE: disas/sh4.c:1976:
+^I /* fallthrough */$

total: 2 errors, 0 warnings, 14 lines checked

Commit 82643b95d2e7 (disas/sh4: Add missing fallthrough annotations) has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 9 lines · Thomas Huth

Add fallthrough annotations to be able to compile the code without warnings with -Wimplicit-fallthrough. Looking at the code, it seems like the fallthrough is indeed intended here, so the comments should be appropriate.

---
Note: The new lines use TABs since all the surounding code uses TABs, too. Please ignore the checkpatch warnings.

r~