Bug 80801

Summary: staging/bcm/Misc.c:1153: bad if test ?
Product: Drivers Reporter: David Binderman (dcb314)
Component: StagingAssignee: drivers_staging (drivers_staging)
Status: RESOLVED CODE_FIX    
Severity: normal CC: alan, andrey_utkin
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.16-rc6 Subsystem:
Regression: No Bisected commit-id:

Description David Binderman 2014-07-21 10:57:07 UTC
[linux-3.16-rc6/drivers/staging/bcm/Misc.c:1153] -> [linux-3.16-rc6/drivers/staging/bcm/Misc.c:1156]: (style) Mismatching assignment and comparison, comparison 'reporting_mode==1' is always false.

Source code is

    reporting_mode = ntohl(psAdapter->pstargetparams->m_u32PowerSavingModeOptions) & 0x02;
    // ...

    if (reporting_mode == TRUE) {

Something ANDed with 0x02 can't be equal 1. Suggest code rework.
Comment 1 Andrey Utkin 2014-07-23 11:20:44 UTC
Thanks, patch submitted: