hw/pxa2xx_timer: Explicitly mark fallthroughs

Explicitly mark the fallthroughs as intentional in the code
pattern where we gradually increment an index before falling
into the code to read/write that array entry:
    case THINGY_3: idx++;
    case THINGY_2: idx++;
    case THINGY_1: idx++;
    case THINGY_0: return s->thingy[idx];

This makes static analysers happy.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Peter Maydell 2013-01-21 12:50:56 +00:00 committed by Blue Swirl
parent 89556d1725
commit de16017dc8
1 changed files with 47 additions and 0 deletions

View File

@ -157,17 +157,27 @@ static uint64_t pxa2xx_timer_read(void *opaque, hwaddr offset,
switch (offset) {
case OSMR3: tm ++;
/* fall through */
case OSMR2: tm ++;
/* fall through */
case OSMR1: tm ++;
/* fall through */
case OSMR0:
return s->timer[tm].value;
case OSMR11: tm ++;
/* fall through */
case OSMR10: tm ++;
/* fall through */
case OSMR9: tm ++;
/* fall through */
case OSMR8: tm ++;
/* fall through */
case OSMR7: tm ++;
/* fall through */
case OSMR6: tm ++;
/* fall through */
case OSMR5: tm ++;
/* fall through */
case OSMR4:
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
@ -176,12 +186,19 @@ static uint64_t pxa2xx_timer_read(void *opaque, hwaddr offset,
return s->clock + muldiv64(qemu_get_clock_ns(vm_clock) -
s->lastload, s->freq, get_ticks_per_sec());
case OSCR11: tm ++;
/* fall through */
case OSCR10: tm ++;
/* fall through */
case OSCR9: tm ++;
/* fall through */
case OSCR8: tm ++;
/* fall through */
case OSCR7: tm ++;
/* fall through */
case OSCR6: tm ++;
/* fall through */
case OSCR5: tm ++;
/* fall through */
case OSCR4:
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
@ -207,12 +224,19 @@ static uint64_t pxa2xx_timer_read(void *opaque, hwaddr offset,
case OWER:
return s->reset3;
case OMCR11: tm ++;
/* fall through */
case OMCR10: tm ++;
/* fall through */
case OMCR9: tm ++;
/* fall through */
case OMCR8: tm ++;
/* fall through */
case OMCR7: tm ++;
/* fall through */
case OMCR6: tm ++;
/* fall through */
case OMCR5: tm ++;
/* fall through */
case OMCR4:
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
@ -235,19 +259,29 @@ static void pxa2xx_timer_write(void *opaque, hwaddr offset,
switch (offset) {
case OSMR3: tm ++;
/* fall through */
case OSMR2: tm ++;
/* fall through */
case OSMR1: tm ++;
/* fall through */
case OSMR0:
s->timer[tm].value = value;
pxa2xx_timer_update(s, qemu_get_clock_ns(vm_clock));
break;
case OSMR11: tm ++;
/* fall through */
case OSMR10: tm ++;
/* fall through */
case OSMR9: tm ++;
/* fall through */
case OSMR8: tm ++;
/* fall through */
case OSMR7: tm ++;
/* fall through */
case OSMR6: tm ++;
/* fall through */
case OSMR5: tm ++;
/* fall through */
case OSMR4:
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
@ -261,12 +295,19 @@ static void pxa2xx_timer_write(void *opaque, hwaddr offset,
pxa2xx_timer_update(s, s->lastload);
break;
case OSCR11: tm ++;
/* fall through */
case OSCR10: tm ++;
/* fall through */
case OSCR9: tm ++;
/* fall through */
case OSCR8: tm ++;
/* fall through */
case OSCR7: tm ++;
/* fall through */
case OSCR6: tm ++;
/* fall through */
case OSCR5: tm ++;
/* fall through */
case OSCR4:
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
@ -291,8 +332,11 @@ static void pxa2xx_timer_write(void *opaque, hwaddr offset,
s->reset3 = value;
break;
case OMCR7: tm ++;
/* fall through */
case OMCR6: tm ++;
/* fall through */
case OMCR5: tm ++;
/* fall through */
case OMCR4:
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
@ -306,8 +350,11 @@ static void pxa2xx_timer_write(void *opaque, hwaddr offset,
}
break;
case OMCR11: tm ++;
/* fall through */
case OMCR10: tm ++;
/* fall through */
case OMCR9: tm ++;
/* fall through */
case OMCR8: tm += 4;
if (!pxa2xx_timer_has_tm4(s))
goto badreg;