* [PATCH 0/5] staging: vt6656: Cleanup in usage of macros
@ 2012-07-09 1:55 Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 1/5] staging: vt6656: desc.h: Remove commented macros and useless comments Marcos Paulo de Souza
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09 1:55 UTC (permalink / raw)
To: gregkh
Cc: andriy.shevchenko, jj, forest, devel, linux-kernel,
Marcos Paulo de Souza
Hi kernel guys!
This patchset aims to clean all the macros from vt6656 driver.
With the forgotten-macros tool(https://github.com/marcosps/forgotten_macros), we
can find all unused macros, commented macros and a little more. :)
As I don't have the hardware, I will be grateful if anyone could test theses
changes.
All the changes were based in staging-next tree.
Comments are welcome!
Marcos Paulo de Souza (5):
staging: vt6656: desc.h: Remove commented macros and useless comments
staging: vt6656: hostap.c: Remove unused macros and some useless
comments
staging: vt6656: hostap.c: Remove commented code
staging: vt6656: Remove all commented macros
staging: vt6656: Remove unsed macros
drivers/staging/vt6656/80211hdr.h | 2 --
drivers/staging/vt6656/bssdb.h | 2 --
drivers/staging/vt6656/card.c | 1 -
drivers/staging/vt6656/card.h | 1 -
drivers/staging/vt6656/channel.c | 2 --
drivers/staging/vt6656/desc.h | 19 -----------
drivers/staging/vt6656/device.h | 4 ---
drivers/staging/vt6656/hostap.c | 63 -------------------------------------
drivers/staging/vt6656/main_usb.c | 5 ---
drivers/staging/vt6656/mib.h | 1 -
drivers/staging/vt6656/rxtx.c | 2 --
drivers/staging/vt6656/tether.h | 2 --
drivers/staging/vt6656/usbpipe.c | 3 --
13 files changed, 107 deletions(-)
--
1.7.10.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] staging: vt6656: desc.h: Remove commented macros and useless comments
2012-07-09 1:55 [PATCH 0/5] staging: vt6656: Cleanup in usage of macros Marcos Paulo de Souza
@ 2012-07-09 1:55 ` Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 2/5] staging: vt6656: hostap.c: Remove unused macros and some " Marcos Paulo de Souza
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09 1:55 UTC (permalink / raw)
To: gregkh
Cc: andriy.shevchenko, jj, forest, devel, linux-kernel,
Marcos Paulo de Souza
The commented macros are reported by forgotten-macros
tool(https://github.com/marcosps/forgotten_macros).
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
drivers/staging/vt6656/desc.h | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/drivers/staging/vt6656/desc.h b/drivers/staging/vt6656/desc.h
index 767112b..b68b2ec 100644
--- a/drivers/staging/vt6656/desc.h
+++ b/drivers/staging/vt6656/desc.h
@@ -36,8 +36,6 @@
#include "ttype.h"
#include "tether.h"
-/*--------------------- Export Definitions -------------------------*/
-
// max transmit or receive buffer size
#define CB_MAX_BUF_SIZE 2900U // max buffer size
// NOTE: must be multiple of 4
@@ -120,17 +118,11 @@
#define FRAGCTL_TKIP 0x0200 // 0000 0010 0000 0000
#define FRAGCTL_LEGACY 0x0100 // 0000 0001 0000 0000
#define FRAGCTL_NONENCRYPT 0x0000 // 0000 0000 0000 0000
-//#define FRAGCTL_AC3 0x000C // 0000 0000 0000 1100
-//#define FRAGCTL_AC2 0x0008 // 0000 0000 0000 1000
-//#define FRAGCTL_AC1 0x0004 // 0000 0000 0000 0100
-//#define FRAGCTL_AC0 0x0000 // 0000 0000 0000 0000
#define FRAGCTL_ENDFRAG 0x0003 // 0000 0000 0000 0011
#define FRAGCTL_MIDFRAG 0x0002 // 0000 0000 0000 0010
#define FRAGCTL_STAFRAG 0x0001 // 0000 0000 0000 0001
#define FRAGCTL_NONFRAG 0x0000 // 0000 0000 0000 0000
-//#define TYPE_AC0DMA 0
-//#define TYPE_TXDMA0 1
#define TYPE_TXDMA0 0
#define TYPE_AC0DMA 1
#define TYPE_ATIMDMA 2
@@ -147,9 +139,6 @@
#define TD_FLAGS_NETIF_SKB 0x01 // check if need release skb
#define TD_FLAGS_PRIV_SKB 0x02 // check if called from private skb(hostap)
#define TD_FLAGS_PS_RETRY 0x04 // check if PS STA frame re-transmit
-//#define TD_FLAGS_NETIF_SKB 0x04
-
-/*--------------------- Export Types ------------------------------*/
//
// RsvTime buffer header
@@ -268,7 +257,6 @@ SRTS_a_FB, *PSRTS_a_FB;
typedef const SRTS_a_FB *PCSRTS_a_FB;
-
//
// CTS buffer header
//
@@ -421,12 +409,5 @@ typedef struct tagSKeyEntry {
DWORD dwKey4[4];
} __attribute__ ((__packed__))
SKeyEntry;
-/*--------------------- Export Macros ------------------------------*/
-
-/*--------------------- Export Classes ----------------------------*/
-
-/*--------------------- Export Variables --------------------------*/
-
-/*--------------------- Export Functions --------------------------*/
#endif /* __DESC_H__ */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] staging: vt6656: hostap.c: Remove unused macros and some useless comments
2012-07-09 1:55 [PATCH 0/5] staging: vt6656: Cleanup in usage of macros Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 1/5] staging: vt6656: desc.h: Remove commented macros and useless comments Marcos Paulo de Souza
@ 2012-07-09 1:55 ` Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 3/5] staging: vt6656: hostap.c: Remove commented code Marcos Paulo de Souza
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09 1:55 UTC (permalink / raw)
To: gregkh
Cc: andriy.shevchenko, jj, forest, devel, linux-kernel,
Marcos Paulo de Souza
The unused macros were reporteds by forgotten-macros
tool(https://github.com/marcosps/forgotten_macros).
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
drivers/staging/vt6656/hostap.c | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c
index 51b5adf..f578095 100644
--- a/drivers/staging/vt6656/hostap.c
+++ b/drivers/staging/vt6656/hostap.c
@@ -41,31 +41,11 @@
#define VIAWGET_HOSTAPD_MAX_BUF_SIZE 1024
#define HOSTAP_CRYPT_FLAG_SET_TX_KEY BIT0
-#define HOSTAP_CRYPT_FLAG_PERMANENT BIT1
-#define HOSTAP_CRYPT_ERR_UNKNOWN_ALG 2
#define HOSTAP_CRYPT_ERR_UNKNOWN_ADDR 3
-#define HOSTAP_CRYPT_ERR_CRYPT_INIT_FAILED 4
#define HOSTAP_CRYPT_ERR_KEY_SET_FAILED 5
-#define HOSTAP_CRYPT_ERR_TX_KEY_SET_FAILED 6
-#define HOSTAP_CRYPT_ERR_CARD_CONF_FAILED 7
-
-/*--------------------- Static Definitions -------------------------*/
-
-/*--------------------- Static Classes ----------------------------*/
-
-/*--------------------- Static Variables --------------------------*/
-//static int msglevel =MSG_LEVEL_DEBUG;
static int msglevel =MSG_LEVEL_INFO;
-/*--------------------- Static Functions --------------------------*/
-
-
-
-
-/*--------------------- Export Variables --------------------------*/
-
-
/*
* Description:
* register net_device (AP) for hostap deamon
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] staging: vt6656: hostap.c: Remove commented code
2012-07-09 1:55 [PATCH 0/5] staging: vt6656: Cleanup in usage of macros Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 1/5] staging: vt6656: desc.h: Remove commented macros and useless comments Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 2/5] staging: vt6656: hostap.c: Remove unused macros and some " Marcos Paulo de Souza
@ 2012-07-09 1:55 ` Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 4/5] staging: vt6656: Remove all commented macros Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 5/5] staging: vt6656: Remove unsed macros Marcos Paulo de Souza
4 siblings, 0 replies; 6+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09 1:55 UTC (permalink / raw)
To: gregkh
Cc: andriy.shevchenko, jj, forest, devel, linux-kernel,
Marcos Paulo de Souza
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
drivers/staging/vt6656/hostap.c | 43 ---------------------------------------
1 file changed, 43 deletions(-)
diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c
index f578095..682002a 100644
--- a/drivers/staging/vt6656/hostap.c
+++ b/drivers/staging/vt6656/hostap.c
@@ -294,37 +294,6 @@ static int hostap_get_info_sta(PSDevice pDevice,
return 0;
}
-/*
- * Description:
- * reset txexec
- *
- * Parameters:
- * In:
- * pDevice -
- * param -
- * Out:
- * TURE, FALSE
- *
- * Return Value:
- *
- */
-/*
-static int hostap_reset_txexc_sta(PSDevice pDevice,
- struct viawget_hostapd_param *param)
-{
- PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
- unsigned int uNodeIndex;
-
- if (BSSbIsSTAInNodeDB(pDevice, param->sta_addr, &uNodeIndex)) {
- pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts = 0;
- }
- else {
- return -ENOENT;
- }
-
- return 0;
-}
-*/
/*
* Description:
@@ -459,12 +428,6 @@ static int hostap_set_encryption(PSDevice pDevice,
param->u.crypt.err = 0;
-/*
- if (param_len !=
- (int) ((char *) param->u.crypt.key - (char *) param) +
- param->u.crypt.key_len)
- return -EINVAL;
-*/
if (param->u.crypt.alg > WPA_ALG_CCMP)
return -EINVAL;
@@ -794,12 +757,6 @@ int vt6656_hostap_ioctl(PSDevice pDevice, struct iw_point *p)
ret = hostap_get_info_sta(pDevice, param);
ap_ioctl = 1;
break;
-/*
- case VIAWGET_HOSTAPD_RESET_TXEXC_STA:
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_RESET_TXEXC_STA \n");
- ret = hostap_reset_txexc_sta(pDevice, param);
- break;
-*/
case VIAWGET_HOSTAPD_SET_FLAGS_STA:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_FLAGS_STA \n");
ret = hostap_set_flags_sta(pDevice, param);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] staging: vt6656: Remove all commented macros
2012-07-09 1:55 [PATCH 0/5] staging: vt6656: Cleanup in usage of macros Marcos Paulo de Souza
` (2 preceding siblings ...)
2012-07-09 1:55 ` [PATCH 3/5] staging: vt6656: hostap.c: Remove commented code Marcos Paulo de Souza
@ 2012-07-09 1:55 ` Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 5/5] staging: vt6656: Remove unsed macros Marcos Paulo de Souza
4 siblings, 0 replies; 6+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09 1:55 UTC (permalink / raw)
To: gregkh
Cc: andriy.shevchenko, jj, forest, devel, linux-kernel,
Marcos Paulo de Souza
These macros were reported by forgotten-macros tool
(https://github.com/marcosps/forgotten_macros).
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
drivers/staging/vt6656/80211hdr.h | 2 --
drivers/staging/vt6656/bssdb.h | 2 --
drivers/staging/vt6656/card.h | 1 -
drivers/staging/vt6656/device.h | 4 ----
drivers/staging/vt6656/main_usb.c | 5 -----
drivers/staging/vt6656/mib.h | 1 -
drivers/staging/vt6656/tether.h | 2 --
drivers/staging/vt6656/usbpipe.c | 3 ---
8 files changed, 20 deletions(-)
diff --git a/drivers/staging/vt6656/80211hdr.h b/drivers/staging/vt6656/80211hdr.h
index 15c6ef1..b87d543 100644
--- a/drivers/staging/vt6656/80211hdr.h
+++ b/drivers/staging/vt6656/80211hdr.h
@@ -78,7 +78,6 @@
#define WLAN_HDR_ADDR4_LEN 30
#define WLAN_IEHDR_LEN 2
#define WLAN_SSID_MAXLEN 32
-/* #define WLAN_RATES_MAXLEN 255 */
#define WLAN_RATES_MAXLEN 16
#define WLAN_RATES_MAXLEN_11B 4
#define WLAN_RSN_MAXLEN 32
@@ -104,7 +103,6 @@
#define WLAN_WEP40_KEYLEN 5
#define WLAN_WEP104_KEYLEN 13
#define WLAN_WEP232_KEYLEN 29
-/* #define WLAN_WEPMAX_KEYLEN 29 */
#define WLAN_WEPMAX_KEYLEN 32
#define WLAN_CHALLENGE_IE_MAXLEN 255
#define WLAN_CHALLENGE_IE_LEN 130
diff --git a/drivers/staging/vt6656/bssdb.h b/drivers/staging/vt6656/bssdb.h
index a8f97eb..6b2ec39 100644
--- a/drivers/staging/vt6656/bssdb.h
+++ b/drivers/staging/vt6656/bssdb.h
@@ -64,8 +64,6 @@
// send and receive non-IEEE 802.1X frames
#define WLAN_STA_AUTHORIZED BIT5
-//#define MAX_RATE 12
-
#define MAX_WPA_IE_LEN 64
diff --git a/drivers/staging/vt6656/card.h b/drivers/staging/vt6656/card.h
index 9cf71a3..55962b1 100644
--- a/drivers/staging/vt6656/card.h
+++ b/drivers/staging/vt6656/card.h
@@ -52,7 +52,6 @@ typedef enum _CARD_OP_MODE {
} CARD_OP_MODE, *PCARD_OP_MODE;
#define CB_MAX_CHANNEL_24G 14
-/* #define CB_MAX_CHANNEL_5G 24 */
#define CB_MAX_CHANNEL_5G 42 /* add channel9(5045MHz), 41==>42 */
#define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index f1496ec..171dd68 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -106,10 +106,6 @@
#define MAX_MULTICAST_ADDRESS_NUM 32
#define MULTICAST_ADDRESS_LIST_SIZE (MAX_MULTICAST_ADDRESS_NUM * ETH_ALEN)
-//#define OP_MODE_INFRASTRUCTURE 0
-//#define OP_MODE_ADHOC 1
-//#define OP_MODE_AP 2
-
#define DUPLICATE_RX_CACHE_LENGTH 5
#define NUM_KEY_ENTRY 11
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 5048341..b06fd5b 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -205,11 +205,6 @@ static const long frequency_list[] = {
};
-#ifndef IW_ENCODE_NOKEY
-#define IW_ENCODE_NOKEY 0x0800
-#define IW_ENCODE_MODE (IW_ENCODE_DISABLED | IW_ENCODE_RESTRICTED | IW_ENCODE_OPEN)
-#endif
-
static const struct iw_handler_def iwctl_handler_def;
*/
diff --git a/drivers/staging/vt6656/mib.h b/drivers/staging/vt6656/mib.h
index a89cca0..82d69a9 100644
--- a/drivers/staging/vt6656/mib.h
+++ b/drivers/staging/vt6656/mib.h
@@ -113,7 +113,6 @@ typedef struct tagSMib2Counter {
} SMib2Counter, *PSMib2Counter;
// Value in the ifType entry
-//#define ETHERNETCSMACD 6 //
#define WIRELESSLANIEEE80211b 6 //
// Value in the ifAdminStatus/ifOperStatus entry
diff --git a/drivers/staging/vt6656/tether.h b/drivers/staging/vt6656/tether.h
index 4ec0523..8c1f5d2 100644
--- a/drivers/staging/vt6656/tether.h
+++ b/drivers/staging/vt6656/tether.h
@@ -72,7 +72,6 @@
#define TYPE_CTL_ACK 0xd400
-//#define WEP_IV_MASK 0xFFFFFF00
#else //if LITTLE_ENDIAN
//
@@ -111,7 +110,6 @@
#define TYPE_CTL_ACK 0x00d4
-//#define WEP_IV_MASK 0x00FFFFFF
#endif //#ifdef __BIG_ENDIAN
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
index c612ab5..609e8fa 100644
--- a/drivers/staging/vt6656/usbpipe.c
+++ b/drivers/staging/vt6656/usbpipe.c
@@ -52,9 +52,6 @@
//endpoint 2: read bulk
//endpoint 3: write bulk
-//RequestType:
-//#define REQUEST_OUT (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE) // 0x40
-//#define REQUEST_IN (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE ) //0xc0
//static int msglevel =MSG_LEVEL_DEBUG;
static int msglevel =MSG_LEVEL_INFO;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] staging: vt6656: Remove unsed macros
2012-07-09 1:55 [PATCH 0/5] staging: vt6656: Cleanup in usage of macros Marcos Paulo de Souza
` (3 preceding siblings ...)
2012-07-09 1:55 ` [PATCH 4/5] staging: vt6656: Remove all commented macros Marcos Paulo de Souza
@ 2012-07-09 1:55 ` Marcos Paulo de Souza
4 siblings, 0 replies; 6+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09 1:55 UTC (permalink / raw)
To: gregkh
Cc: andriy.shevchenko, jj, forest, devel, linux-kernel,
Marcos Paulo de Souza
These macros were reported by forgotten-macros tool
(https://github.com/marcosps/forgotten_macros).
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
drivers/staging/vt6656/card.c | 1 -
drivers/staging/vt6656/channel.c | 2 --
drivers/staging/vt6656/rxtx.c | 2 --
3 files changed, 5 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 9d09e9f..e3ddc0b 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -66,7 +66,6 @@ static int msglevel =MSG_LEVEL_INFO;
/*--------------------- Static Definitions -------------------------*/
-#define CB_TXPOWER_LEVEL 6
/*--------------------- Static Classes ----------------------------*/
diff --git a/drivers/staging/vt6656/channel.c b/drivers/staging/vt6656/channel.c
index 99e054d..6502176 100644
--- a/drivers/staging/vt6656/channel.c
+++ b/drivers/staging/vt6656/channel.c
@@ -368,8 +368,6 @@ static struct
/* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 */
};
-#define NUM_RULES ARRAY_SIZE(ChannelRuleTab)
-
/*--------------------- Export function -------------------------*/
/************************************************************************
* Country Channel Valid
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 9b64b10..bb46452 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -73,8 +73,6 @@ static int msglevel = MSG_LEVEL_INFO;
/*--------------------- Static Functions --------------------------*/
/*--------------------- Static Definitions -------------------------*/
-#define CRITICAL_PACKET_LEN 256 // if packet size < 256 -> in-direct send
- // packet size >= 256 -> direct send
const WORD wTimeStampOff[2][MAX_RATE] = {
{384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23}, // Long Preamble
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-07-09 2:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-09 1:55 [PATCH 0/5] staging: vt6656: Cleanup in usage of macros Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 1/5] staging: vt6656: desc.h: Remove commented macros and useless comments Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 2/5] staging: vt6656: hostap.c: Remove unused macros and some " Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 3/5] staging: vt6656: hostap.c: Remove commented code Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 4/5] staging: vt6656: Remove all commented macros Marcos Paulo de Souza
2012-07-09 1:55 ` [PATCH 5/5] staging: vt6656: Remove unsed macros Marcos Paulo de Souza
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).