* [PATCH] drivers/staging/bcm/Misc.c: fix a check
@ 2014-07-23 10:47 Andrey Utkin
0 siblings, 0 replies; only message in thread
From: Andrey Utkin @ 2014-07-23 10:47 UTC (permalink / raw)
To: standby24x7, lisa, sulamiification, gregkh
Cc: linux-kernel, kernel-janitors, devel, dcb314, Andrey Utkin
The issue was reported by static analysis.
The value holding flags was &-ed with 0x02, being compared to 0x01
(TRUE) after that. Such comparsion is always false.
Resolution: drop the comparsion to TRUE in the condition.
&-ing with 0x02 is right, according to result variable name
(reporting_mode) and description in drivers/staging/bcm/target_params.h
("bit 1 = 1: CINR reporting in Idlemode Msg").
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80801
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
---
drivers/staging/bcm/Misc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/bcm/Misc.c b/drivers/staging/bcm/Misc.c
index a1c833c..883f739 100644
--- a/drivers/staging/bcm/Misc.c
+++ b/drivers/staging/bcm/Misc.c
@@ -1154,7 +1154,7 @@ static void doPowerAutoCorrection(struct bcm_mini_adapter *psAdapter)
reporting_mode = ntohl(psAdapter->pstargetparams->m_u32PowerSavingModeOptions) & 0x02;
psAdapter->bIsAutoCorrectEnabled = !((char)(psAdapter->ulPowerSaveMode >> 3) & 0x1);
- if (reporting_mode == TRUE) {
+ if (reporting_mode) {
BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "can't do suspen/resume as reporting mode is enable");
psAdapter->bDoSuspend = false;
}
--
1.8.5.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-23 10:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23 10:47 [PATCH] drivers/staging/bcm/Misc.c: fix a check Andrey Utkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®