Patchwork [5/6] hw/smc91c111: Add explicit 'return' rather than relying on fallthrough

login
register
mail settings
Submitter Peter Maydell
Date Jan. 21, 2013, 12:50 p.m.
Message ID <1358772656-7406-6-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/214142/
State New
Headers show

Comments

Peter Maydell - Jan. 21, 2013, 12:50 p.m.
Add an explicit 'return' statement to a case in smc91c111_readb
rather than relying on fallthrough to the following case's
return statement, for code clarity and to placate static analysers.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/smc91c111.c |    1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/hw/smc91c111.c b/hw/smc91c111.c
index a34698f..b605069 100644
--- a/hw/smc91c111.c
+++ b/hw/smc91c111.c
@@ -442,6 +442,7 @@  static void smc91c111_writeb(void *opaque, hwaddr offset,
             return;
         case 12: /* Early receive.  */
             s->ercv = value & 0x1f;
+            return;
         case 13:
             /* Ignore.  */
             return;