Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp144593iob; Tue, 17 May 2022 21:45:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK4XzTh1SR4VMQckNxkMTYRHxhU+/HqZciCUKhY2hwy5O/jNhzg/wrUZDudI0CUAd49oxD X-Received: by 2002:a17:902:e94f:b0:14f:1636:c8a8 with SMTP id b15-20020a170902e94f00b0014f1636c8a8mr25130348pll.130.1652849135797; Tue, 17 May 2022 21:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652849135; cv=none; d=google.com; s=arc-20160816; b=IBcr2wf24DBNKA4pU94/1P9BGk1oRdZ9UG3P8uZznCAITtzhiJQMrCE4jvm1AqBLUd glKyH3+s6QCHza+S+fOW9VGHo9/rbBSYJ7BU9Ry7NrdOAsH9PzRHY/mabvqs9aW/XDpf zVmar+EA5HAGcv5iP7aHcpeSQtr3rGvGiwdwtcNyYVpiS6bmtorR8wZMHu5XKU5ohIqO JhcNN6423vxjT58kjZMxcBO2hgWuufX1WlA1kEA7RPMDP0c+VSwESzFrEFT17Qqtps5g GkOp7boPOVRMefpmGRfHervkCvh4mk/YZ3aeM0KMU10XzZ5zbZNczYtcIn5q1tZSZcaE i/8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9jbHJ9DXcGeuMwC9N2+XOhDP8Q1hP8OkPUBuzaHRk2o=; b=PDnstJ1MHHBKo+v7y9VMey5v8QpNMbFSVTXZhz2v48SGohGdB6E7oSOItyiur//bmJ IKbS8fYk+RLhy8FQ94hex5pU4Tp620QwSp+gxkV9of0JvkQpx31Q57aNI97Zif7PbxkH MgZ5a50xUhUOcjmKUOpChOEo3Vww16lUJP9/vUwOKNduAlRB9UGZ7QDFuKmku4X/VW+9 ZBh7qDctujUKGclg8VQRW6LSpy5+JWDRA18gtxdWD3GZOvPDwUxq8jy/b7rzG9mbUTjD KEu/Mw02+NFw96PgpW1/eLfPuJWh85Ldm3m5/SrrRu4ylU/Nuakz0hbjTdW6rRA54ypc YyfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mEtBJuL5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k10-20020a63d10a000000b003c66b6ca640si1255985pgg.311.2022.05.17.21.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:45:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mEtBJuL5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BDB12EC315; Tue, 17 May 2022 20:57:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348461AbiEQOHF (ORCPT + 99 others); Tue, 17 May 2022 10:07:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348435AbiEQOGo (ORCPT ); Tue, 17 May 2022 10:06:44 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42A5A3E5DA for ; Tue, 17 May 2022 07:06:44 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d17so17465998plg.0 for ; Tue, 17 May 2022 07:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9jbHJ9DXcGeuMwC9N2+XOhDP8Q1hP8OkPUBuzaHRk2o=; b=mEtBJuL5JpPfCz/fsT72F/BXMH9APCBPy4vh4OwNqvGqLJHaGdANAD9yqZKWyhWfBj I4905TUU9lxSKducmMkVlzy60McBD3OJvIHVStyJ3sHxSb6K6XjOZoyS+sgs0jGkbook nlGZ9W3l+2pZEwUoscmhTYlOOJtDI6jXR3GWZvOkP47UwzrmdeVryBPgQuuLenFO0jPh ItWThTh6uMMJdbyiPolHCJERIDyBX7cXhFysESwVG1Vx+hO138UzdTA1N4dw1Xr9HwuX Aq1x7BwnBOh/Xr6sJhTd+xS07QlPvZohne+sf6swqkUIVQiNOc4SUIXkzdHWTP+yW8xt zI3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9jbHJ9DXcGeuMwC9N2+XOhDP8Q1hP8OkPUBuzaHRk2o=; b=F5VYKkykbixOnMsdz+NbrDRW1TlgmeWgB85DFinbgVBsJUs18dRkFBGSmyHZrAh0Gw EovCcwGymUWWuKLTI4TP7EaVQO86cVIk3IAP8a6W0cuzOt7j5Xh3xVdqkX8XPm0SqZOz m+ou2npLq+vE35r+qoLHaF9OMJwD0nkqwo1xsUCSgbvv/8bW3OexpMkcbdV7zTzH4gUT 9oWhQAEiSxTzdej0Xnt5RF4i/Zspv17YUdLjBEWi969jeoJbQ7uL8+86r98G7jEaRDQs pAaD5blJi/3O24uj2tfU99h7j+dIHLTlhUJcs7cK49lh3F4RUZfY8z4sBY1DZHNlQaIw lkQA== X-Gm-Message-State: AOAM533mPxlm7V7rlFmGB+aOUfCzFYbFq+ImTFveeLXS0gXGJ3pjRhEN xNPELfHpj0xQdDo7GThUGvg= X-Received: by 2002:a17:902:e0d4:b0:161:74ba:9def with SMTP id e20-20020a170902e0d400b0016174ba9defmr10852821pla.28.1652796403676; Tue, 17 May 2022 07:06:43 -0700 (PDT) Received: from makvihas.localhost.com ([2405:201:202b:1:3174:ae5c:a49e:4e77]) by smtp.gmail.com with ESMTPSA id z34-20020a631922000000b003f27f91135asm3113289pgl.76.2022.05.17.07.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 07:06:43 -0700 (PDT) From: Vihas Makwana To: Larry Finger , Phillip Potter , Greg Kroah-Hartman , Michael Straube Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Dan Carpenter , Pavel Skripkin , Vihas Makwana Subject: [PATCH v2 2/3] staging: r8188eu: fix warnings in rtw_pwrctrl Date: Tue, 17 May 2022 19:36:25 +0530 Message-Id: <20220517140626.3716-3-makvihas@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220517140626.3716-1-makvihas@gmail.com> References: <20220517140626.3716-1-makvihas@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NO_RDNS_DOTCOM_HELO, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Refactor the code to fix following warnings: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Vihas Makwana --- drivers/staging/r8188eu/core/rtw_pwrctrl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c index 6990808ef..a54d47ba8 100644 --- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c +++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c @@ -59,7 +59,7 @@ int ips_leave(struct adapter *padapter) pwrpriv->rf_pwrstate = rf_on; } - if ((_WEP40_ == psecuritypriv->dot11PrivacyAlgrthm) || (_WEP104_ == psecuritypriv->dot11PrivacyAlgrthm)) { + if ((psecuritypriv->dot11PrivacyAlgrthm == _WEP40_) || (psecuritypriv->dot11PrivacyAlgrthm == _WEP104_)) { set_channel_bwmode(padapter, padapter->mlmeextpriv.cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); for (keyid = 0; keyid < 4; keyid++) { if (pmlmepriv->key_mask & BIT(keyid)) { @@ -198,7 +198,7 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a return; if (pwrpriv->pwr_mode == ps_mode) { - if (PS_MODE_ACTIVE == ps_mode) + if (ps_mode == PS_MODE_ACTIVE) return; if ((pwrpriv->smart_ps == smart_ps) && @@ -356,7 +356,7 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter) pwrctrlpriv->LpsIdleCount = 0; pwrctrlpriv->power_mgnt = padapter->registrypriv.power_mgnt;/* PS_MODE_MIN; */ - pwrctrlpriv->bLeisurePs = PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt; + pwrctrlpriv->bLeisurePs = pwrctrlpriv->power_mgnt != PS_MODE_ACTIVE; pwrctrlpriv->bFwCurrentInPSMode = false; @@ -409,12 +409,12 @@ int rtw_pm_set_lps(struct adapter *padapter, u8 mode) if (mode < PS_MODE_NUM) { if (pwrctrlpriv->power_mgnt != mode) { - if (PS_MODE_ACTIVE == mode) + if (mode == PS_MODE_ACTIVE) LeaveAllPowerSaveMode(padapter); else pwrctrlpriv->LpsIdleCount = 2; pwrctrlpriv->power_mgnt = mode; - pwrctrlpriv->bLeisurePs = PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt; + pwrctrlpriv->bLeisurePs = pwrctrlpriv->power_mgnt != PS_MODE_ACTIVE; } } else { ret = -EINVAL; @@ -432,7 +432,7 @@ int rtw_pm_set_ips(struct adapter *padapter, u8 mode) return 0; } else if (mode == IPS_NONE) { rtw_ips_mode_req(pwrctrlpriv, mode); - if ((padapter->bSurpriseRemoved == 0) && (_FAIL == rtw_pwr_wakeup(padapter))) + if ((padapter->bSurpriseRemoved == 0) && (rtw_pwr_wakeup(padapter) == _FAIL)) return -EFAULT; } else { return -EINVAL; -- 2.30.2