From patchwork Mon Jun 23 22:07:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 4405041 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 449509F387 for ; Mon, 23 Jun 2014 22:06:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 67A7320136 for ; Mon, 23 Jun 2014 22:06:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88A052010F for ; Mon, 23 Jun 2014 22:06:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753523AbaFWWGP (ORCPT ); Mon, 23 Jun 2014 18:06:15 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:44641 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751200AbaFWWGN (ORCPT ); Mon, 23 Jun 2014 18:06:13 -0400 Received: by mail-we0-f178.google.com with SMTP id x48so7671437wes.37 for ; Mon, 23 Jun 2014 15:06:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JGOL1b+WTzW3XswcBaC+icel/hk2s5YCarTaRQiDg2s=; b=c8sA5aOI1tgnb8lt2VkKKbPAw9X4agJlTPXLwMKha2kzDqvyRGY8ppWT5nXturnfKZ gDaLpCRl4K6/XjcYKQbYMS/M64t3Djd66oZpxaGDOxhuT5mREjXFel4b+0bPp9sO89L8 Y3wa2TXQXcLIMUd1Vg14zp1isG99Q+2V1G7QsvzvfHtz1vgqZb8RNSz2Nm00Q6w1uJu4 aDaAwiPYrlYaZy5ArH2sxZnIwJf8eXvO1ArHIter1sCdVEQP5RZD1BGola/x2uW0WqKB otjdmDXamBZil5sGvS6nFZ2LdUhV3+1kWIb5KfJzGHEeLEGFr9+DL2ORvlgso7wuTrOo MKqQ== X-Gm-Message-State: ALoCoQmN0hJgVxhOFeaR7uL1c4rAzOY896GpvnmFQ8bTqALthMBt930I3hYu5aiuK7zk/vuM6zwZ X-Received: by 10.180.84.226 with SMTP id c2mr29315208wiz.50.1403561172658; Mon, 23 Jun 2014 15:06:12 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id nb8sm37157670wic.18.2014.06.23.15.06.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jun 2014 15:06:11 -0700 (PDT) From: Rickard Strandqvist To: Larry Finger , Chaoming Li Cc: Rickard Strandqvist , "John W. Linville" , Ben Hutchings , Peter Wu , Mark Cave-Ayland , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCHv3 5/6] rtlwifi/rtl8723be: Replace magic number by macro Date: Tue, 24 Jun 2014 00:07:13 +0200 Message-Id: <1403561233-7997-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For consistency with other drivers, replace a magic number by a macro. Signed-off-by: Rickard Strandqvist Reviewed-by: Peter Wu --- drivers/net/wireless/rtlwifi/rtl8723be/hw.c | 2 +- drivers/net/wireless/rtlwifi/rtl8723be/reg.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/rtlwifi/rtl8723be/hw.c index 0fdf090..bf883cb 100644 --- a/drivers/net/wireless/rtlwifi/rtl8723be/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8723be/hw.c @@ -1197,7 +1197,7 @@ static int _rtl8723be_set_media_status(struct ieee80211_hw *hw, } rtl_write_byte(rtlpriv, (MSR), bt_msr); rtlpriv->cfg->ops->led_control(hw, ledaction); - if ((bt_msr & 0x03) == MSR_AP) + if ((bt_msr & MSR_MASK) == MSR_AP) rtl_write_byte(rtlpriv, REG_BCNTCFG + 1, 0x00); else rtl_write_byte(rtlpriv, REG_BCNTCFG + 1, 0x66); diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/reg.h b/drivers/net/wireless/rtlwifi/rtl8723be/reg.h index 4c653fa..3006849 100644 --- a/drivers/net/wireless/rtlwifi/rtl8723be/reg.h +++ b/drivers/net/wireless/rtlwifi/rtl8723be/reg.h @@ -412,6 +412,7 @@ #define MSR_ADHOC 0x01 #define MSR_INFRA 0x02 #define MSR_AP 0x03 +#define MSR_MASK 0x03 #define RRSR_RSC_OFFSET 21 #define RRSR_SHORT_OFFSET 23