Bug 78091 - staging/xgifb/vb_setmode.c: 2 * bad if tests ?
Summary: staging/xgifb/vb_setmode.c: 2 * bad if tests ?
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Staging (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_staging@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-16 10:45 UTC by David Binderman
Modified: 2014-07-21 10:58 UTC (History)
0 users

See Also:
Kernel Version: 3.16-rc1
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description David Binderman 2014-06-16 10:45:13 UTC
[linux-3.16-rc1/drivers/staging/xgifb/vb_setmode.c:3732] -> [linux-3.16-rc1/drivers/staging/xgifb/vb_setmode.c:3734]: (style) Mismatching assignment and comparison, comparison 'tempah==34' is always false.
[linux-3.16-rc1/drivers/staging/xgifb/vb_setmode.c:3732] -> [linux-3.16-rc1/drivers/staging/xgifb/vb_setmode.c:3738]: (style) Mismatching assignment and comparison, comparison 'tempah==35' is always false.

Source code is

    tempah &= PanelResInfo;

    if ((tempah == Panel_1024x768) || (tempah == Panel_1024x768x75)) {
        tempbx = 1024;
        tempcx = 768;
    } else if ((tempah == Panel_1280x1024) ||
           (tempah == Panel_1280x1024x75)) {


but

#define PanelResInfo            0x1F /* CR36 Panel Type/LCDResInfo */
#define Panel_1024x768x75        0x22
#define Panel_1280x1024x75       0x23

Something that's been ANDed with 0x1F can only have a maximum
value of 31, so can never be equal to 34 or 35.

Suggest code rework.
Comment 1 David Binderman 2014-07-21 10:58:45 UTC
Still broken over a month later.

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