mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 08/10] staging: rtl8192e: Remove used constants MSR_LINK_SH.. and MSR_LINK_N..
Date: Sun, 29 Jan 2023 15:58:49 +0100	[thread overview]
Message-ID: <46bd1f075d5e4d211e1fc827843933907f7fee29.1675003608.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1675003608.git.philipp.g.hortmann@gmail.com>

Remove used constants MSR_LINK_SHIFT = 0 and MSR_LINK_NONE = 0. Use rules
a << 0 = a, 0 << 0 = 0 and msr | 0 = msr to remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 12 +++---------
 drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h  |  2 --
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 1677b6c5d363..62f179f2f174 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -54,22 +54,16 @@ static void _rtl92e_update_msr(struct net_device *dev)
 	switch (priv->rtllib->iw_mode) {
 	case IW_MODE_INFRA:
 		if (priv->rtllib->state == RTLLIB_LINKED)
-			msr |= (MSR_LINK_MANAGED << MSR_LINK_SHIFT);
-		else
-			msr |= (MSR_LINK_NONE << MSR_LINK_SHIFT);
+			msr |= MSR_LINK_MANAGED;
 		LedAction = LED_CTL_LINK;
 		break;
 	case IW_MODE_ADHOC:
 		if (priv->rtllib->state == RTLLIB_LINKED)
-			msr |= (MSR_LINK_ADHOC << MSR_LINK_SHIFT);
-		else
-			msr |= (MSR_LINK_NONE << MSR_LINK_SHIFT);
+			msr |= MSR_LINK_ADHOC;
 		break;
 	case IW_MODE_MASTER:
 		if (priv->rtllib->state == RTLLIB_LINKED)
-			msr |= (MSR_LINK_MASTER << MSR_LINK_SHIFT);
-		else
-			msr |= (MSR_LINK_NONE << MSR_LINK_SHIFT);
+			msr |= MSR_LINK_MASTER;
 		break;
 	default:
 		break;
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
index 13c0e5218ecf..3782db125300 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
@@ -172,8 +172,6 @@ enum _RTL8192Pci_HW {
 	MSR			= 0x303,
 #define MSR_LINK_MASK      ((1<<0)|(1<<1))
 #define MSR_LINK_MANAGED   2
-#define MSR_LINK_NONE      0
-#define MSR_LINK_SHIFT     0
 #define MSR_LINK_ADHOC     1
 #define MSR_LINK_MASTER    3
 
-- 
2.39.1


  parent reply	other threads:[~2023-01-29 14:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-29 14:57 [PATCH 00/10] staging: rtl8192e: Remove unused constants and variables from r8192E_hw.h Philipp Hortmann
2023-01-29 14:57 ` [PATCH 01/10] staging: rtl8192e: Rename TxBBGainTab.., CCKTxBBGainTab.. and RT_CID_81 Philipp Hortmann
2023-01-29 14:58 ` [PATCH 02/10] staging: rtl8192e: Rename sCrcLng Philipp Hortmann
2023-01-29 14:58 ` [PATCH 03/10] staging: rtl8192e: Remove unused variable rxSNRdB Philipp Hortmann
2023-01-29 14:58 ` [PATCH 04/10] staging: rtl8192e: Remove unused constants from enum rt_customer_id Philipp Hortmann
2023-01-29 14:58 ` [PATCH 05/10] staging: rtl8192e: Rename BaseBand_Config_PHY_REG and BaseBand_Config_AGC_TAB Philipp Hortmann
2023-01-29 14:58 ` [PATCH 06/10] staging: rtl8192e: Remove unused constants at beginning of r8192E_hw.h Philipp Hortmann
2023-01-29 14:58 ` [PATCH 07/10] staging: rtl8192e: Remove unused constants in _RTL8192Pci_HW Philipp Hortmann
2023-01-29 14:58 ` Philipp Hortmann [this message]
2023-01-29 14:58 ` [PATCH 09/10] staging: rtl8192e: Rename _RTL8192Pci_HW, MXDMA2_NoLimit and TPPoll Philipp Hortmann
2023-01-29 14:59 ` [PATCH 10/10] staging: rtl8192e: Rename TPPoll_CQ, AcmHwCtrl and AcmHw_BeqEn Philipp Hortmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46bd1f075d5e4d211e1fc827843933907f7fee29.1675003608.git.philipp.g.hortmann@gmail.com \
    --to=philipp.g.hortmann@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®