From: Andrey Utkin Date: Wed, 23 Jul 2014 10:47:33 +0000 (+0300) Subject: drivers/staging/bcm/Misc.c: fix a check X-Git-Tag: v5.15~17495^2~320 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b866095276690ea5018d9d604ecba1cd04c2023;p=platform%2Fkernel%2Flinux-starfive.git drivers/staging/bcm/Misc.c: fix a check 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 Signed-off-by: Andrey Utkin Signed-off-by: Greg Kroah-Hartman --- 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; }