Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5971011pxb; Mon, 8 Nov 2021 00:55:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxm522L7P9BBrWSrvM7/dtJJrgNFBWJx8bONRPFlbZ8rXcLU2gJhPVaBMzMQtSCJYE2Vffy X-Received: by 2002:a05:6402:51cb:: with SMTP id r11mr37654247edd.45.1636361733020; Mon, 08 Nov 2021 00:55:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636361733; cv=none; d=google.com; s=arc-20160816; b=kKNPraI8qmFjYaDLo5bEkRuvDPNdTAKZRJvEqA5je84RboHQiCJFus2BP2M9rm7vqn Mcrbc3vIrAAIAgTRlf3GzB4Rh59gAkvicj5RLIHi1Dtp4eia9EJm5QcEEPHoUAQbtXbZ f9EltOOHiPr8U5O3WeXDPvpIDYVuOIbZMD8y8rfHw82RS4PZhTZ+6cuq9nT843mwgarf ImkHHgtg0PINDR1a4QeCvSjbaEb6Y82SBjNcSi8pAqjxKODhDxljqqJrG0bXqgs3k9jA 5V8vhVcLqoo7AVxqiOTvQS+45IfNEu+tg1XZJ7Z5EBIzH12x8hIMhPZVEKL2o7Hl8lyB XIoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=+r5v0Qkb9CskeIUp24NWApH4et+2cF4LENwGR9mkgPI=; b=icEc4jLlqQ3URY+c5LyGeZ6JdR/ZGo3FZSBcPVFyzu9xpFcZvzPavkYY1HMEf4ij55 2VgVVtiAZU0Bjxr/XZCfopCD/rLW8Va5vkwDqYmd2N2HMsWVrmSmif/z91kyeoPv9Clt TzeebA8HWHcz8RdNiAWhDLA/s8GGs8Vz93hnG2OCB6N5FjRz4nanGOnNirVD9PV3xrGx XQ++ibgPfw/JFLd2JaqzVCaTdXZVXi+N+ZBtW7OUzclO/HnHD/F2S94QS8JwKtdt9bFK DrXo9oncyNAbjn3ZjtpjnbQxg1xJiqNCPA3PyC78/isI4WIDPuR1nhsvEcKvb/xJM3I+ 1KxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ksG9H0mH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sd5si32631492ejc.8.2021.11.08.00.54.26; Mon, 08 Nov 2021 00:55:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ksG9H0mH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233254AbhKHEOS (ORCPT + 99 others); Sun, 7 Nov 2021 23:14:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233833AbhKHEOR (ORCPT ); Sun, 7 Nov 2021 23:14:17 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0101C061570 for ; Sun, 7 Nov 2021 20:11:33 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id b13so14958126plg.2 for ; Sun, 07 Nov 2021 20:11:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=+r5v0Qkb9CskeIUp24NWApH4et+2cF4LENwGR9mkgPI=; b=ksG9H0mH9ezpfVFJemUARGntpLmJtB5sxcqfrOAB/mZdHKhslGOm+2IuFcHiDsOECb EYJ+OKS+sZX/WgZpFpz25MEQ/2OIZJw7yeFTy+cDwhN7o3Tq/iEx0QYIeAtQH1D8IIOB IbbIsDVMOANo9VjiHIxLJe9XsstPt1CeZrirXXbygFhIEva4C+JNDVwfh0N6WlwnO4Pw pgsxH0RNYxGDn2mCwKAzBi6IZJAOl7fiAbN8vDxi9zuLe8ZhKPmVrnsrh1bmu+WP0lYc 7VnB+IThKaCJJ/Goz4R0rlPd70PAF3UXzaxD/NsMFSJWLb28zPv6I/tNaLE1dz8KKpUP 8YlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=+r5v0Qkb9CskeIUp24NWApH4et+2cF4LENwGR9mkgPI=; b=sccLzGzjDlYAsVRO233N2G0uhbL1ZhZwMyK961Uovmp/7SGpOLYlA51Vm0CV0lcWiH CjIZ1hIQldvsIsYwKhtDFHYB/a3nyqHheMh1TItOQKAgBExiNsALETyCqYQZZpCTPVrO KTZ+2GygCeVcE4mLd/EfFRegO+tlgdfiEZ02INNTaIjcuqKDHeV1th3Ydsejpt6xr6d7 XGAQhsjX3szwXEZH0VWE3e5+d6Q9RkZQIBphPYlzjZ3N5kaUL+Xz7blWdXfpX3wcU+8u xQmjKrPGdxhS7RVdylSKjwS7pTHiju36jhjoGa8qcnkcIoG8V9pnWMRcZsiYA8sSnzkx zZ7A== X-Gm-Message-State: AOAM531TXdDZBAGpCRQitzi2NozS+CLYnF6Ib21TH7pkYe5n4qln/dA6 8KsnjEI5oqGG8wp6qD643rzhP34DpGWqMg== X-Received: by 2002:a17:90a:eb03:: with SMTP id j3mr48831736pjz.149.1636344693335; Sun, 07 Nov 2021 20:11:33 -0800 (PST) Received: from Sauravs-MacBook-Air.local ([59.88.109.27]) by smtp.gmail.com with ESMTPSA id k1sm5684400pfu.31.2021.11.07.20.11.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 20:11:32 -0800 (PST) Date: Mon, 8 Nov 2021 09:41:22 +0530 From: Saurav Girepunje To: gregkh@linuxfoundation.org, kuba@kernel.org, lee.jones@linaro.org, saurav.girepunje@gmail.com, nathan@kernel.org, clrrm@isep.ipp.pt, johan@kernel.org, dinghao.liu@zju.edu.cn, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Cc: saurav.girepunje@hotmail.com Subject: [PATCH] staging: rtl8192u: remove the if condition without effect Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In function rtl8192_adapter_start priv->pFirmware->firmware_status is assign to FW_STATUS_0_INIT just after assignment variable is again get check for same value. Therefore if condition will be always be true. So remove the if condition ,else if section and else section which will never get execute. Signed-off-by: Saurav Girepunje --- drivers/staging/rtl8192u/r8192U_core.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 726d7ad9408b..f5d9e81f4ac7 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -2666,14 +2666,7 @@ static bool rtl8192_adapter_start(struct net_device *dev) /* config CPUReset Register */ /* Firmware Reset or not? */ read_nic_dword(dev, CPU_GEN, &dwRegRead); - if (priv->pFirmware->firmware_status == FW_STATUS_0_INIT) - dwRegRead |= CPU_GEN_SYSTEM_RESET; /* do nothing here? */ - else if (priv->pFirmware->firmware_status == FW_STATUS_5_READY) - dwRegRead |= CPU_GEN_FIRMWARE_RESET; - else - RT_TRACE(COMP_ERR, - "ERROR in %s(): undefined firmware state(%d)\n", - __func__, priv->pFirmware->firmware_status); + dwRegRead |= CPU_GEN_SYSTEM_RESET; /* do nothing here? */ write_nic_dword(dev, CPU_GEN, dwRegRead); /* config BB. */ -- 2.33.0