linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Straube <straube.linux@gmail.com>
To: gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Michael Straube <straube.linux@gmail.com>
Subject: [PATCH v2 11/17] staging: rtl8188eu: constify some arrays
Date: Tue, 18 Dec 2018 19:34:45 +0100	[thread overview]
Message-ID: <20181218183451.18692-11-straube.linux@gmail.com> (raw)
In-Reply-To: <20181218183451.18692-1-straube.linux@gmail.com>

The values of these arrays in rtw_mlme_ext.c and rtw_wlan_util.c
are never changed, so make them const.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 14 +++++-----
 .../staging/rtl8188eu/core/rtw_wlan_util.c    | 26 +++++++++----------
 drivers/staging/rtl8188eu/include/rtw_mlme.h  |  4 +--
 .../staging/rtl8188eu/include/rtw_mlme_ext.h  | 10 +++----
 4 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index dd1280eb3355..ade4045bab45 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -22,15 +22,15 @@ static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
 /**************************************************
 OUI definitions for the vendor specific IE
 ***************************************************/
-u8 RTW_WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
-u8 WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02};
-u8 WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
-u8 P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09};
+const u8 RTW_WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
+const u8 WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02};
+const u8 WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
+const u8 P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09};
 
-u8 WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
+const u8 WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
 
-u8 WPA_TKIP_CIPHER[4] = {0x00, 0x50, 0xf2, 0x02};
-u8 RSN_TKIP_CIPHER[4] = {0x00, 0x0f, 0xac, 0x02};
+const u8 WPA_TKIP_CIPHER[4] = {0x00, 0x50, 0xf2, 0x02};
+const u8 RSN_TKIP_CIPHER[4] = {0x00, 0x0f, 0xac, 0x02};
 
 /********************************************************
 MCS rate definitions
diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 484bb41b25cc..d18ce3a76c95 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -12,18 +12,18 @@
 #include <drv_types.h>
 #include <wifi.h>
 
-static u8 ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f};
-static u8 ARTHEROS_OUI2[] = {0x00, 0x13, 0x74};
+static const u8 ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f};
+static const u8 ARTHEROS_OUI2[] = {0x00, 0x13, 0x74};
 
-static u8 BROADCOM_OUI1[] = {0x00, 0x10, 0x18};
-static u8 BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7};
+static const u8 BROADCOM_OUI1[] = {0x00, 0x10, 0x18};
+static const u8 BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7};
 
-static u8 CISCO_OUI[] = {0x00, 0x40, 0x96};
-static u8 MARVELL_OUI[] = {0x00, 0x50, 0x43};
-static u8 RALINK_OUI[] = {0x00, 0x0c, 0x43};
-static u8 REALTEK_OUI[] = {0x00, 0xe0, 0x4c};
-static u8 AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5};
-static u8 EPIGRAM_OUI[] = {0x00, 0x90, 0x4c};
+static const u8 CISCO_OUI[] = {0x00, 0x40, 0x96};
+static const u8 MARVELL_OUI[] = {0x00, 0x50, 0x43};
+static const u8 RALINK_OUI[] = {0x00, 0x0c, 0x43};
+static const u8 REALTEK_OUI[] = {0x00, 0xe0, 0x4c};
+static const u8 AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5};
+static const u8 EPIGRAM_OUI[] = {0x00, 0x90, 0x4c};
 
 u8 REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20};
 
@@ -33,20 +33,20 @@ u8 REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20};
 #define WAIT_FOR_BCN_TO_MIN	(6000)
 #define WAIT_FOR_BCN_TO_MAX	(20000)
 
-static u8 rtw_basic_rate_cck[4] = {
+static const u8 rtw_basic_rate_cck[4] = {
 	IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK,
 	IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
 	IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK,
 	IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK
 };
 
-static u8 rtw_basic_rate_ofdm[3] = {
+static const u8 rtw_basic_rate_ofdm[3] = {
 	IEEE80211_OFDM_RATE_6MB | IEEE80211_BASIC_RATE_MASK,
 	IEEE80211_OFDM_RATE_12MB | IEEE80211_BASIC_RATE_MASK,
 	IEEE80211_OFDM_RATE_24MB | IEEE80211_BASIC_RATE_MASK
 };
 
-static u8 rtw_basic_rate_mix[7] = {
+static const u8 rtw_basic_rate_mix[7] = {
 	IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK,
 	IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
 	IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK,
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h
index 090191fcae0a..bfef66525944 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h
@@ -211,8 +211,8 @@ int hostapd_mode_init(struct adapter *padapter);
 void hostapd_mode_unload(struct adapter *padapter);
 #endif
 
-extern u8 WPA_TKIP_CIPHER[4];
-extern u8 RSN_TKIP_CIPHER[4];
+extern const u8 WPA_TKIP_CIPHER[4];
+extern const u8 RSN_TKIP_CIPHER[4];
 extern u8 REALTEK_96B_IE[];
 extern const u8 MCS_rate_1R[16];
 
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
index a2d9d5307179..08151a175d6e 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
@@ -81,12 +81,12 @@
 #define		_54M_RATE_	11
 
 
-extern u8 RTW_WPA_OUI[];
-extern u8 WMM_OUI[];
-extern u8 WPS_OUI[];
-extern u8 P2P_OUI[];
+extern const u8 RTW_WPA_OUI[];
+extern const u8 WMM_OUI[];
+extern const u8 WPS_OUI[];
+extern const u8 P2P_OUI[];
 
-extern u8 WMM_PARA_OUI[];
+extern const u8 WMM_PARA_OUI[];
 
 /*  Channel Plan Type. */
 /*  Note: */
-- 
2.20.1


  parent reply	other threads:[~2018-12-18 18:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 18:34 [PATCH v2 01/17] staging: rtl8188eu: cleanup declarations in rtw_mlme_ext.c Michael Straube
2018-12-18 18:34 ` [PATCH v2 02/17] staging: rtl8188eu: replace tabs with spaces " Michael Straube
2018-12-18 18:34 ` [PATCH v2 03/17] staging: rtl8188eu: remove commented declarations " Michael Straube
2018-12-18 18:34 ` [PATCH v2 04/17] staging: rtl8188eu: remove blank lines between declarations Michael Straube
2018-12-18 18:34 ` [PATCH v2 05/17] staging: rtl8188eu: add blank line after declarations Michael Straube
2018-12-18 18:34 ` [PATCH v2 06/17] staging: rtl8188eu: remove unnecessary comments in rtw_mlme_ext.c Michael Straube
2018-12-18 18:34 ` [PATCH v2 07/17] staging: rtl8188eu: remove unnecessary parentheses " Michael Straube
2018-12-18 18:34 ` [PATCH v2 08/17] staging: rtl8188eu: remove unused arrays WFD_OUI and WMM_INFO_OUI Michael Straube
2018-12-18 18:34 ` [PATCH v2 09/17] staging: rtl8188eu: remove redundant declaration in rtw_mlme_ext.c Michael Straube
2018-12-18 18:34 ` [PATCH v2 10/17] staging: rtl8188eu: convert unsigned char arrays to u8 Michael Straube
2018-12-18 18:34 ` Michael Straube [this message]
2018-12-18 18:34 ` [PATCH v2 12/17] staging: rtl8188eu: make some arrays static in rtw_mlme_ext.c Michael Straube
2018-12-18 18:34 ` [PATCH v2 13/17] staging: rtl8188eu: change order of declarations to improve readability Michael Straube
2018-12-18 18:34 ` [PATCH v2 14/17] staging: rtl8188eu: simplify null array initializations Michael Straube
2018-12-19  7:32   ` Greg KH
2018-12-18 18:34 ` [PATCH v2 15/17] staging: rtl8188eu: change return type of is_basicrate() to bool Michael Straube
2018-12-18 18:34 ` [PATCH v2 16/17] staging: rtl8188eu: add spaces around '&' in rtw_mlme_ext.c Michael Straube
2018-12-18 18:34 ` [PATCH v2 17/17] staging: rtl8188eu: cleanup brace coding style issues Michael Straube

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=20181218183451.18692-11-straube.linux@gmail.com \
    --to=straube.linux@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).