Skip to content

Commit

Permalink
staging: vt6655: Remove all "if 0" blocks from driver
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Marcos Paulo de Souza authored and Greg Kroah-Hartman committed Jul 9, 2012
1 parent 5328b9c commit 2478ef5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 135 deletions.
33 changes: 0 additions & 33 deletions drivers/staging/vt6655/device_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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


}
}
Expand Down
36 changes: 0 additions & 36 deletions drivers/staging/vt6655/iwctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
42 changes: 0 additions & 42 deletions drivers/staging/vt6655/rf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
24 changes: 0 additions & 24 deletions drivers/staging/vt6655/wcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2478ef5

Please sign in to comment.