Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp137529iob; Tue, 17 May 2022 21:31:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpsGJhoGcln4/on0iiYa8q3YpvcMkxT1V5hUCEuk1FGucqpqyGTY/wRMq3Vi9CGGFgw6em X-Received: by 2002:a17:903:240f:b0:156:8e81:a0a3 with SMTP id e15-20020a170903240f00b001568e81a0a3mr25129265plo.13.1652848273381; Tue, 17 May 2022 21:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652848273; cv=none; d=google.com; s=arc-20160816; b=Y11A0/HVlTPYET355ebi/qAQ/LdYrFw1HOjrRFqGJc2fUao/uV+AapgRASCNVmRxiX LctyRFz4p2soZxVSAztP4iDe4lstUkISzF7M9S6zUn9+KRFk1/X3C1AuBHmRMMWH5x7Z +Cq8nT9azGKdhpvZlqJIkavbEOvCsze2DmQRZIMaMBzPn0LbK6gxOOrMIKL8l+gTJ0yo 2Tgs4ZpVq1ovUMO6G5Jf4oHEBS/cKhOS6NXtDmZ5CZ68lS9MXt/amUcrW2qaZWP6U1aD Ohi3XncOdzBWOjCUguf0fJzWQKUBy5JVYxn0XK0vIWAI7k5koMI0HeXZtf4QV5wFi+46 lIXw== 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=hvUgUjmvE7sy7yIPoGJaEuswuZK60S9OzDycOOYXOCw=; b=Azgww6CkbU29dwVtyNtFbEeHtuLIzY3Ead9ZlQzfFzWiiecIKqZ3YAlSa2x7qRHj7K rjU/ywRQ8oM0LSOj0Yr71Tqls/RWk5KcovipIgA+bcON4UWNHSO/NQM623LTXky0MCQU E6GKbsH1hjsVP0liWTHiybL+t25PPp8eQZMGQzRLKcQclI6UKZssDBZC/xCXHiJlPYGZ 8RSb27hYPh/QhCP9yLY67VlHMH0SCwll4QA9KpWAEfTQRIpYcARy58XiglJOMPiSB0mw ndy8L+scePrfidztv4QU8yJozfnYLHX/AB2oMC1cUFA6hxwa+p7PjWvecKJqIgI3SG+A 1Erw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LdPgp9vi; 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 bh9-20020a056a02020900b003c6aa1dce5csi1080604pgb.704.2022.05.17.21.31.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:31:13 -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=LdPgp9vi; 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 F26088148B; Tue, 17 May 2022 20:51:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348428AbiEQOGo (ORCPT + 99 others); Tue, 17 May 2022 10:06:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348329AbiEQOGl (ORCPT ); Tue, 17 May 2022 10:06:41 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA3B627FFD for ; Tue, 17 May 2022 07:06:40 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id h186so14392640pgc.3 for ; Tue, 17 May 2022 07:06:40 -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=hvUgUjmvE7sy7yIPoGJaEuswuZK60S9OzDycOOYXOCw=; b=LdPgp9viGlgUoy+Z2wq8QytcD4XRoYj1OTfGDEdNPB2AkOFpjOVE5KjgnQUFn/tQeV gnsYTY4ORDpAmWJf/2cxZAyz+o5eP1TR78crD6oi+oaNmaQEfDK8HGzToaIGHxutC5gd e+4iGkYyqGasM/GUH2ZNqugg/RL57wjcVFPfnopdK1Tw9sg1E3J+BeuKJL4MSajoNQNS 8heGUqM7PTZ3R1HGBc6RAMCQrNmemvItVLdgkjApwNo6T3HXcL/Fiv8Y78wKLnZZ5M8A CImuTuRUMEJQ5YeHDHXsXVQgp6V/+mp/SwRxQzkmnKjHqWP9x6dXCJ2P7X6nQA3O6Fhn 103g== 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=hvUgUjmvE7sy7yIPoGJaEuswuZK60S9OzDycOOYXOCw=; b=1A2o2AxpFlX7m5dseD8U1hL/5foA6StU+zguesE5M+kItOCwsITkvXeM4ggHsS4xSW KHx9cHVAtJvKjQRxUPZTsXxgRMbJ+nODEbh+Xm+7wPO71ljZvGdMaaTSxEObj0j1Nhz2 M1PNlDgJswk3+sTVyZl9JnGctxOY6BK3AqzqT/0rOE5h58bBZKMYPi/sMVbXqWBeKdrr H7iYbk8zwrJevZrn2jE82KqyMIUDOXTQB3wWFubjNrvjT9IQchXQADgKoIprR6Wu++1L +2VMXAMtOhAjR/csZuyczvJSy9ITUWsrLvYSkUS6aPr9Cd3w4DbrO9Iz/BuFNdB5IAFM AAlg== X-Gm-Message-State: AOAM5308eKtKxcjWY2E6WR33mDkrZanSekaP1gglXAJcUJP5JAvO6rFq fJefy1IJhrP/LqhipQguQvs= X-Received: by 2002:a65:428c:0:b0:3db:822e:2163 with SMTP id j12-20020a65428c000000b003db822e2163mr19232498pgp.466.1652796400301; Tue, 17 May 2022 07:06:40 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 07:06:39 -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 1/3] staging: r8188eu: fix warnings in rtw_p2p Date: Tue, 17 May 2022 19:36:24 +0530 Message-Id: <20220517140626.3716-2-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 warning: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Vihas Makwana --- drivers/staging/r8188eu/core/rtw_p2p.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_p2p.c b/drivers/staging/r8188eu/core/rtw_p2p.c index 59bb1bd12..c3884c49b 100644 --- a/drivers/staging/r8188eu/core/rtw_p2p.c +++ b/drivers/staging/r8188eu/core/rtw_p2p.c @@ -872,7 +872,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l } psta->dev_name_len = 0; - if (WPS_ATTR_DEVICE_NAME == be16_to_cpu(*(__be16 *)pattr_content)) { + if (be16_to_cpu(*(__be16 *)pattr_content) == WPS_ATTR_DEVICE_NAME) { dev_name_len = be16_to_cpu(*(__be16 *)(pattr_content + 2)); psta->dev_name_len = (sizeof(psta->dev_name) < dev_name_len) ? sizeof(psta->dev_name) : dev_name_len; @@ -1213,7 +1213,7 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe if (attr_content == P2P_STATUS_SUCCESS) { /* Do nothing. */ } else { - if (P2P_STATUS_FAIL_INFO_UNAVAILABLE == attr_content) { + if (attr_content == P2P_STATUS_FAIL_INFO_UNAVAILABLE) { rtw_p2p_set_state(pwdinfo, P2P_STATE_RX_INFOR_NOREADY); } else { rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_FAIL); @@ -1891,7 +1891,7 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role) if (role == P2P_ROLE_DEVICE || role == P2P_ROLE_CLIENT || role == P2P_ROLE_GO) { /* leave IPS/Autosuspend */ - if (_FAIL == rtw_pwr_wakeup(padapter)) { + if (rtw_pwr_wakeup(padapter) == _FAIL) { ret = _FAIL; goto exit; } @@ -1905,7 +1905,7 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role) init_wifidirect_info(padapter, role); } else if (role == P2P_ROLE_DISABLE) { - if (_FAIL == rtw_pwr_wakeup(padapter)) { + if (rtw_pwr_wakeup(padapter) == _FAIL) { ret = _FAIL; goto exit; } -- 2.30.2