[PATCH 03/12] staging: wlan-ng: shorten names of "DIDMIB_DOT11SMT_" macros

Tim Collier osdevtc at gmail.com
Tue Aug 28 19:26:14 UTC 2018


Shorten the names of the p80211metadef.h macros prefixed with
"DIDMIB_DOT11SMT_" (also in lower-case) by removing repeat use of
"DOT11" to reduce long lines and ease readabbility.

Signed-off-by: Tim Collier <osdevtc at gmail.com>
---
 drivers/staging/wlan-ng/cfg80211.c      | 20 ++++++++++----------
 drivers/staging/wlan-ng/p80211metadef.h | 14 +++++++-------
 drivers/staging/wlan-ng/p80211req.c     | 14 +++++++-------
 drivers/staging/wlan-ng/prism2mib.c     | 14 +++++++-------
 4 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c
index 9cab95fca5ea..8a1f62d22cf4 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -158,12 +158,12 @@ static int prism2_add_key(struct wiphy *wiphy, struct net_device *dev,
 	}
 
 	if (prism2_domibset_uint32(wlandev,
-				   DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11WEPDEFAULTKEYID,
+				   DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID,
 				   key_index))
 		return -EFAULT;
 
 	/* send key to driver */
-	did = didmib_dot11smt_dot11wepdefaultkeystable_key(key_index + 1);
+	did = didmib_dot11smt_wepdefaultkeystable_key(key_index + 1);
 
 	if (prism2_domibset_pstr32(wlandev, did, params->key_len, params->key))
 		return -EFAULT;
@@ -216,7 +216,7 @@ static int prism2_del_key(struct wiphy *wiphy, struct net_device *dev,
 		return -EINVAL;
 
 	/* send key to driver */
-	did = didmib_dot11smt_dot11wepdefaultkeystable_key(key_index + 1);
+	did = didmib_dot11smt_wepdefaultkeystable_key(key_index + 1);
 	result = prism2_domibset_pstr32(wlandev, did, 13, "0000000000000");
 
 	if (result)
@@ -234,7 +234,7 @@ static int prism2_set_default_key(struct wiphy *wiphy, struct net_device *dev,
 	int result = 0;
 
 	result = prism2_domibset_uint32(wlandev,
-		DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11WEPDEFAULTKEYID,
+		DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID,
 		key_index);
 
 	if (result)
@@ -482,13 +482,13 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev,
 			}
 
 			result = prism2_domibset_uint32(wlandev,
-				DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11WEPDEFAULTKEYID,
+				DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID,
 				sme->key_idx);
 			if (result)
 				goto exit;
 
 			/* send key to driver */
-			did = didmib_dot11smt_dot11wepdefaultkeystable_key(
+			did = didmib_dot11smt_wepdefaultkeystable_key(
 					sme->key_idx + 1);
 			result = prism2_domibset_pstr32(wlandev,
 							did, sme->key_len,
@@ -502,13 +502,13 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev,
 		 * seems reasonable anyways
 		 */
 		result = prism2_domibset_uint32(wlandev,
-						DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11PRIVACYINVOKED,
+						DIDMIB_DOT11SMT_PRIVACYTABLE_PRIVACYINVOKED,
 						P80211ENUM_truth_true);
 		if (result)
 			goto exit;
 
 		result = prism2_domibset_uint32(wlandev,
-						DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11EXCLUDEUNENCRYPTED,
+						DIDMIB_DOT11SMT_PRIVACYTABLE_EXCLUDEUNENCRYPTED,
 						P80211ENUM_truth_true);
 		if (result)
 			goto exit;
@@ -518,13 +518,13 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev,
 		 * and exclude unencrypted
 		 */
 		result = prism2_domibset_uint32(wlandev,
-						DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11PRIVACYINVOKED,
+						DIDMIB_DOT11SMT_PRIVACYTABLE_PRIVACYINVOKED,
 						P80211ENUM_truth_false);
 		if (result)
 			goto exit;
 
 		result = prism2_domibset_uint32(wlandev,
-						DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11EXCLUDEUNENCRYPTED,
+						DIDMIB_DOT11SMT_PRIVACYTABLE_EXCLUDEUNENCRYPTED,
 						P80211ENUM_truth_false);
 		if (result)
 			goto exit;
diff --git a/drivers/staging/wlan-ng/p80211metadef.h b/drivers/staging/wlan-ng/p80211metadef.h
index c7b96b72ab4a..e3dacf6d0a9a 100644
--- a/drivers/staging/wlan-ng/p80211metadef.h
+++ b/drivers/staging/wlan-ng/p80211metadef.h
@@ -153,24 +153,24 @@
 			P80211DID_MKGROUP(14))
 #define DIDMIB_CAT_DOT11SMT \
 			P80211DID_MKSECTION(1)
-#define DIDMIB_DOT11SMT_DOT11WEPDEFAULTKEYSTABLE \
+#define DIDMIB_DOT11SMT_WEPDEFAULTKEYSTABLE \
 			(P80211DID_MKSECTION(1) | \
 			P80211DID_MKGROUP(4))
-#define didmib_dot11smt_dot11wepdefaultkeystable_key(_i) \
-			(DIDMIB_DOT11SMT_DOT11WEPDEFAULTKEYSTABLE | \
+#define didmib_dot11smt_wepdefaultkeystable_key(_i) \
+			(DIDMIB_DOT11SMT_WEPDEFAULTKEYSTABLE | \
 			P80211DID_MKITEM(_i) | 0x0c000000)
-#define DIDMIB_DOT11SMT_DOT11PRIVACYTABLE \
+#define DIDMIB_DOT11SMT_PRIVACYTABLE \
 			(P80211DID_MKSECTION(1) | \
 			P80211DID_MKGROUP(6))
-#define DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11PRIVACYINVOKED \
+#define DIDMIB_DOT11SMT_PRIVACYTABLE_PRIVACYINVOKED \
 			(P80211DID_MKSECTION(1) | \
 			P80211DID_MKGROUP(6) | \
 			P80211DID_MKITEM(1) | 0x18000000)
-#define DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11WEPDEFAULTKEYID \
+#define DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID \
 			(P80211DID_MKSECTION(1) | \
 			P80211DID_MKGROUP(6) | \
 			P80211DID_MKITEM(2) | 0x18000000)
-#define DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11EXCLUDEUNENCRYPTED \
+#define DIDMIB_DOT11SMT_PRIVACYTABLE_EXCLUDEUNENCRYPTED \
 			(P80211DID_MKSECTION(1) | \
 			P80211DID_MKGROUP(6) | \
 			P80211DID_MKITEM(4) | 0x18000000)
diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c
index 4e30bc29175a..d87076dbc556 100644
--- a/drivers/staging/wlan-ng/p80211req.c
+++ b/drivers/staging/wlan-ng/p80211req.c
@@ -206,17 +206,17 @@ static void p80211req_mibset_mibget(struct wlandevice *wlandev,
 
 	switch (mibitem->did) {
 
-	case didmib_dot11smt_dot11wepdefaultkeystable_key(1):
-	case didmib_dot11smt_dot11wepdefaultkeystable_key(2):
-	case didmib_dot11smt_dot11wepdefaultkeystable_key(3):
-	case didmib_dot11smt_dot11wepdefaultkeystable_key(4):
+	case didmib_dot11smt_wepdefaultkeystable_key(1):
+	case didmib_dot11smt_wepdefaultkeystable_key(2):
+	case didmib_dot11smt_wepdefaultkeystable_key(3):
+	case didmib_dot11smt_wepdefaultkeystable_key(4):
 		if (!isget)
 			wep_change_key(wlandev,
 				       P80211DID_ITEM(mibitem->did) - 1,
 				       key, pstr->len);
 		break;
 
-	case DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11WEPDEFAULTKEYID:{
+	case DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID:{
 		u32 *data = (u32 *)mibitem->data;
 
 		if (isget) {
@@ -227,14 +227,14 @@ static void p80211req_mibset_mibget(struct wlandevice *wlandev,
 		}
 	break;
 	}
-	case DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11PRIVACYINVOKED:{
+	case DIDMIB_DOT11SMT_PRIVACYTABLE_PRIVACYINVOKED:{
 		u32 *data = (u32 *)mibitem->data;
 
 		p80211req_handle_action(wlandev, data, isget,
 					HOSTWEP_PRIVACYINVOKED);
 	break;
 	}
-	case DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11EXCLUDEUNENCRYPTED:{
+	case DIDMIB_DOT11SMT_PRIVACYTABLE_EXCLUDEUNENCRYPTED:{
 		u32 *data = (u32 *)mibitem->data;
 
 		p80211req_handle_action(wlandev, data, isget,
diff --git a/drivers/staging/wlan-ng/prism2mib.c b/drivers/staging/wlan-ng/prism2mib.c
index 6fd6fd932738..af37b52f301e 100644
--- a/drivers/staging/wlan-ng/prism2mib.c
+++ b/drivers/staging/wlan-ng/prism2mib.c
@@ -148,31 +148,31 @@ static int prism2mib_priv(struct mibrec *mib,
 
 static struct mibrec mibtab[] = {
 	/* dot11smt MIB's */
-	{didmib_dot11smt_dot11wepdefaultkeystable_key(1),
+	{didmib_dot11smt_wepdefaultkeystable_key(1),
 	 F_STA | F_WRITE,
 	 HFA384x_RID_CNFWEPDEFAULTKEY0, 0, 0,
 	 prism2mib_wepdefaultkey},
-	{didmib_dot11smt_dot11wepdefaultkeystable_key(2),
+	{didmib_dot11smt_wepdefaultkeystable_key(2),
 	 F_STA | F_WRITE,
 	 HFA384x_RID_CNFWEPDEFAULTKEY1, 0, 0,
 	 prism2mib_wepdefaultkey},
-	{didmib_dot11smt_dot11wepdefaultkeystable_key(3),
+	{didmib_dot11smt_wepdefaultkeystable_key(3),
 	 F_STA | F_WRITE,
 	 HFA384x_RID_CNFWEPDEFAULTKEY2, 0, 0,
 	 prism2mib_wepdefaultkey},
-	{didmib_dot11smt_dot11wepdefaultkeystable_key(4),
+	{didmib_dot11smt_wepdefaultkeystable_key(4),
 	 F_STA | F_WRITE,
 	 HFA384x_RID_CNFWEPDEFAULTKEY3, 0, 0,
 	 prism2mib_wepdefaultkey},
-	{DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11PRIVACYINVOKED,
+	{DIDMIB_DOT11SMT_PRIVACYTABLE_PRIVACYINVOKED,
 	 F_STA | F_READ | F_WRITE,
 	 HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_PRIVINVOKED, 0,
 	 prism2mib_privacyinvoked},
-	{DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11WEPDEFAULTKEYID,
+	{DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID,
 	 F_STA | F_READ | F_WRITE,
 	 HFA384x_RID_CNFWEPDEFAULTKEYID, 0, 0,
 	 prism2mib_uint32},
-	{DIDMIB_DOT11SMT_DOT11PRIVACYTABLE_DOT11EXCLUDEUNENCRYPTED,
+	{DIDMIB_DOT11SMT_PRIVACYTABLE_EXCLUDEUNENCRYPTED,
 	 F_STA | F_READ | F_WRITE,
 	 HFA384x_RID_CNFWEPFLAGS, HFA384x_WEPFLAGS_EXCLUDE, 0,
 	 prism2mib_excludeunencrypted},
-- 
2.11.0



More information about the devel mailing list