Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3308434iob; Mon, 16 May 2022 18:55:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycHlVCFJjGOSAt7NtGU3fLPGyq8jgP5FdG21+oZVtUDreZykGqiy+nOkdkXqu5vos30C7a X-Received: by 2002:a17:902:7593:b0:15e:fe5d:58e1 with SMTP id j19-20020a170902759300b0015efe5d58e1mr20420910pll.102.1652752533334; Mon, 16 May 2022 18:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652752533; cv=none; d=google.com; s=arc-20160816; b=k870mHjE11pdbKHB0BKUCVsdispua3GGvp5pLJbjP6or2te71w2Sa/k/Q8W085FNu5 LS4p8MjFHByyNPwM+Cc4D1XNi2+BaZm4gYfQWWEJfQWDBV00iss7Hitti4/60ly1vveq 2xVxa9h02SQHqNXwVyGWIK1z92tRo995Rn/vkDTXViDvfbhxgPrJfu0qJCv7lX0FYUnK LSJpj5PrbaT3sx/jM2d8PXcGadhAHLA6j+vPqSSYCSkeDRNzVfshVjEsugkc+CnoEz0v FQGXteRzCI9FIv7h4QSr27F/K5EHPaRnZwCmGwTbz4k3CrpK+bnjCicuXGzC8s9E/HL5 b6Eg== 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=ju5h7DTQHz5SOfYdWM+q6axpdhAj0pFlziWfY2dOpyz9qKZ+sPBCaO/f7Xtj0DOMva k+E2TwjhDF8MaXbuQPOMVnZ+TVGeQrURSJvStJO9N54RgT3Sb5v9+RyXbjOQoBWjcdwU BDIxrtlwykcp9Maq1skDCo1lqA0pjMH60KFui8c3DIt4os3I5q+NYkvtPCo/yu5vDLEG 7JxAUWXl8LdBR5sWzEQfRNg0avIDm4TQNghPCWlxLAkED/lXcrrR9GYz4mXrXNYsKYEQ KiXtv9z9jLnR+7PksqKRnakbXSvkYv3nY05VGWsjzwj1/09yqRZkCW3SV9eRiZRHHsbw U38Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QAOmnexk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p7-20020a056a000b4700b0050a8eece442si15876710pfo.15.2022.05.16.18.55.21; Mon, 16 May 2022 18:55:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QAOmnexk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344096AbiEPREo (ORCPT + 99 others); Mon, 16 May 2022 13:04:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344076AbiEPREh (ORCPT ); Mon, 16 May 2022 13:04:37 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D303255B5 for ; Mon, 16 May 2022 10:04:36 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id i17so15004477pla.10 for ; Mon, 16 May 2022 10:04:36 -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=QAOmnexkaoqNsviKOMfuSuZVNMVGMjr83P8AXqth1R9RNk17459XGSTTqsa0119IPz FhzqQYXi0OgmH3NWe7MaYnxI1o8h2ecD8CFunYTqjSrrjA04ckAmKYJJaf8yknIBSvZP 9L3UOrRAoSIg3nEvLFf8mczdQM3OTWsZi0aszJ9dR59EAxRBa45Lx1NgdRLkeqUJ2Qgm KFTLTVmKLOF8FGviGrf5Kw75+hy0Pfoi8S3Gvpx5UdcNTejinezKN5gqrwlZHAYRZn9i PmA96uEPGjzvSiMJYI5X4CQKjWJfC2uRbWV2gcsetcuQY1+Zpokeg5ndIihrZuRrYhvt 1JBg== 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=S7WDj4O4TNjVAuHjrs/Hdef2/zJSp2oaUNaPgbb61xfi22j6pPgTmYxsuELkuoDkH9 5ol0LyRGoKwKgm/Bg3FMe1d2ii60/Nea1HD3SdNdn2ueA7GlMPominj1SuGkoFjBEhOf fjP8hIj3xaYRe/SSj9aamR90njNL+KSex/l3S5Bj6Kk5fAByvOvIuzucdQ+0spXkqh7j kySl0cuLmn9FOU51SPFokrj/kz3iGkhb9rlRLSqhnj6yMhz+ucpOCVATu+t2o33mwcTC nj7onN8adkPAGfAatFNzCmndffv+DMQcWZSeovTBvb9WRV23NQepbIM4QdUzZYQzDlZ8 xPBw== X-Gm-Message-State: AOAM532tH1Zk1MDXUoLm96TVt5XM6nwhlmWPEjcNvJDoay7DAQa6rXl9 qP7/bUy6Mo9381nkMPi+eBY= X-Received: by 2002:a17:902:76cb:b0:15e:e178:e2eb with SMTP id j11-20020a17090276cb00b0015ee178e2ebmr18430608plt.0.1652720674692; Mon, 16 May 2022 10:04:34 -0700 (PDT) Received: from makvihas.localhost.com ([2405:201:202b:1:6465:4732:de67:bb26]) by smtp.gmail.com with ESMTPSA id b190-20020a621bc7000000b0050dc762819csm7141292pfb.118.2022.05.16.10.04.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 May 2022 10:04:34 -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 2/3] staging: r8188eu: fix checkpatch.pl warnings in rtw_pwrctrl Date: Mon, 16 May 2022 22:33:05 +0530 Message-Id: <20220516170306.6008-3-makvihas@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220516170306.6008-1-makvihas@gmail.com> References: <20220516170306.6008-1-makvihas@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, NO_RDNS_DOTCOM_HELO,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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