Bug 46571

Summary: drivers/staging/csr/unifi_pdu_processing.c:2722: bad if test
Product: Drivers Reporter: David Binderman (dcb314)
Component: StagingAssignee: drivers_staging (drivers_staging)
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.6-rc3 Subsystem:
Regression: No Bisected commit-id:

Description David Binderman 2012-08-28 17:11:19 UTC
I just tried to compile the Linux kernel 3.6-rc3
with the extra compiler flag -Wlogical-op

The compiler said
drivers/staging/csr/unifi_pdu_processing.c: In function ‘uf_handle_uspframes_delivery’:
drivers/staging/csr/unifi_pdu_processing.c:2722:9: warning: logical ‘or’ of collectively exhaustive tests is always true [-Wlogical-op]
         if ((staInfo->timSet != CSR_WIFI_TIM_RESET) || (staInfo->timSet != CSR_WIFI_TIM_RESETTING)) {
         ^
but

$ fgrep CSR_WIFI_TIM_RESET drivers/staging/csr/unifi_priv.h
#define CSR_WIFI_TIM_RESET       0
#define CSR_WIFI_TIM_RESETTING   2

Suggest change || to &&
Comment 1 Greg Kroah-Hartman 2012-08-28 17:42:26 UTC
On Tue, Aug 28, 2012 at 05:11:19PM +0000, bugzilla-daemon@bugzilla.kernel.org wrote:
>            Summary: drivers/staging/csr/unifi_pdu_processing.c:2722: bad
>                     if test

Please send a patch through email for this.