Bug 81621

Summary: media/dvb-frontends/stv0900_sw.c:1738: bad switch statement ?
Product: Drivers Reporter: David Binderman (dcb314)
Component: Video(Other)Assignee: drivers_video-other
Status: RESOLVED CODE_FIX    
Severity: normal CC: alan, andrey_utkin
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.16 Subsystem:
Regression: No Bisected commit-id:

Description David Binderman 2014-08-04 08:34:36 UTC
[linux-3.16/drivers/media/dvb-frontends/stv0900_sw.c:1738]: (style) Statements following return, break, continue, goto or throw will never be executed.

    switch (intp->srch_standard[demod]) {
    case STV0900_SEARCH_DVBS1:
        dprintk("Search Standard = DVBS1\n");
        break;
    case STV0900_SEARCH_DSS:
        dprintk("Search Standard = DSS\n");
    case STV0900_SEARCH_DVBS2:
        break;
        dprintk("Search Standard = DVBS2\n");
    case STV0900_AUTO_SEARCH:
    default:
        dprintk("Search Standard = AUTO\n");
        break;
    }

Maybe something like

    switch (intp->srch_standard[demod]) {
    case STV0900_SEARCH_DVBS1:
        dprintk("Search Standard = DVBS1\n");
        break;
    case STV0900_SEARCH_DSS:
        dprintk("Search Standard = DSS\n");
        break;
    case STV0900_SEARCH_DVBS2:
        dprintk("Search Standard = DVBS2\n");
        break;
    case STV0900_AUTO_SEARCH:
    default:
        dprintk("Search Standard = AUTO\n");
        break;
    }

would be better.
Comment 1 Andrey Utkin 2014-08-04 20:05:30 UTC
Thanks. Patch sent, see "[PATCH] drivers/media/dvb-frontends/stv0900_sw.c: Fix break placement"