The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/6] staging: vt6655: Cleanup in usage of macros
@ 2012-07-09  2:51 Marcos Paulo de Souza
  2012-07-09  2:51 ` [PATCH 1/6] staging: vt6655: Remove all "if 0" blocks from driver Marcos Paulo de Souza
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09  2:51 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 unused and commented macros.

For this challenge, forgotten-macros tool helped us.

As I don't have any vt665x hardware, I will be grateful if anyone can test these changes!

This patchset was based in staging-next tree.

I hope you enjoy :)

Marcos Paulo de Souza (6):
  staging: vt6655: Remove all "if 0" blocks from driver
  staging: vt6655: mac.h: Remove all commented macros
  staging: vt6655: rf.c: Remove all unused macros
  staging: vt6655: baseband.h: Remove all unused macros
  staging: vt6655: Remove all commented macros
  staging: vt6655: hostap.c: Remove all unused macros

 drivers/staging/vt6655/80211hdr.h    |    2 -
 drivers/staging/vt6655/baseband.c    |    2 -
 drivers/staging/vt6655/baseband.h    |   30 -------------
 drivers/staging/vt6655/bssdb.c       |    1 -
 drivers/staging/vt6655/desc.h        |   11 -----
 drivers/staging/vt6655/device.h      |   15 -------
 drivers/staging/vt6655/device_main.c |   37 ----------------
 drivers/staging/vt6655/dpc.c         |    1 -
 drivers/staging/vt6655/hostap.c      |    6 ---
 drivers/staging/vt6655/iwctl.c       |   36 ----------------
 drivers/staging/vt6655/mac.h         |   24 -----------
 drivers/staging/vt6655/mib.h         |    2 -
 drivers/staging/vt6655/rf.c          |   78 ----------------------------------
 drivers/staging/vt6655/rf.h          |    1 -
 drivers/staging/vt6655/tether.h      |    3 --
 drivers/staging/vt6655/vntwifi.c     |    2 -
 drivers/staging/vt6655/wcmd.c        |   24 -----------
 17 files changed, 275 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/6] staging: vt6655: Remove all "if 0" blocks from driver
  2012-07-09  2:51 [PATCH 0/6] staging: vt6655: Cleanup in usage of macros Marcos Paulo de Souza
@ 2012-07-09  2:51 ` Marcos Paulo de Souza
  2012-07-09  2:51 ` [PATCH 2/6] staging: vt6655: mac.h: Remove all commented macros Marcos Paulo de Souza
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09  2:51 UTC (permalink / raw)
  To: gregkh
  Cc: andriy.shevchenko, jj, forest, devel, linux-kernel,
	Marcos Paulo de Souza

This commit removes code that will never be executed by vt6655 driver.

Was the forgotten-macros tool(https://github.com/marcosps/forgotten_macros)
who reported these blocks for us.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
 drivers/staging/vt6655/device_main.c |   33 --------------------------
 drivers/staging/vt6655/iwctl.c       |   36 -----------------------------
 drivers/staging/vt6655/rf.c          |   42 ----------------------------------
 drivers/staging/vt6655/wcmd.c        |   24 -------------------
 4 files changed, 135 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 3e8283c..d0fefb1 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1086,15 +1086,6 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
         device_free_info(pDevice);
         return -ENODEV;
     }
-//2008-07-21-01<Add>by MikeLiu
-//register wpadev
-#if 0
-   if(wpa_set_wpadev(pDevice, 1)!=0) {
-     printk("Fail to Register WPADEV?\n");
-        unregister_netdev(pDevice->dev);
-        free_netdev(dev);
-   }
-#endif
     device_print_info(pDevice);
     pci_set_drvdata(pcid, pDevice);
     return 0;
@@ -1948,15 +1939,6 @@ device_init_rd0_ring(pDevice);
 
 
 
-#if 0
-	pDevice->MLMEThr_pid = kernel_thread(MlmeThread, pDevice, CLONE_VM);
-	if (pDevice->MLMEThr_pid <0 )
-	{
-		printk("unable start thread MlmeThread\n");
-		return -1;
-	}
-#endif
-
 	//printk("thread id is %d\n",pDevice->MLMEThr_pid);
 	//printk("Create thread time is %x\n",jiffies);
 	//wait_for_completion(&pDevice->notify);
@@ -2493,21 +2475,6 @@ static int  device_xmit(struct sk_buff *skb, struct net_device *dev) {
                                 &(pDevice->byTopCCKBasicRate),
                                 &(pDevice->byTopOFDMBasicRate));
 
-#if 0
-printk("auto rate:Rate : %d,AckRate:%d,TopCCKRate:%d,TopOFDMRate:%d\n",
-pDevice->wCurrentRate,pDevice->byACKRate,
-pDevice->byTopCCKBasicRate,pDevice->byTopOFDMBasicRate);
-
-#endif
-
-#if 0
-
-	pDevice->wCurrentRate = 11;
-	pDevice->byACKRate = 8;
-	pDevice->byTopCCKBasicRate = 3;
-	pDevice->byTopOFDMBasicRate = 8;
-#endif
-
 
 		}
     }
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index 87288db..77aad7f 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -84,24 +84,6 @@ struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev)
 
 	pDevice->wstats.status = pDevice->eOPMode;
 	#ifdef Calcu_LinkQual
-	 #if 0
-	  if(pDevice->byBBType == BB_TYPE_11B) {
-	     if(pDevice->byCurrSQ > 120)
-                  pDevice->scStatistic.LinkQuality = 100;
-	     else
-		 pDevice->scStatistic.LinkQuality = pDevice->byCurrSQ*100/120;
-	    }
-	  else if(pDevice->byBBType == BB_TYPE_11G) {
-                if(pDevice->byCurrSQ < 20)
-		   pDevice->scStatistic.LinkQuality = 100;
-	       else if(pDevice->byCurrSQ >96)
-		   pDevice->scStatistic.LinkQuality  = 0;
-	       else
-		   pDevice->scStatistic.LinkQuality = (96-pDevice->byCurrSQ)*100/76;
-	   }
-	   if(pDevice->bLinkPass !=true)
-	       pDevice->scStatistic.LinkQuality = 0;
-	  #endif
 	   if(pDevice->scStatistic.LinkQuality > 100)
    	       pDevice->scStatistic.LinkQuality = 100;
                pDevice->wstats.qual.qual =(unsigned char) pDevice->scStatistic.LinkQuality;
@@ -2004,24 +1986,6 @@ param->u.wpa_key.key = (u8 *)key_array;
 param->u.wpa_key.seq = (u8 *)seq;
 param->u.wpa_key.seq_len = seq_len;
 
-#if 0
-printk("param->u.wpa_key.alg_name =%d\n",param->u.wpa_key.alg_name);
-printk(KERN_DEBUG "param->addr=%pM\n", param->addr);
-printk("param->u.wpa_key.set_tx =%d\n",param->u.wpa_key.set_tx);
-printk("param->u.wpa_key.key_index =%d\n",param->u.wpa_key.key_index);
-printk("param->u.wpa_key.key_len =%d\n",param->u.wpa_key.key_len);
-printk("param->u.wpa_key.key =");
-for(ii=0;ii<param->u.wpa_key.key_len;ii++)
-	printk("%02x:",param->u.wpa_key.key[ii]);
-         printk("\n");
-printk("param->u.wpa_key.seq_len =%d\n",param->u.wpa_key.seq_len);
-printk("param->u.wpa_key.seq =");
-for(ii=0;ii<param->u.wpa_key.seq_len;ii++)
-	printk("%02x:",param->u.wpa_key.seq[ii]);
-         printk("\n");
-
-printk("...........\n");
-#endif
 //****set if current action is Network Manager count??
 //****this method is so foolish,but there is no other way???
 if(param->u.wpa_key.alg_name == WPA_ALG_NONE) {
diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index b8ec783..a2db0ff 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -1067,48 +1067,6 @@ unsigned char byPwrdBm = 0;
 		break;
     }
 
-#if 0
-
-    // 802.11h TPC
-    if (pDevice->bLinkPass == true) {
-        // do not over local constraint
-        if (byPwrdBm > pDevice->abyLocalPwr[uCH]) {
-            pDevice->byCurPwrdBm = pDevice->abyLocalPwr[uCH];
-            byDec = byPwrdBm - pDevice->abyLocalPwr[uCH];
-            if (pDevice->byRFType == RF_UW2452) {
-                byDec *= 3;
-            } else {
-                byDec <<= 1;
-            }
-            if (byPwr > byDec) {
-                byPwr -= byDec;
-            } else {
-                byPwr = 0;
-            }
-        } else {
-            pDevice->byCurPwrdBm = byPwrdBm;
-        }
-    } else {
-        // do not over regulatory constraint
-        if (byPwrdBm > pDevice->abyRegPwr[uCH]) {
-            pDevice->byCurPwrdBm = pDevice->abyRegPwr[uCH];
-            byDec = byPwrdBm - pDevice->abyRegPwr[uCH];
-            if (pDevice->byRFType == RF_UW2452) {
-                byDec *= 3;
-            } else {
-                byDec <<= 1;
-            }
-            if (byPwr > byDec) {
-                byPwr -= byDec;
-            } else {
-                byPwr = 0;
-            }
-        } else {
-            pDevice->byCurPwrdBm = byPwrdBm;
-        }
-    }
-#endif
-
 //    if (pDevice->byLocalID <= REV_ID_VT3253_B1) {
     if (pDevice->byCurPwr == byPwr) {
         return true;
diff --git a/drivers/staging/vt6655/wcmd.c b/drivers/staging/vt6655/wcmd.c
index bab3b01..7b5b99c 100644
--- a/drivers/staging/vt6655/wcmd.c
+++ b/drivers/staging/vt6655/wcmd.c
@@ -684,18 +684,6 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS
 	       return;
 	   }
 	          pDevice->byLinkWaitCount = 0;
-		 #if 0
-                     #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
-                    // if(pDevice->bWPASuppWextEnabled == true)
-                        {
-                  	union iwreq_data  wrqu;
-                  	memset(&wrqu, 0, sizeof (wrqu));
-                          wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-                  	printk("wireless_send_event--->SIOCGIWAP(disassociated:AUTHENTICATE_WAIT_timeout)\n");
-                  	wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
-                       }
-                    #endif
-	         #endif
             s_bCommandComplete(pDevice);
             break;
 
@@ -748,18 +736,6 @@ printk("chester-abyDesireSSID=%s\n",((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySS
 	       return;
 	   }
 	          pDevice->byLinkWaitCount = 0;
-		#if 0
-                     #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
-                    // if(pDevice->bWPASuppWextEnabled == true)
-                        {
-                  	union iwreq_data  wrqu;
-                  	memset(&wrqu, 0, sizeof (wrqu));
-                          wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-                  	printk("wireless_send_event--->SIOCGIWAP(disassociated:ASSOCIATE_WAIT_timeout)\n");
-                  	wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
-                       }
-                    #endif
-		#endif
 
             s_bCommandComplete(pDevice);
             break;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/6] staging: vt6655: mac.h: Remove all commented macros
  2012-07-09  2:51 [PATCH 0/6] staging: vt6655: Cleanup in usage of macros Marcos Paulo de Souza
  2012-07-09  2:51 ` [PATCH 1/6] staging: vt6655: Remove all "if 0" blocks from driver Marcos Paulo de Souza
@ 2012-07-09  2:51 ` Marcos Paulo de Souza
  2012-07-09  2:51 ` [PATCH 3/6] staging: vt6655: rf.c: Remove all unused macros Marcos Paulo de Souza
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09  2:51 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/vt6655/mac.h |   24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index b96d27e..e3ccfee 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -292,19 +292,11 @@
 //
 #define EnCFG_BarkerPream   0x00020000
 #define EnCFG_NXTBTTCFPSTR  0x00010000
-//#define EnCFG_TXLMT3UPDATE  0x00008000
-//#define EnCFG_TXLMT2UPDATE  0x00004000
-//#define EnCFG_TXLMT1UPDATE  0x00002000
-//#define EnCFG_TXLMT3EN      0x00001000
-//#define EnCFG_TXLMT2EN      0x00000800
-//#define EnCFG_TXLMT1EN      0x00000400
 #define EnCFG_BcnSusClr     0x00000200
 #define EnCFG_BcnSusInd     0x00000100
-//#define EnCFG_CWOFF1        0x00000080
 #define EnCFG_CFP_ProtectEn 0x00000040
 #define EnCFG_ProtectMd     0x00000020
 #define EnCFG_HwParCFP      0x00000010
-//#define EnCFG_QOS           0x00000008
 #define EnCFG_CFNULRSP      0x00000004
 #define EnCFG_BBType_MASK   0x00000003
 #define EnCFG_BBType_g      0x00000002
@@ -392,14 +384,6 @@
 #define IMR_RADARDETECT     0x10000000      //
 #define IMR_MEASUREEND      0x08000000      //
 #define IMR_SOFTTIMER1      0x00200000      //
-//#define IMR_SYNCFLUSHOK     0x00100000      //
-//#define IMR_ATIMEND         0x00080000      //0000 1000 0000 0000 0000 0000
-//#define IMR_CFPEND          0x00040000      //0000 0100 0000 0000 0000 0000
-//#define IMR_AC3DMA          0x00020000      //0000 0010 0000 0000 0000 0000
-//#define IMR_AC2DMA          0x00010000      //0000 0001 0000 0000 0000 0000
-//#define IMR_AC1DMA          0x00008000      //0000 0000 1000 0000 0000 0000
-//#define IMR_SYNCTX          0x00004000      //0000 0000 0100 0000 0000 0000
-//#define IMR_ATIMTX          0x00002000      //0000 0000 0010 0000 0000 0000
 #define IMR_RXDMA1          0x00001000      //0000 0000 0001 0000 0000 0000
 #define IMR_RXNOBUF         0x00000800      //
 #define IMR_MIBNEARFULL     0x00000400      //
@@ -424,14 +408,6 @@
 #define ISR_RADARDETECT     0x10000000      //
 #define ISR_MEASUREEND      0x08000000      //
 #define ISR_SOFTTIMER1      0x00200000      //
-//#define ISR_SYNCFLUSHOK     0x00100000      //0001 0000 0000 0000 0000 0000
-//#define ISR_ATIMEND         0x00080000      //0000 1000 0000 0000 0000 0000
-//#define ISR_CFPEND          0x00040000      //0000 0100 0000 0000 0000 0000
-//#define ISR_AC3DMA          0x00020000      //0000 0010 0000 0000 0000 0000
-//#define ISR_AC2DMA          0x00010000      //0000 0001 0000 0000 0000 0000
-//#define ISR_AC1DMA          0x00008000      //0000 0000 1000 0000 0000 0000
-//#define ISR_SYNCTX          0x00004000      //0000 0000 0100 0000 0000 0000
-//#define ISR_ATIMTX          0x00002000      //0000 0000 0010 0000 0000 0000
 #define ISR_RXDMA1          0x00001000      //0000 0000 0001 0000 0000 0000
 #define ISR_RXNOBUF         0x00000800      //0000 0000 0000 1000 0000 0000
 #define ISR_MIBNEARFULL     0x00000400      //0000 0000 0000 0100 0000 0000
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/6] staging: vt6655: rf.c: Remove all unused macros
  2012-07-09  2:51 [PATCH 0/6] staging: vt6655: Cleanup in usage of macros Marcos Paulo de Souza
  2012-07-09  2:51 ` [PATCH 1/6] staging: vt6655: Remove all "if 0" blocks from driver Marcos Paulo de Souza
  2012-07-09  2:51 ` [PATCH 2/6] staging: vt6655: mac.h: Remove all commented macros Marcos Paulo de Souza
@ 2012-07-09  2:51 ` Marcos Paulo de Souza
  2012-07-09  2:51 ` [PATCH 4/6] staging: vt6655: baseband.h: " Marcos Paulo de Souza
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09  2:51 UTC (permalink / raw)
  To: gregkh
  Cc: andriy.shevchenko, jj, forest, devel, linux-kernel,
	Marcos Paulo de Souza

These macros were reported by forgotte-macros tool
(https://github.com/marcosps/forgotten_macros).

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
 drivers/staging/vt6655/rf.c |   36 ------------------------------------
 1 file changed, 36 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index a2db0ff..aa69665 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -41,52 +41,16 @@
 
 //static int          msglevel                =MSG_LEVEL_INFO;
 
-#define BY_RF2959_REG_LEN     23 //24bits
-#define CB_RF2959_INIT_SEQ    15
-#define SWITCH_CHANNEL_DELAY_RF2959 200 //us
-#define RF2959_PWR_IDX_LEN    32
-
-#define BY_MA2825_REG_LEN     23 //24bit
-#define CB_MA2825_INIT_SEQ    13
-#define SWITCH_CHANNEL_DELAY_MA2825 200 //us
-#define MA2825_PWR_IDX_LEN    31
-
 #define BY_AL2230_REG_LEN     23 //24bit
 #define CB_AL2230_INIT_SEQ    15
 #define SWITCH_CHANNEL_DELAY_AL2230 200 //us
 #define AL2230_PWR_IDX_LEN    64
 
 
-#define BY_UW2451_REG_LEN     23
-#define CB_UW2451_INIT_SEQ    6
-#define SWITCH_CHANNEL_DELAY_UW2451 200 //us
-#define UW2451_PWR_IDX_LEN    25
-
-//{{ RobertYu: 20041118
-#define BY_MA2829_REG_LEN     23 //24bit
-#define CB_MA2829_INIT_SEQ    13
-#define SWITCH_CHANNEL_DELAY_MA2829 200 //us
-#define MA2829_PWR_IDX_LEN    64
-//}} RobertYu
-
-//{{ RobertYu:20050103
 #define BY_AL7230_REG_LEN     23 //24bit
 #define CB_AL7230_INIT_SEQ    16
 #define SWITCH_CHANNEL_DELAY_AL7230 200 //us
 #define AL7230_PWR_IDX_LEN    64
-//}} RobertYu
-
-//{{ RobertYu: 20041210
-#define BY_UW2452_REG_LEN     23
-#define CB_UW2452_INIT_SEQ    5 //RoberYu:20050113, Rev0.2 Programming Guide(remove R3, so 6-->5)
-#define SWITCH_CHANNEL_DELAY_UW2452 100 //us
-#define UW2452_PWR_IDX_LEN    64
-//}} RobertYu
-
-#define BY_VT3226_REG_LEN     23
-#define CB_VT3226_INIT_SEQ    12
-#define SWITCH_CHANNEL_DELAY_VT3226 200 //us
-#define VT3226_PWR_IDX_LEN    16
 
 /*---------------------  Static Classes  ----------------------------*/
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/6] staging: vt6655: baseband.h: Remove all unused macros
  2012-07-09  2:51 [PATCH 0/6] staging: vt6655: Cleanup in usage of macros Marcos Paulo de Souza
                   ` (2 preceding siblings ...)
  2012-07-09  2:51 ` [PATCH 3/6] staging: vt6655: rf.c: Remove all unused macros Marcos Paulo de Souza
@ 2012-07-09  2:51 ` Marcos Paulo de Souza
  2012-07-09  2:51 ` [PATCH 5/6] staging: vt6655: Remove all commented macros Marcos Paulo de Souza
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09  2:51 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/vt6655/baseband.h |   30 ------------------------------
 1 file changed, 30 deletions(-)

diff --git a/drivers/staging/vt6655/baseband.h b/drivers/staging/vt6655/baseband.h
index 8294bdb..be2d689 100644
--- a/drivers/staging/vt6655/baseband.h
+++ b/drivers/staging/vt6655/baseband.h
@@ -46,36 +46,6 @@
 // Baseband RF pair definition in eeprom (Bits 6..0)
 //
 
-/*
-#define RATE_1M         0
-#define RATE_2M         1
-#define RATE_5M         2
-#define RATE_11M        3
-#define RATE_6M         4
-#define RATE_9M         5
-#define RATE_12M        6
-#define RATE_18M        7
-#define RATE_24M        8
-#define RATE_36M        9
-#define RATE_48M       10
-#define RATE_54M       11
-#define RATE_AUTO      12
-#define MAX_RATE       12
-
-
-//0:11A 1:11B 2:11G
-#define BB_TYPE_11A    0
-#define BB_TYPE_11B    1
-#define BB_TYPE_11G    2
-
-//0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate)
-#define PK_TYPE_11A     0
-#define PK_TYPE_11B     1
-#define PK_TYPE_11GB    2
-#define PK_TYPE_11GA    3
-*/
-
-
 #define PREAMBLE_LONG   0
 #define PREAMBLE_SHORT  1
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/6] staging: vt6655: Remove all commented macros
  2012-07-09  2:51 [PATCH 0/6] staging: vt6655: Cleanup in usage of macros Marcos Paulo de Souza
                   ` (3 preceding siblings ...)
  2012-07-09  2:51 ` [PATCH 4/6] staging: vt6655: baseband.h: " Marcos Paulo de Souza
@ 2012-07-09  2:51 ` Marcos Paulo de Souza
  2012-07-09  2:51 ` [PATCH 6/6] staging: vt6655: hostap.c: Remove all unused macros Marcos Paulo de Souza
  2012-07-09  4:24 ` [PATCH 0/6] staging: vt6655: Cleanup in usage of macros Joe Perches
  6 siblings, 0 replies; 9+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09  2:51 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/vt6655/80211hdr.h    |    2 --
 drivers/staging/vt6655/baseband.c    |    2 --
 drivers/staging/vt6655/bssdb.c       |    1 -
 drivers/staging/vt6655/desc.h        |   11 -----------
 drivers/staging/vt6655/device.h      |   15 ---------------
 drivers/staging/vt6655/device_main.c |    4 ----
 drivers/staging/vt6655/dpc.c         |    1 -
 drivers/staging/vt6655/mib.h         |    2 --
 drivers/staging/vt6655/rf.h          |    1 -
 drivers/staging/vt6655/tether.h      |    3 ---
 drivers/staging/vt6655/vntwifi.c     |    2 --
 11 files changed, 44 deletions(-)

diff --git a/drivers/staging/vt6655/80211hdr.h b/drivers/staging/vt6655/80211hdr.h
index f55283b..c4d2349 100644
--- a/drivers/staging/vt6655/80211hdr.h
+++ b/drivers/staging/vt6655/80211hdr.h
@@ -80,7 +80,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
@@ -106,7 +105,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/vt6655/baseband.c b/drivers/staging/vt6655/baseband.c
index 1e1c6e3..e7b93a2 100644
--- a/drivers/staging/vt6655/baseband.c
+++ b/drivers/staging/vt6655/baseband.c
@@ -60,8 +60,6 @@
 //static int          msglevel                =MSG_LEVEL_DEBUG;
 static int          msglevel                =MSG_LEVEL_INFO;
 
-//#define	PLICE_DEBUG
-
 /*---------------------  Static Classes  ----------------------------*/
 
 /*---------------------  Static Variables  --------------------------*/
diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c
index f4f108f..fcffa4f 100644
--- a/drivers/staging/vt6655/bssdb.c
+++ b/drivers/staging/vt6655/bssdb.c
@@ -58,7 +58,6 @@
 #include "wpa2.h"
 #include "iowpa.h"
 
-//#define	PLICE_DEBUG
 /*---------------------  Static Definitions -------------------------*/
 
 
diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h
index 138897a..084a1a5 100644
--- a/drivers/staging/vt6655/desc.h
+++ b/drivers/staging/vt6655/desc.h
@@ -152,10 +152,6 @@
 #define FRAGCTL_TKIP        0x0002 // 0000 0010 0000 0000
 #define FRAGCTL_LEGACY      0x0001 // 0000 0001 0000 0000
 #define FRAGCTL_NONENCRYPT  0x0000 // 0000 0000 0000 0000
-//#define FRAGCTL_AC3         0x0C00 // 0000 0000 0000 1100
-//#define FRAGCTL_AC2         0x0800 // 0000 0000 0000 1000
-//#define FRAGCTL_AC1         0x0400 // 0000 0000 0000 0100
-//#define FRAGCTL_AC0         0x0000 // 0000 0000 0000 0000
 #define FRAGCTL_ENDFRAG     0x0300 // 0000 0000 0000 0011
 #define FRAGCTL_MIDFRAG     0x0200 // 0000 0000 0000 0010
 #define FRAGCTL_STAFRAG     0x0100 // 0000 0000 0000 0001
@@ -184,10 +180,6 @@
 #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
@@ -195,8 +187,6 @@
 
 #endif // #ifdef __BIG_ENDIAN
 
-//#define TYPE_AC0DMA     0
-//#define TYPE_TXDMA0     1
 #define TYPE_TXDMA0     0
 #define TYPE_AC0DMA     1
 #define TYPE_ATIMDMA    2
@@ -215,7 +205,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  ------------------------------*/
 
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 780205c..c5e6b98 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -69,10 +69,6 @@
 #ifndef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
 #define WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
 #endif
-//2008-4-14<add> by chester for led issue
-//#define FOR_LED_ON_NOTEBOOK
-//
-
 
 //
 // device specific
@@ -91,12 +87,6 @@
 #include "key.h"
 #include "mac.h"
 
-//PLICE_DEBUG->
-//#define		THREAD
-
-//#define	TASK_LET
-//PLICE_DEBUG<-
-
 
 /*---------------------  Export Definitions -------------------------*/
 
@@ -105,11 +95,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/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index d0fefb1..89d1c22 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -87,12 +87,10 @@
 #include <linux/kthread.h>
 #include <linux/slab.h>
 
-//#define	DEBUG
 /*---------------------  Static Definitions -------------------------*/
 //static int          msglevel                =MSG_LEVEL_DEBUG;
 static int          msglevel                =   MSG_LEVEL_INFO;
 
-//#define	PLICE_DEBUG
 //
 // Define module options
 //
@@ -100,10 +98,8 @@ MODULE_AUTHOR("VIA Networking Technologies, Inc., <lyndonchen@vntek.com.tw>");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("VIA Networking Solomon-A/B/G Wireless LAN Adapter Driver");
 
-//PLICE_DEBUG ->
 	static int mlme_kill;
 	//static  struct task_struct * mlme_task;
-//PLICE_DEBUG <-
 
 #define DEVICE_PARAM(N,D)
 /*
diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index c0fab4b..e8a71ba 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -55,7 +55,6 @@
 #include "iowpa.h"
 #include "aes_ccmp.h"
 
-//#define	PLICE_DEBUG
 
 
 /*---------------------  Static Definitions -------------------------*/
diff --git a/drivers/staging/vt6655/mib.h b/drivers/staging/vt6655/mib.h
index 009f3a4..5cd697a 100644
--- a/drivers/staging/vt6655/mib.h
+++ b/drivers/staging/vt6655/mib.h
@@ -98,7 +98,6 @@ typedef struct tagSMib2Counter {
 } SMib2Counter, *PSMib2Counter;
 
 // Value in the ifType entry
-//#define ETHERNETCSMACD      6           //
 #define WIRELESSLANIEEE80211b      6           //
 
 // Value in the ifAdminStatus/ifOperStatus entry
@@ -210,7 +209,6 @@ typedef struct tagSISRCounters {
 #define UNDER_CREATION      3           //
 #define INVALID             4           //
 
-//#define MAX_RATE            12
 //
 // statistic counter
 //
diff --git a/drivers/staging/vt6655/rf.h b/drivers/staging/vt6655/rf.h
index 1f8d82e..73f0969 100644
--- a/drivers/staging/vt6655/rf.h
+++ b/drivers/staging/vt6655/rf.h
@@ -41,7 +41,6 @@
 #define RF_MAXIMAG              0x02
 #define RF_AIROHA               0x03
 
-//#define RF_GCT5103              0x04
 #define RF_UW2451               0x05
 #define RF_MAXIMG               0x06
 #define RF_MAXIM2829            0x07 // RobertYu: 20041118
diff --git a/drivers/staging/vt6655/tether.h b/drivers/staging/vt6655/tether.h
index 787d885..6a68f97 100644
--- a/drivers/staging/vt6655/tether.h
+++ b/drivers/staging/vt6655/tether.h
@@ -90,8 +90,6 @@
 #define TYPE_CTL_ACK        0xd400
 
 
-//#define WEP_IV_MASK         0xFFFFFF00
-
 #else //if LITTLE_ENDIAN
 //
 // wType field in the SEthernetHeader
@@ -143,7 +141,6 @@
 #define TYPE_CTL_ACK        0x00d4
 
 
-//#define WEP_IV_MASK         0x00FFFFFF
 
 #endif //#ifdef __BIG_ENDIAN
 
diff --git a/drivers/staging/vt6655/vntwifi.c b/drivers/staging/vt6655/vntwifi.c
index 0491d0b..d645ecd 100644
--- a/drivers/staging/vt6655/vntwifi.c
+++ b/drivers/staging/vt6655/vntwifi.c
@@ -38,8 +38,6 @@
 #include "wmgr.h"
 #include "datarate.h"
 
-//#define	PLICE_DEBUG
-
 /*---------------------  Static Definitions -------------------------*/
 //static int          msglevel                =MSG_LEVEL_DEBUG;
 //static int          msglevel                =MSG_LEVEL_INFO;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/6] staging: vt6655: hostap.c: Remove all unused macros
  2012-07-09  2:51 [PATCH 0/6] staging: vt6655: Cleanup in usage of macros Marcos Paulo de Souza
                   ` (4 preceding siblings ...)
  2012-07-09  2:51 ` [PATCH 5/6] staging: vt6655: Remove all commented macros Marcos Paulo de Souza
@ 2012-07-09  2:51 ` Marcos Paulo de Souza
  2012-07-09  4:24 ` [PATCH 0/6] staging: vt6655: Cleanup in usage of macros Joe Perches
  6 siblings, 0 replies; 9+ messages in thread
From: Marcos Paulo de Souza @ 2012-07-09  2:51 UTC (permalink / raw)
  To: gregkh
  Cc: andriy.shevchenko, jj, forest, devel, linux-kernel,
	Marcos Paulo de Souza

All 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/vt6655/hostap.c |    6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
index 7735027..6ac6f45 100644
--- a/drivers/staging/vt6655/hostap.c
+++ b/drivers/staging/vt6655/hostap.c
@@ -40,14 +40,8 @@
 
 #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 -------------------------*/
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/6] staging: vt6655: Cleanup in usage of macros
  2012-07-09  2:51 [PATCH 0/6] staging: vt6655: Cleanup in usage of macros Marcos Paulo de Souza
                   ` (5 preceding siblings ...)
  2012-07-09  2:51 ` [PATCH 6/6] staging: vt6655: hostap.c: Remove all unused macros Marcos Paulo de Souza
@ 2012-07-09  4:24 ` Joe Perches
  2012-07-09  9:19   ` Marcos Souza
  6 siblings, 1 reply; 9+ messages in thread
From: Joe Perches @ 2012-07-09  4:24 UTC (permalink / raw)
  To: Marcos Paulo de Souza
  Cc: gregkh, andriy.shevchenko, jj, forest, devel, linux-kernel

On Sun, 2012-07-08 at 23:51 -0300, Marcos Paulo de Souza wrote:
> Hi kernel guys!
> 
> This patchset aims to clean all unused and commented macros.
> 
> For this challenge, forgotten-macros tool helped us.

Perhaps there may be false positives in your code.

Many times, macros like the below are used:

#define SUBSYSTEM_PREFIX_FOO	1
#define SUBSYSTEM_PREFIX_BAR	2
#define SUBSYSTEM_PREFIX_BAZ	3

#define USE_TYPE(type)	SUBSYSTEM_PREFIX_##type

It doesn't seem your code knows that style.

Also, the tool might be more flexible if it was
written using perl or python.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/6] staging: vt6655: Cleanup in usage of macros
  2012-07-09  4:24 ` [PATCH 0/6] staging: vt6655: Cleanup in usage of macros Joe Perches
@ 2012-07-09  9:19   ` Marcos Souza
  0 siblings, 0 replies; 9+ messages in thread
From: Marcos Souza @ 2012-07-09  9:19 UTC (permalink / raw)
  To: Joe Perches; +Cc: gregkh, andriy.shevchenko, jj, forest, devel, linux-kernel

2012/7/9 Joe Perches <joe@perches.com>
>
> On Sun, 2012-07-08 at 23:51 -0300, Marcos Paulo de Souza wrote:
> > Hi kernel guys!
> >
> > This patchset aims to clean all unused and commented macros.
> >
> > For this challenge, forgotten-macros tool helped us.
>
> Perhaps there may be false positives in your code.

Not in this case. After each changes in a file, I compiled all driver again.

> Many times, macros like the below are used:

> #define SUBSYSTEM_PREFIX_FOO    1
> #define SUBSYSTEM_PREFIX_BAR    2
> #define SUBSYSTEM_PREFIX_BAZ    3
>
> #define USE_TYPE(type)  SUBSYSTEM_PREFIX_##type
>
> It doesn't seem your code knows that style.

True! The tool is under development. A more robust method will be
 implemented, but for now, the tool can find the most "easy" dead macros.

> Also, the tool might be more flexible if it was
> written using perl or python.
>
Yeah, I believe it's true!

Thanks for the comments!

But, for the changes, do I have your ack?

Thanks Joe!

--
Att,

Marcos Paulo de Souza
Acadêmico de Ciencia da Computação - FURB - SC
"Uma vida sem desafios é uma vida sem razão"
"A life without challenges, is a non reason life"

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-07-09  9:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-09  2:51 [PATCH 0/6] staging: vt6655: Cleanup in usage of macros Marcos Paulo de Souza
2012-07-09  2:51 ` [PATCH 1/6] staging: vt6655: Remove all "if 0" blocks from driver Marcos Paulo de Souza
2012-07-09  2:51 ` [PATCH 2/6] staging: vt6655: mac.h: Remove all commented macros Marcos Paulo de Souza
2012-07-09  2:51 ` [PATCH 3/6] staging: vt6655: rf.c: Remove all unused macros Marcos Paulo de Souza
2012-07-09  2:51 ` [PATCH 4/6] staging: vt6655: baseband.h: " Marcos Paulo de Souza
2012-07-09  2:51 ` [PATCH 5/6] staging: vt6655: Remove all commented macros Marcos Paulo de Souza
2012-07-09  2:51 ` [PATCH 6/6] staging: vt6655: hostap.c: Remove all unused macros Marcos Paulo de Souza
2012-07-09  4:24 ` [PATCH 0/6] staging: vt6655: Cleanup in usage of macros Joe Perches
2012-07-09  9:19   ` Marcos Souza

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox