From patchwork Wed Nov 1 15:29:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 10036511 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ACABE603B5 for ; Wed, 1 Nov 2017 15:29:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1ABC28628 for ; Wed, 1 Nov 2017 15:29:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 965832891D; Wed, 1 Nov 2017 15:29:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID, URIBL_BLACK autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45BDB28628 for ; Wed, 1 Nov 2017 15:29:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754667AbdKAP3i (ORCPT ); Wed, 1 Nov 2017 11:29:38 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:43885 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754425AbdKAP3f (ORCPT ); Wed, 1 Nov 2017 11:29:35 -0400 Received: by mail-oi0-f65.google.com with SMTP id c77so5043570oig.0 for ; Wed, 01 Nov 2017 08:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=eG2ppDs0pgd48YDE8u6RZaD9LglLr14uerMg+4KkIeo=; b=P211MPgCPE7IBiuU6O2IRCYFhq9LhYw4WtxZ55KHNdITkssB2Jlt2rp6ZZCUF1doj0 fZI1oRTL6dPcnQdZl5eIep9MoDuAzndoRiRagTxbHDySdPqW+tD9eUTFCairBLht3wp7 TSCbp0TWiul36EHA8T46FM1wFFSsEkulff1l4sI4THjZAQN12K5eav1jSjBgxSPn5Fm0 32hC9vvzdTjQbw/hBV1uPrCiXby3Gczkgn6hTk6OWekSYX5sTQ7cxRfdw+l0DcfNmrh9 IEzKPCbFshvC1bTcyiSMg1HmJ9uqxUOn63/TsPcVHx+EFIY4RKJ3GUG94aBp8XiD+GGV J+nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=eG2ppDs0pgd48YDE8u6RZaD9LglLr14uerMg+4KkIeo=; b=avdhp2QLFSBOn3r9aLjRVAdqudd22ReFlNnjaM7RRGpwnGMlt3Fl7KJVQncEjAyHTP 8wUhSVVFNCwr8QOmdyRh17K0Oy7IJgZ6xk4Uap+Sx+kcXTvFyCHCH2AkZLYwaJOScyZm N3oTO/A6g9NgUsRf7r7SBGC16V4odTqMPVAnSASZFyTq/EfIbJxUNCvjhGVsKMebCgtC bkOFr6xpQVEgM2cnYRM6XWEuJ8rNFq9A/T0eKk7QSm9Ur+A2UNwFgUacPmhD5+PFY/vJ 0FBgvBcpt+4cMX+BiTjEIucmm7vSUXyFiXUYORphMeCHaYo+JmXvJdy3pfrUDUBCaUMc UuDA== X-Gm-Message-State: AJaThX7gbA+xxo6HBPcMWbXWZcyvurSOBc1AHjzohY0J6tVFBqXPNnNw zIjYh2DeQ08OCO01Y7vwH5LC9g== X-Google-Smtp-Source: ABhQp+Tgtq2btBvr/ICjqQbzeOLFosq4rbObq6wH7oHxReqkE96SYk6hV/1pePMOcdlpMMISsXE86A== X-Received: by 10.157.29.231 with SMTP id w36mr99586otw.162.1509550174534; Wed, 01 Nov 2017 08:29:34 -0700 (PDT) Received: from Larrylap.localdomain (cpe-24-31-251-255.kc.res.rr.com. [24.31.251.255]) by smtp.gmail.com with ESMTPSA id v21sm338515ote.49.2017.11.01.08.29.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Nov 2017 08:29:34 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Larry Finger , Ping-Ke Shih , Yan-Hsuan Chuang , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH 03/11] rtlwifi: rtl_pci: Simplify some code be eliminating extraneous variables Date: Wed, 1 Nov 2017 10:29:18 -0500 Message-Id: <20171101152926.24971-4-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171101152926.24971-1-Larry.Finger@lwfinger.net> References: <20171101152926.24971-1-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In several places, the code assigns a variable inside an "if" or "case" block, but uses it only once. The code is simplified by eliminating the extraneous variable. With this change, one level of indenting is saved. This patch does not cause any functional changes in the binary code. Signed-off-by: Larry Finger Cc: Ping-Ke Shih Cc: Yan-Hsuan Chuang Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- drivers/net/wireless/realtek/rtlwifi/pci.c | 35 ++++++++++-------------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c index 7325806e40a2..01c65c807126 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.c +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c @@ -143,32 +143,19 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw) /*Set HW definition to determine if it supports ASPM. */ switch (rtlpci->const_support_pciaspm) { - case 0:{ - /*Not support ASPM. */ - bool support_aspm = false; - ppsc->support_aspm = support_aspm; - break; - } - case 1:{ - /*Support ASPM. */ - bool support_aspm = true; - bool support_backdoor = true; - ppsc->support_aspm = support_aspm; - - /*if (priv->oem_id == RT_CID_TOSHIBA && - !priv->ndis_adapter.amd_l1_patch) - support_backdoor = false; */ - - ppsc->support_backdoor = support_backdoor; - - break; - } + case 0: + /*Not support ASPM. */ + ppsc->support_aspm = false; + break; + case 1: + /*Support ASPM. */ + ppsc->support_aspm = true; + ppsc->support_backdoor = true; + break; case 2: /*ASPM value set by chipset. */ - if (pcibridge_vendor == PCI_BRIDGE_VENDOR_INTEL) { - bool support_aspm = true; - ppsc->support_aspm = support_aspm; - } + if (pcibridge_vendor == PCI_BRIDGE_VENDOR_INTEL) + ppsc->support_aspm = true; break; default: pr_err("switch case %#x not processed\n",