Bug 44081 - ov9640.c:605: possible missing break
Summary: ov9640.c:605: possible missing break
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(Other) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Alan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-01 14:55 UTC by David Binderman
Modified: 2012-08-15 21:49 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.5-rc5
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description David Binderman 2012-07-01 14:55:11 UTC
I just ran the static analyser cppcheck over the source code of the
linux kernel version 3.5-rc5.

It said

[linux-3.5-rc5/drivers/media/video/ov9640.c:605]: (warning) Redundant assignment of "devname" in switch

The source code is

    switch (VERSION(pid, ver)) {
    case OV9640_V2:
        devname     = "ov9640";
        priv->model = V4L2_IDENT_OV9640;
        priv->revision  = 2;
    case OV9640_V3:
        devname     = "ov9640";
        priv->model = V4L2_IDENT_OV9640;
        priv->revision  = 3;
        break;
    default:
        dev_err(&client->dev, "Product ID error %x:%x\n", pid, ver);
        return -ENODEV;
    }

It looks to me like a missing break on the _V2 case.
Comment 1 Alan 2012-07-02 12:36:20 UTC
Patch queued
Comment 2 Florian Mickler 2012-08-04 19:09:15 UTC
A patch referencing this bug report has been merged in Linux v3.6-rc1:

commit 908d4d141f9608d1966ea8b483ee1c1aad04e438
Author: Alan Cox <alan@linux.intel.com>
Date:   Tue Jul 24 11:50:49 2012 -0300

    [media] ov9640: fix missing break

Note You need to log in before you can comment on or make changes to this bug.