Remove unnecessary break statements
PATCH 1/1 Remove unnecessary break statements
Fix these warnings from cppcheck:
hw/display/cirrus_vga.c:2603:hw/sd/sd.c:348:hw/timer/exynos4210_mct.c:1033:target-arm/translate.c:9886:target-s390x/mem_helper.c:518:target-unicore32/translate.c:1936:
style: Consecutive return, break, continue, goto or throw statements are unnecessary.
--- hw/display/cirrus_vga.c | 1 - hw/timer/exynos4210_mct.c | 1 - target-arm/translate.c | 1 - target-s390x/mem_helper.c | 1 - target-unicore32/translate.c | 1 - 5 files changed, 5 deletions(-)
hw/display/cirrus_vga.c +0 -1
@@ -2600,7 +2600,6 @@ static void cirrus_vga_ioport_write(void *opaque, hwaddr addr, uint64_t val,#endif cirrus_vga_write_sr (c, val);break ; -break ;case 0x3c6 :cirrus_write_hidden_dac (c, val);break ;
hw/timer/exynos4210_mct.c +0 -1
@@ -1030,7 +1030,6 @@ static uint64_t exynos4210_mct_read(void *opaque, hwaddr offset,case G_INT_ENB : value = s->g_timer.reg.int_enb;break ; -break ;case G_WSTAT : value = s->g_timer.reg.wstat;break ;
target-arm/translate.c +0 -1
@@ -9883,7 +9883,6 @@ static inline void gen_intermediate_code_internal(CPUARMState *env,invalidate this TB. */ dc->pc +=2 ; goto done_generating; -break ; } } }
target-s390x/mem_helper.c +0 -1
@@ -515,7 +515,6 @@ uint32_t HELPER(ex)(CPUS390XState *env, uint32_t cc, uint64_t v1,break ;default : goto abort; -break ; } }else if ((insn &0xff00 ) ==0x0a00 ) {/* supervisor call */
target-unicore32/translate.c +0 -1
@@ -1933,7 +1933,6 @@ static inline void gen_intermediate_code_internal(CPUUniCore32State *env,invalidate this TB. */ dc->pc +=2 ;/* FIXME */ goto done_generating; -break ; } } }
Signature · 1 line
1.7.10.4
Quoted 11 lines · Stefan Weil
Fix these warnings from cppcheck:
hw/display/cirrus_vga.c:2603:hw/sd/sd.c:348:hw/timer/exynos4210_mct.c:1033:target-arm/translate.c:9886:target-s390x/mem_helper.c:518:target-unicore32/translate.c:1936:
style: Consecutive return, break, continue, goto or throw statements are unnecessary.Signed-off-by Stefan Weil <[email protected]>
-- PMM
Am 24.05.2013 12:19, schrieb Stefan Weil:
Quoted 11 lines
Fix these warnings from cppcheck:
hw/display/cirrus_vga.c:2603:hw/sd/sd.c:348:hw/timer/exynos4210_mct.c:1033:target-arm/translate.c:9886:target-s390x/mem_helper.c:518:target-unicore32/translate.c:1936:
style: Consecutive return, break, continue, goto or throw statements are unnecessary.Signed-off-by Stefan Weil <[email protected]>
Also removes a tab while at it. :)
Thanks,
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Quoted 9 lines · Stefan Weil
Fix these warnings from cppcheck:
hw/display/cirrus_vga.c:2603:hw/sd/sd.c:348:hw/timer/exynos4210_mct.c:1033:target-arm/translate.c:9886:target-s390x/mem_helper.c:518:target-unicore32/translate.c:1936:
style: Consecutive return, break, continue, goto or throw statements are unnecessary.
I'm not sure what cppcheck does, but I spotted an unnecessary break statement in the watchdog code a few days ago:
So it's obviously not finding them all :-(
Rich.
Signature · 4 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Am 24.05.2013 14:33, schrieb Richard W.M. Jones:
Quoted 13 lines · Stefan Weil
Quoted 9 lines
Fix these warnings from cppcheck:
hw/display/cirrus_vga.c:2603:hw/sd/sd.c:348:hw/timer/exynos4210_mct.c:1033:target-arm/translate.c:9886:target-s390x/mem_helper.c:518:target-unicore32/translate.c:1936:
style: Consecutive return, break, continue, goto or throw statements are unnecessary.I'm not sure what cppcheck does, but I spotted an unnecessary break statement in the watchdog code a few days ago:
Quoted 6 lines
So it's obviously not finding them all :-(
Rich.
Yes, cppcheck knows functions with attribute noreturn, but does not check for statements after such functions. That's a missing feature (or a bug).
Stefan
Michael Tokarev
AppliedQuoted 1 line · Stefan Weil
Fix these warnings from cppcheck:
Thanks, applied to the trivial patches tree.
/mjt