[PATCH 1/2] staging: rtl8712: cleanup of timeout conversions

2015-01-31 Thread Nicholas Mc Guire
This is only an API consolidation to make things more readable.
Instances of  var * HZ / 1000  are replaced by  msecs_to_jiffies(var).
As msecs_to_jiffies will return > 0 if it is passed a value > 0 the
== 0 check is not needed. 

Signed-off-by: Nicholas Mc Guire 
---

Converting milliseconds to jiffies by "val * HZ / 1000" is technically
ok but msecs_to_jiffies(val) is the cleaner solution and handles all
corner cases correctly. This is a minor API cleanup only.

As msecs_to_jiffies will not return at least 1 (unless 0 is passed as 
argument) the check for delta == 0 is not needed here.

This patch was only compile tested for x86_64_defconfig +
CONFIG_STAGING=y, CONFIG_R8712U=m

This patch is against 3.0.19-rc6 -next-20150129

 drivers/staging/rtl8712/osdep_service.h |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/osdep_service.h 
b/drivers/staging/rtl8712/osdep_service.h
index 5153ad9..f933713 100644
--- a/drivers/staging/rtl8712/osdep_service.h
+++ b/drivers/staging/rtl8712/osdep_service.h
@@ -71,7 +71,7 @@ static inline void _init_timer(struct timer_list *ptimer,
 
 static inline void _set_timer(struct timer_list *ptimer, u32 delay_time)
 {
-   mod_timer(ptimer, (jiffies+(delay_time*HZ/1000)));
+   mod_timer(ptimer, (jiffies+msecs_to_jiffies(delay_time)));
 }
 
 static inline void _cancel_timer(struct timer_list *ptimer, u8 *bcancelled)
@@ -101,9 +101,7 @@ static inline void sleep_schedulable(int ms)
 {
u32 delta;
 
-   delta = (ms * HZ) / 1000;/*(ms)*/
-   if (delta == 0)
-   delta = 1;/* 1 ms */
+   delta = msecs_to_jiffies(ms);/*(ms)*/
set_current_state(TASK_INTERRUPTIBLE);
if (schedule_timeout(delta) != 0)
return;
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: rtl8712: condition with no effect removed

2015-01-31 Thread Nicholas Mc Guire
The check for return of schedule_timeout() has no effect on the 
effective control flow of sleep_schedulable() so it can be dropped.

Signed-off-by: Nicholas Mc Guire 
---

The current codes return check for schedule_timeout() has no effect
and can probably be dropped unless it is intended as a placeholder
for some future change in which case a comment should probably be
added.

This patch was only compile tested for x86_64_defconfig +
CONFIG_STAGING=y, CONFIG_R8712U=m


Patch is against 3.0.19-rc6 -next-20150129 but depends on:
[PATCH 1/2] staging: rtl8712: cleanup of timeout conversions

 drivers/staging/rtl8712/osdep_service.h |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/osdep_service.h 
b/drivers/staging/rtl8712/osdep_service.h
index f933713..36348d9 100644
--- a/drivers/staging/rtl8712/osdep_service.h
+++ b/drivers/staging/rtl8712/osdep_service.h
@@ -103,8 +103,7 @@ static inline void sleep_schedulable(int ms)
 
delta = msecs_to_jiffies(ms);/*(ms)*/
set_current_state(TASK_INTERRUPTIBLE);
-   if (schedule_timeout(delta) != 0)
-   return;
+   schedule_timeout(delta);
 }
 
 static inline unsigned char _cancel_timer_ex(struct timer_list *ptimer)
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: unisys: use msecs_to_jiffies for conversions

2015-01-31 Thread Nicholas Mc Guire
This is only an API consolidation to make things more readable.
Instances of  var * HZ / 1000  are replaced by  msecs_to_jiffies(var).

Signed-off-by: Nicholas Mc Guire 
---

Converting milliseconds to jiffies by "val * HZ / 1000" is technically
ok but msecs_to_jiffies(val) is the cleaner solution and handles all
corner cases correctly. This is a minor API cleanup only.

This patch was only compile tested with x86_64_defconfig + CONFIG_STAGING=y
CONFIG_UNISYSSPAR=y, CONFIG_UNISYS_VISORUTIL=m,
CONFIG_UNISYS_VISORCHANNEL=m, CONFIG_UNISYS_VISORCHIPSET=m 

Patch is against 3.19.0-rc6 -next-20150129

 drivers/staging/unisys/visorchipset/visorchipset_main.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 82e259d..f606ee9 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1594,7 +1594,7 @@ parahotplug_next_id(void)
 static unsigned long
 parahotplug_next_expiration(void)
 {
-   return jiffies + PARAHOTPLUG_TIMEOUT_MS * HZ / 1000;
+   return jiffies + msecs_to_jiffies(PARAHOTPLUG_TIMEOUT_MS);
 }
 
 /*
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: use msecs_to_jiffies for conversions

2015-01-31 Thread Nicholas Mc Guire
This is only an API consolidation to make things more readable.
Instances of  var * HZ / 1000  are replaced by  msecs_to_jiffies(var).

Signed-off-by: Nicholas Mc Guire 
---

Converting milliseconds to jiffies by "val * HZ / 1000" is technically
ok but msecs_to_jiffies(val) is the cleaner solution and handles all
corner cases correctly. This is a minor API cleanup only.

This patch was only compile tested with x86_64_defconfig + CONFIG_STAGING=y
CONFIG_R8188EU=m

Patch is against 3.19.0-rc6 -next-20150129

 drivers/staging/rtl8188eu/include/osdep_service.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h 
b/drivers/staging/rtl8188eu/include/osdep_service.h
index 82f58f8..3a27477 100644
--- a/drivers/staging/rtl8188eu/include/osdep_service.h
+++ b/drivers/staging/rtl8188eu/include/osdep_service.h
@@ -87,7 +87,7 @@ static inline void _init_timer(struct timer_list *ptimer,
 
 static inline void _set_timer(struct timer_list *ptimer, u32 delay_time)
 {
-   mod_timer(ptimer , (jiffies+(delay_time*HZ/1000)));
+   mod_timer(ptimer , (jiffies+msecs_to_jiffies(delay_time)));
 }
 
 #define RTW_TIMER_HDL_ARGS void *FunctionContext
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3] staging: comedi: drivers: jr3_pci: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/comedi/drivers/jr3_pci.c |   16 
 1 file changed, 16 deletions(-)

diff --git a/drivers/staging/comedi/drivers/jr3_pci.c 
b/drivers/staging/comedi/drivers/jr3_pci.c
index 81fab2d..87e3488 100644
--- a/drivers/staging/comedi/drivers/jr3_pci.c
+++ b/drivers/staging/comedi/drivers/jr3_pci.c
@@ -192,20 +192,6 @@ static void set_full_scales(struct jr3_channel __iomem 
*channel,
set_s16(&channel->command_word0, 0x0a00);
 }
 
-static struct six_axis_t get_min_full_scales(struct jr3_channel __iomem
-*channel)
-{
-   struct six_axis_t result;
-
-   result.fx = get_s16(&channel->min_full_scale.fx);
-   result.fy = get_s16(&channel->min_full_scale.fy);
-   result.fz = get_s16(&channel->min_full_scale.fz);
-   result.mx = get_s16(&channel->min_full_scale.mx);
-   result.my = get_s16(&channel->min_full_scale.my);
-   result.mz = get_s16(&channel->min_full_scale.mz);
-   return result;
-}
-
 static struct six_axis_t get_max_full_scales(struct jr3_channel __iomem
 *channel)
 {
@@ -520,10 +506,8 @@ static struct jr3_pci_poll_delay 
jr3_pci_poll_subdevice(struct comedi_subdevice
result = poll_delay_min_max(20, 100);
} else {
/* Set full scale */
-   struct six_axis_t min_full_scale;
struct six_axis_t max_full_scale;
 
-   min_full_scale = get_min_full_scales(channel);
max_full_scale = get_max_full_scales(channel);
set_full_scales(channel, max_full_scale);
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3] staging: comedi: drivers: dyna_pci10xx: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/comedi/drivers/dyna_pci10xx.c |4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dyna_pci10xx.c 
b/drivers/staging/comedi/drivers/dyna_pci10xx.c
index 1b6324c..f45ed36 100644
--- a/drivers/staging/comedi/drivers/dyna_pci10xx.c
+++ b/drivers/staging/comedi/drivers/dyna_pci10xx.c
@@ -115,10 +115,6 @@ static int dyna_pci10xx_insn_write_ao(struct comedi_device 
*dev,
 {
struct dyna_pci10xx_private *devpriv = dev->private;
int n;
-   unsigned int chan, range;
-
-   chan = CR_CHAN(insn->chanspec);
-   range = range_codes_pci1050_ai[CR_RANGE((insn->chanspec))];
 
mutex_lock(&devpriv->mutex);
for (n = 0; n < insn->n; n++) {
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: comedi: drivers: addi-data: hwdrv_apci1500: Change variables that is never used

2015-01-31 Thread Rickard Strandqvist
2015-01-30 22:10 GMT+01:00 Dan Carpenter :
> On Fri, Jan 30, 2015 at 12:25:53PM -0800, Greg Kroah-Hartman wrote:
>> On Fri, Jan 30, 2015 at 11:18:31PM +0300, Dan Carpenter wrote:
>> > Richard, asked some questions out of band.
>> >

Hi all!

As Dan said, I email him before. But it was not really meant only to
him, wrong click on the answer button on my mobile.
And really a better question to Greg, so here it is again.

Understand what you mean, although in this case it requires someone with
this HW to run a static code checking to.

But all the code in staging has a TODO file, is it not appropriate to
add the comment there then?

BTW all, ther i a PATCH v2 for this.


Kind regards
Rickard Strandqvist
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: hal: phy: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8188eu/hal/phy.c |   15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c 
b/drivers/staging/rtl8188eu/hal/phy.c
index 3f663fe..979f21c 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -721,7 +721,7 @@ void 
rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
 
 static u8 phy_path_a_iqk(struct adapter *adapt, bool config_pathb)
 {
-   u32 reg_eac, reg_e94, reg_e9c, reg_ea4;
+   u32 reg_eac, reg_e94, reg_e9c;
u8 result = 0x00;
 
/* 1 Tx IQK */
@@ -743,7 +743,7 @@ static u8 phy_path_a_iqk(struct adapter *adapt, bool 
config_pathb)
reg_eac = phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord);
reg_e94 = phy_query_bb_reg(adapt, rTx_Power_Before_IQK_A, bMaskDWord);
reg_e9c = phy_query_bb_reg(adapt, rTx_Power_After_IQK_A, bMaskDWord);
-   reg_ea4 = phy_query_bb_reg(adapt, rRx_Power_Before_IQK_A_2, bMaskDWord);
+   phy_query_bb_reg(adapt, rRx_Power_Before_IQK_A_2, bMaskDWord);
 
if (!(reg_eac & BIT28) &&
(((reg_e94 & 0x03FF)>>16) != 0x142) &&
@@ -838,8 +838,8 @@ static u8 phy_path_a_rx_iqk(struct adapter *adapt, bool 
configPathB)
 
/*  Check failed */
reg_eac = phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord);
-   reg_e94 = phy_query_bb_reg(adapt, rTx_Power_Before_IQK_A, bMaskDWord);
-   reg_e9c = phy_query_bb_reg(adapt, rTx_Power_After_IQK_A, bMaskDWord);
+   phy_query_bb_reg(adapt, rTx_Power_Before_IQK_A, bMaskDWord);
+   phy_query_bb_reg(adapt, rTx_Power_After_IQK_A, bMaskDWord);
reg_ea4 = phy_query_bb_reg(adapt, rRx_Power_Before_IQK_A_2, bMaskDWord);
 
/* reload RF 0xdf */
@@ -1416,8 +1416,7 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool 
recovery)
s32 result[4][8];
u8 i, final, chn_index;
bool pathaok, pathbok;
-   s32 reg_e94, reg_e9c, reg_ea4, reg_eac, reg_eb4, reg_ebc, reg_ec4,
-   reg_ecc;
+   s32 reg_e94, reg_e9c, reg_ea4, reg_eb4, reg_ebc, reg_ec4;
bool is12simular, is13simular, is23simular;
bool singletone = false, carrier_sup = false;
u32 iqk_bb_reg_92c[IQK_BB_REG_NUM] = {
@@ -1489,18 +1488,15 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, 
bool recovery)
reg_e94 = result[i][0];
reg_e9c = result[i][1];
reg_ea4 = result[i][2];
-   reg_eac = result[i][3];
reg_eb4 = result[i][4];
reg_ebc = result[i][5];
reg_ec4 = result[i][6];
-   reg_ecc = result[i][7];
}
 
if (final != 0xff) {
reg_e94 = result[final][0];
reg_e9c = result[final][1];
reg_ea4 = result[final][2];
-   reg_eac = result[final][3];
reg_eb4 = result[final][4];
reg_ebc = result[final][5];
dm_odm->RFCalibrateInfo.RegE94 = reg_e94;
@@ -1508,7 +1504,6 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool 
recovery)
dm_odm->RFCalibrateInfo.RegEB4 = reg_eb4;
dm_odm->RFCalibrateInfo.RegEBC = reg_ebc;
reg_ec4 = result[final][6];
-   reg_ecc = result[final][7];
pathaok = true;
pathbok = true;
} else {
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: core: rtw_sta_mgt: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8188eu/core/rtw_sta_mgt.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c 
b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
index dc9d0dd..1e737ed 100644
--- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
@@ -149,7 +149,6 @@ inline struct sta_info *rtw_get_stainfo_by_offset(struct 
sta_priv *stapriv, int
 static void rtw_mfree_all_stainfo(struct sta_priv *pstapriv)
 {
struct list_head *plist, *phead;
-   struct sta_info *psta = NULL;
 
 
spin_lock_bh(&pstapriv->sta_hash_lock);
@@ -158,7 +157,7 @@ static void rtw_mfree_all_stainfo(struct sta_priv *pstapriv)
plist = phead->next;
 
while (phead != plist) {
-   psta = container_of(plist, struct sta_info , list);
+   container_of(plist, struct sta_info, list);
plist = plist->next;
}
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: hal: rtl8188e_cmd: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c |7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
index 7f30dea..ece7e76 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
@@ -172,7 +172,7 @@ void rtl8188e_Add_RateATid(struct adapter *pAdapter, u32 
bitmap, u8 arg, u8 rssi
 {
struct hal_data_8188e *haldata = GET_HAL_DATA(pAdapter);
 
-   u8 macid, init_rate, raid, shortGIrate = false;
+   u8 macid, raid, shortGIrate = false;
 
macid = arg&0x1f;
 
@@ -184,13 +184,8 @@ void rtl8188e_Add_RateATid(struct adapter *pAdapter, u32 
bitmap, u8 arg, u8 rssi
 
bitmap |= ((raid<<28)&0xf000);
 
-   init_rate = get_highest_rate_idx(bitmap&0x0fff)&0x3f;
-
shortGIrate = (arg&BIT(5)) ? true : false;
 
-   if (shortGIrate)
-   init_rate |= BIT(6);
-
raid = (bitmap>>28) & 0x0f;
 
bitmap &= 0x0fff;
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192e: rtl8192e: r8192E_dev: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c |   13 ++---
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c 
b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 552d943..e3656f0 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -108,7 +108,6 @@ void rtl8192e_SetHwReg(struct net_device *dev, u8 variable, 
u8 *val)
case HW_VAR_MEDIA_STATUS:
{
enum rt_op_mode OpMode = *((enum rt_op_mode *)(val));
-   enum led_ctl_mode LedAction = LED_CTL_NO_LINK;
u8  btMsr = read_nic_byte(dev, MSR);
 
btMsr &= 0xfc;
@@ -116,7 +115,6 @@ void rtl8192e_SetHwReg(struct net_device *dev, u8 variable, 
u8 *val)
switch (OpMode) {
case RT_OP_MODE_INFRASTRUCTURE:
btMsr |= MSR_INFRA;
-   LedAction = LED_CTL_LINK;
break;
 
case RT_OP_MODE_IBSS:
@@ -125,7 +123,6 @@ void rtl8192e_SetHwReg(struct net_device *dev, u8 variable, 
u8 *val)
 
case RT_OP_MODE_AP:
btMsr |= MSR_AP;
-   LedAction = LED_CTL_LINK;
break;
 
default:
@@ -1695,11 +1692,10 @@ static void rtl8192_process_phyinfo(struct r8192_priv 
*priv, u8 *buffer,
static u32 last_beacon_adc_pwdb;
struct rtllib_hdr_3addr *hdr;
u16 sc;
-   unsigned int frag, seq;
+   unsigned int seq;
 
hdr = (struct rtllib_hdr_3addr *)buffer;
sc = le16_to_cpu(hdr->seq_ctl);
-   frag = WLAN_GET_SEQ_FRAG(sc);
seq = WLAN_GET_SEQ_SEQ(sc);
curr_st->Seq_Num = seq;
if (!prev_st->bIsAMPDU)
@@ -2335,13 +2331,8 @@ bool rtl8192_HalRxCheckStuck(struct net_device *dev)
for (i = 0; i < SilentResetRxSoltNum; i++)
TotalRxStuckCount += priv->SilentResetRxStuckEvent[i];
 
-   if (TotalRxStuckCount == SilentResetRxSoltNum) {
+   if (TotalRxStuckCount == SilentResetRxSoltNum)
bStuck = true;
-   for (i = 0; i < SilentResetRxSoltNum; i++)
-   TotalRxStuckCount +=
-priv->SilentResetRxStuckEvent[i];
-   }
-
 
} else {
priv->SilentResetRxStuckEvent[SlotIndex] = 0;
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192e: rtl8192e: rtl_core: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c |   25 -
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 5615c80..d6c1424 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1369,24 +1369,12 @@ static enum reset_type rtl819x_TxCheckStuck(struct 
net_device *dev)
 {
struct r8192_priv *priv = rtllib_priv(dev);
u8  QueueID;
-   u8  ResetThreshold = NIC_SEND_HANG_THRESHOLD_POWERSAVE;
boolbCheckFwTxCnt = false;
struct rtl8192_tx_ring  *ring = NULL;
struct sk_buff *skb = NULL;
struct cb_desc *tcb_desc = NULL;
unsigned long flags = 0;
 
-   switch (priv->rtllib->ps) {
-   case RTLLIB_PS_DISABLED:
-   ResetThreshold = NIC_SEND_HANG_THRESHOLD_NORMAL;
-   break;
-   case (RTLLIB_PS_MBCAST|RTLLIB_PS_UNICAST):
-   ResetThreshold = NIC_SEND_HANG_THRESHOLD_POWERSAVE;
-   break;
-   default:
-   ResetThreshold = NIC_SEND_HANG_THRESHOLD_POWERSAVE;
-   break;
-   }
spin_lock_irqsave(&priv->irq_th_lock, flags);
for (QueueID = 0; QueueID < MAX_TX_QUEUE; QueueID++) {
if (QueueID == TXCMD_QUEUE)
@@ -2000,8 +1988,8 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
*skb)
MAX_DEV_ADDR_SIZE);
struct tx_desc *pdesc = NULL;
struct rtllib_hdr_1addr *header = NULL;
-   u16 fc = 0, type = 0, stype = 0;
-   bool  multi_addr = false, broad_addr = false, uni_addr = false;
+   u16 fc = 0, type = 0;
+   bool  multi_addr = false, uni_addr = false;
u8 *pda_addr = NULL;
int   idx;
u32 fwinfo_size = 0;
@@ -2020,14 +2008,11 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
*skb)
header = (struct rtllib_hdr_1addr *)(((u8 *)skb->data) + fwinfo_size);
fc = le16_to_cpu(header->frame_ctl);
type = WLAN_FC_GET_TYPE(fc);
-   stype = WLAN_FC_GET_STYPE(fc);
pda_addr = header->addr1;
 
-   if (is_broadcast_ether_addr(pda_addr))
-   broad_addr = true;
-   else if (is_multicast_ether_addr(pda_addr))
+   if (is_multicast_ether_addr(pda_addr))
multi_addr = true;
-   else
+   else if (!is_broadcast_ether_addr(pda_addr))
uni_addr = true;
 
if (uni_addr)
@@ -3017,8 +3002,6 @@ static void rtl8192_pci_disconnect(struct pci_dev *pdev)
release_mem_region(pci_resource_start(pdev, 1),
pci_resource_len(pdev, 1));
}
-   } else {
-   priv = rtllib_priv(dev);
}
 
pci_disable_device(pdev);
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: core: rtw_mlme: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8188eu/core/rtw_mlme.c |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index d4632da..e2fdc13 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -638,7 +638,6 @@ exit:
 void rtw_surveydone_event_callback(struct adapter  *adapter, u8 *pbuf)
 {
struct  mlme_priv *pmlmepriv = &(adapter->mlmepriv);
-   struct mlme_ext_priv *pmlmeext;
 
spin_lock_bh(&pmlmepriv->lock);
 
@@ -718,8 +717,6 @@ void rtw_surveydone_event_callback(struct adapter   
*adapter, u8 *pbuf)
spin_unlock_bh(&pmlmepriv->lock);
 
rtw_os_xmit_schedule(adapter);
-
-   pmlmeext = &adapter->mlmeextpriv;
 }
 
 void rtw_dummy_event_callback(struct adapter *adapter , u8 *pbuf)
@@ -2042,7 +2039,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, 
uint ie_len)
phtpriv->rx_ampdu_maxlen = max_ampdu_sz;
}
len = 0;
-   p = rtw_get_ie(pie+sizeof(struct ndis_802_11_fixed_ie), 
_HT_ADD_INFO_IE_, &len, ie_len-sizeof(struct ndis_802_11_fixed_ie));
+   rtw_get_ie(pie+sizeof(struct ndis_802_11_fixed_ie), _HT_ADD_INFO_IE_, 
&len, ie_len-sizeof(struct ndis_802_11_fixed_ie));
 
/* update cur_bwmode & cur_ch_offset */
if ((pregistrypriv->cbw40_enable) &&
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192e: rtl8192e: rtl_dm: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c |9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 885315c..11e5aa9 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -455,7 +455,7 @@ static u8   CCKSwingTable_Ch14[CCK_Table_length][8] = {
 static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev)
 {
struct r8192_priv *priv = rtllib_priv(dev);
-   boolbHighpowerstate, viviflag = false;
+   boolviviflag = false;
struct dcmd_txcmd tx_cmd;
u8  powerlevelOFDM24G;
int i = 0, j = 0, k = 0;
@@ -469,7 +469,6 @@ static void dm_TXPowerTrackingCallback_TSSI(struct 
net_device *dev)
write_nic_byte(dev, Pw_Track_Flag, 0);
write_nic_byte(dev, FW_Busy_Flag, 0);
priv->rtllib->bdynamic_txpower_enable = false;
-   bHighpowerstate = priv->bDynamicTxHighPower;
 
powerlevelOFDM24G = (u8)(priv->Pwr_Track>>24);
RF_Type = priv->rf_type;
@@ -2357,7 +2356,7 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev)
u8 cck_default_Rx = 0x2;
u8 cck_optional_Rx = 0x3;
long tmp_cck_max_pwdb = 0, tmp_cck_min_pwdb = 0, tmp_cck_sec_pwdb = 0;
-   u8 cck_rx_ver2_max_index = 0, cck_rx_ver2_min_index = 0;
+   u8 cck_rx_ver2_max_index = 0;
u8 cck_rx_ver2_sec_index = 0;
u8 cur_rf_rssi;
long cur_cck_pwdb;
@@ -2441,7 +2440,6 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev)
 
if (rf_num == 1) {
cck_rx_ver2_max_index = i;
-   cck_rx_ver2_min_index = i;
cck_rx_ver2_sec_index = i;
tmp_cck_max_pwdb = cur_cck_pwdb;
tmp_cck_min_pwdb = cur_cck_pwdb;
@@ -2454,7 +2452,6 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev)
tmp_cck_sec_pwdb = cur_cck_pwdb;
tmp_cck_min_pwdb = cur_cck_pwdb;
cck_rx_ver2_sec_index = i;
-   cck_rx_ver2_min_index = i;
}
} else {
if (cur_cck_pwdb > tmp_cck_max_pwdb) {
@@ -2486,11 +2483,9 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev)
} else if (cur_cck_pwdb == 
tmp_cck_min_pwdb) {
if (tmp_cck_sec_pwdb == 
tmp_cck_min_pwdb) {
tmp_cck_min_pwdb = 
cur_cck_pwdb;
-   cck_rx_ver2_min_index = 
i;
}
} else if (cur_cck_pwdb < 
tmp_cck_min_pwdb) {
tmp_cck_min_pwdb = cur_cck_pwdb;
-   cck_rx_ver2_min_index = i;
}
}
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192e: rtl8192e: rtl_pci: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_pci.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c
index 2ad92ee..22b6d97 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c
@@ -50,12 +50,10 @@ static void rtl8192_parse_pci_configuration(struct pci_dev 
*pdev,
 bool rtl8192_pci_findadapter(struct pci_dev *pdev, struct net_device *dev)
 {
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
-   u16 VenderID;
u16 DeviceID;
u8  RevisionID;
u16 IrqLine;
 
-   VenderID = pdev->vendor;
DeviceID = pdev->device;
RevisionID = pdev->revision;
pci_read_config_word(pdev, 0x3C, &IrqLine);
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192e: rtl819x_BAProc: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8192e/rtl819x_BAProc.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c 
b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index 0415e02..27a50a8 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -428,7 +428,6 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct 
sk_buff *skb)
 {
 struct rtllib_hdr_3addr *delba = NULL;
union delba_param_set *pDelBaParamSet = NULL;
-   u16 *pReasonCode = NULL;
u8 *dst = NULL;
 
if (skb->len < sizeof(struct rtllib_hdr_3addr) + 6) {
@@ -452,7 +451,6 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct 
sk_buff *skb)
dst = (u8 *)(&delba->addr2[0]);
delba += sizeof(struct rtllib_hdr_3addr);
pDelBaParamSet = (union delba_param_set *)(delba+2);
-   pReasonCode = (u16 *)(delba+4);
 
if (pDelBaParamSet->field.Initiator == 1) {
struct rx_ts_record *pRxTs;
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192u: ieee80211: ieee80211_softmac_wx: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 644368d..c8bfba7 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -308,7 +308,6 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
HT_EXTCHNL_OFFSET chan_offset=0;
HT_CHANNEL_WIDTH bandwidth=0;
int b40M = 0;
-   static int count;
chan = ieee->current_network.channel;
netif_carrier_off(ieee->dev);
 
@@ -357,7 +356,6 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
ieee80211_start_send_beacons(ieee);
 
netif_carrier_on(ieee->dev);
-   count = 0;
up(&ieee->wx_sem);
 
 }
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: hal: rtl8188e_hal_init: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
index 7d460ea..6d42e52 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
@@ -53,7 +53,7 @@ s32 iol_execute(struct adapter *padapter, u8 control)
 {
s32 status = _FAIL;
u8 reg_0x88 = 0;
-   u32 start = 0, passing_time = 0;
+   u32 start = 0;
 
control = control&0x0f;
reg_0x88 = usb_read8(padapter, REG_HMEBOX_E0);
@@ -61,7 +61,7 @@ s32 iol_execute(struct adapter *padapter, u8 control)
 
start = jiffies;
while ((reg_0x88 = usb_read8(padapter, REG_HMEBOX_E0)) & control &&
-  (passing_time = rtw_get_passing_time_ms(start)) < 1000) {
+  rtw_get_passing_time_ms(start) < 1000) {
;
}
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192u: ieee80211: rtl819x_BAProc: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
index cd196ce..3db83da 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
@@ -571,7 +571,6 @@ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, 
struct sk_buff *skb)
 {
 struct ieee80211_hdr_3addr *delba = NULL;
PDELBA_PARAM_SETpDelBaParamSet = NULL;
-   u16 *pReasonCode = NULL;
u8  *dst = NULL;
 
if (skb->len < sizeof(struct ieee80211_hdr_3addr) + 6) {
@@ -594,7 +593,6 @@ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, 
struct sk_buff *skb)
dst = (u8 *)(&delba->addr2[0]);
delba += sizeof(struct ieee80211_hdr_3addr);
pDelBaParamSet = (PDELBA_PARAM_SET)(delba+2);
-   pReasonCode = (u16 *)(delba+4);
 
if(pDelBaParamSet->field.Initiator == 1)
{
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192u: r8192U_core: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8192u/r8192U_core.c |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index e031a25..2c347d0 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -950,7 +950,6 @@ static void rtl8192_data_hard_resume(struct net_device *dev)
 static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device 
*dev, int rate)
 {
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
-   int ret;
unsigned long flags;
cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
u8 queue_index = tcb_desc->queue_index;
@@ -963,7 +962,7 @@ static void rtl8192_hard_data_xmit(struct sk_buff *skb, 
struct net_device *dev,
memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
tcb_desc->bTxEnableFwCalcDur = 1;
skb_push(skb, priv->ieee80211->tx_headroom);
-   ret = rtl8192_tx(dev, skb);
+   rtl8192_tx(dev, skb);
 
spin_unlock_irqrestore(&priv->tx_lock, flags);
 
@@ -2530,7 +2529,6 @@ static short rtl8192_init(struct net_device *dev)
memset(priv->txqueue_to_outpipemap, 0, 9);
 #ifdef PIPE12
{
-   int i = 0;
u8 queuetopipe[] = {3, 2, 1, 0, 4, 8, 7, 6, 5};
memcpy(priv->txqueue_to_outpipemap, queuetopipe, 9);
}
@@ -3393,7 +3391,6 @@ int rtl8192_down(struct net_device *dev)
 void rtl8192_commit(struct net_device *dev)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
-   int reset_status = 0;
if (priv->up == 0)
return;
priv->up = 0;
@@ -3404,7 +3401,7 @@ void rtl8192_commit(struct net_device *dev)
ieee80211_softmac_stop_protocol(priv->ieee80211);
 
rtl8192_rtx_disable(dev);
-   reset_status = _rtl8192_up(dev);
+   _rtl8192_up(dev);
 
 }
 
@@ -3718,10 +3715,9 @@ static void rtl8192_process_phyinfo(struct r8192_priv 
*priv, u8 *buffer,
 
struct ieee80211_hdr_3addr *hdr;
u16 sc;
-   unsigned int frag, seq;
+   unsigned int seq;
hdr = (struct ieee80211_hdr_3addr *)buffer;
sc = le16_to_cpu(hdr->seq_ctl);
-   frag = WLAN_GET_SEQ_FRAG(sc);
seq = WLAN_GET_SEQ_SEQ(sc);
//cosa add 04292008 to record the sequence number
pcurrent_stats->Seq_Num = seq;
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192u: r8192U_dm: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8192u/r8192U_dm.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index 936565d..6daa822 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -548,7 +548,7 @@ static u8   CCKSwingTable_Ch14[CCK_Table_length][8] = {
 static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
-   boolbHighpowerstate, 
viviflag = FALSE;
+   boolviviflag = FALSE;
DCMD_TXCMD_Ttx_cmd;
u8  powerlevelOFDM24G;
int i =0, j = 0, k = 0;
@@ -563,7 +563,6 @@ static void dm_TXPowerTrackingCallback_TSSI(struct 
net_device *dev)
write_nic_byte(dev, 0x1ba, 0);
 
priv->ieee80211->bdynamic_txpower_enable = false;
-   bHighpowerstate = priv->bDynamicTxHighPower;
 
powerlevelOFDM24G = (u8)(priv->Pwr_Track>>24);
RF_Type = priv->rf_type;
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8712: rtl871x_security: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8712/rtl871x_security.c |3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_security.c 
b/drivers/staging/rtl8712/rtl871x_security.c
index c653ad6..5852cab 100644
--- a/drivers/staging/rtl8712/rtl871x_security.c
+++ b/drivers/staging/rtl8712/rtl871x_security.c
@@ -222,7 +222,6 @@ void r8712_wep_encrypt(struct _adapter *padapter, u8 
*pxmitframe)
 void r8712_wep_decrypt(struct _adapter  *padapter, u8 *precvframe)
 {
/* exclude ICV */
-   u8 crc[4];
struct arc4context  mycontext;
u32 length, keylength;
u8 *pframe, *payload, *iv, wepkey[16];
@@ -249,8 +248,6 @@ void r8712_wep_decrypt(struct _adapter  *padapter, u8 
*precvframe)
/* decrypt payload include icv */
arcfour_init(&mycontext, wepkey, 3 + keylength);
arcfour_encrypt(&mycontext, payload, payload,  length);
-   /* calculate icv and compare the icv */
-   *((u32 *)crc) = cpu_to_le32(getcrc32(payload, length - 4));
}
 }
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au: core: rtw_mlme: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8723au/core/rtw_mlme.c |   21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c 
b/drivers/staging/rtl8723au/core/rtw_mlme.c
index 7299ef0..8b2db4b 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -2123,7 +2123,6 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter 
*padapter, u8 *in_ie,
 {
u32 out_len;
int max_rx_ampdu_factor;
-   unsigned char *pframe;
const u8 *p;
struct ieee80211_ht_cap ht_capie;
u8 WMM_IE[7] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00};
@@ -2139,10 +2138,10 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter 
*padapter, u8 *in_ie,
 
if (pmlmepriv->qos_option == 0) {
out_len = *pout_len;
-   pframe = rtw_set_ie23a(out_ie + out_len,
-  WLAN_EID_VENDOR_SPECIFIC,
-  sizeof(WMM_IE), WMM_IE,
-  pout_len);
+   rtw_set_ie23a(out_ie + out_len,
+   WLAN_EID_VENDOR_SPECIFIC,
+   sizeof(WMM_IE), WMM_IE,
+   pout_len);
 
pmlmepriv->qos_option = 1;
}
@@ -2172,18 +2171,18 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter 
*padapter, u8 *in_ie,
ht_capie.ampdu_params_info |=
(IEEE80211_HT_AMPDU_PARM_DENSITY & 0x00);
 
-   pframe = rtw_set_ie23a(out_ie + out_len, WLAN_EID_HT_CAPABILITY,
-   sizeof(struct ieee80211_ht_cap),
-   (unsigned char *)&ht_capie, pout_len);
+   rtw_set_ie23a(out_ie + out_len, WLAN_EID_HT_CAPABILITY,
+   sizeof(struct ieee80211_ht_cap),
+   (unsigned char *)&ht_capie, pout_len);
 
phtpriv->ht_option = true;
 
p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, in_ie, in_len);
if (p && (p[1] == sizeof(struct ieee80211_ht_operation))) {
out_len = *pout_len;
-   pframe = rtw_set_ie23a(out_ie + out_len,
-  WLAN_EID_HT_OPERATION,
-  p[1], p + 2 , pout_len);
+   rtw_set_ie23a(out_ie + out_len,
+   WLAN_EID_HT_OPERATION,
+   p[1], p + 2, pout_len);
}
}
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au: core: rtw_mlme_ext: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8723au/core/rtw_mlme_ext.c |7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
index 0e0f73c..7c60fed 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
@@ -2515,7 +2515,6 @@ static void issue_probersp(struct rtw_adapter *padapter, 
unsigned char *da,
unsigned char *mac, *bssid;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 #ifdef CONFIG_8723AU_AP_MODE
-   const u8 *pwps_ie;
u8 *ssid_ie;
int ssid_ielen;
int ssid_ielen_diff;
@@ -2576,7 +2575,7 @@ static void issue_probersp(struct rtw_adapter *padapter, 
unsigned char *da,
 
 #ifdef CONFIG_8723AU_AP_MODE
if ((pmlmeinfo->state & 0x03) == MSR_AP) {
-   pwps_ie = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT,
+   cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT,
  WLAN_OUI_TYPE_MICROSOFT_WPS,
  cur_network->IEs,
  cur_network->IELength);
@@ -6196,13 +6195,9 @@ int set_chplan_hdl23a(struct rtw_adapter *padapter, 
const u8 *pbuf)
 
 int led_blink_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 {
-   struct LedBlink_param *ledBlink_param;
-
if (!pbuf)
return H2C_PARAMETERS_ERROR;
 
-   ledBlink_param = (struct LedBlink_param *)pbuf;
-
return H2C_SUCCESS;
 }
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au: core: rtw_recv: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8723au/core/rtw_recv.c |   19 +++
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c 
b/drivers/staging/rtl8723au/core/rtw_recv.c
index 559ddde..6068990 100644
--- a/drivers/staging/rtl8723au/core/rtw_recv.c
+++ b/drivers/staging/rtl8723au/core/rtw_recv.c
@@ -1561,7 +1561,6 @@ static int wlanhdr_to_ethhdr (struct recv_frame 
*precvframe)
*ptr = 0x87;
*(ptr + 1) = 0x12;
 
-   eth_type = 0x8712;
/*  append rx status for mp test packets */
 
ptr = skb_pull(skb, (hdrlen - sizeof(struct ethhdr) + 2) - 24);
@@ -1591,17 +1590,15 @@ struct recv_frame *recvframe_defrag(struct rtw_adapter 
*adapter,
struct rtw_queue *defrag_q)
 {
struct list_head *plist, *phead, *ptmp;
-   u8  *data, wlanhdr_offset;
+   u8  wlanhdr_offset;
u8  curfragnum;
struct recv_frame *pnfhdr;
-   struct recv_frame *prframe, *pnextrframe;
-   struct rtw_queue*pfree_recv_queue;
+   struct recv_frame *prframe;
struct sk_buff *skb;
 
 
 
curfragnum = 0;
-   pfree_recv_queue = &adapter->recvpriv.free_recv_queue;
 
phead = get_list_head(defrag_q);
plist = phead->next;
@@ -1622,11 +1619,8 @@ struct recv_frame *recvframe_defrag(struct rtw_adapter 
*adapter,
 
phead = get_list_head(defrag_q);
 
-   data = prframe->pkt->data;
-
list_for_each_safe(plist, ptmp, phead) {
pnfhdr = container_of(plist, struct recv_frame, list);
-   pnextrframe = (struct recv_frame *)pnfhdr;
/* check the fragment sequence  (2nd ~n fragment frame) */
 
if (curfragnum != pnfhdr->attrib.frag_num) {
@@ -1684,7 +1678,7 @@ struct recv_frame *recvframe_chk_defrag23a(struct 
rtw_adapter *padapter,
struct sta_priv *pstapriv;
struct list_head *phead;
struct recv_frame *prtnframe = NULL;
-   struct rtw_queue *pfree_recv_queue, *pdefrag_q;
+   struct rtw_queue *pdefrag_q;
 
 
 
@@ -1692,8 +1686,6 @@ struct recv_frame *recvframe_chk_defrag23a(struct 
rtw_adapter *padapter,
 
pfhdr = precv_frame;
 
-   pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
-
/* need to define struct of wlan header frame ctrl */
ismfrag = pfhdr->attrib.mfrag;
fragnum = pfhdr->attrib.frag_num;
@@ -1798,12 +1790,9 @@ struct recv_frame *recvframe_chk_defrag23a(struct 
rtw_adapter *padapter,
 int amsdu_to_msdu(struct rtw_adapter *padapter, struct recv_frame *prframe);
 int amsdu_to_msdu(struct rtw_adapter *padapter, struct recv_frame *prframe)
 {
-   struct rx_pkt_attrib *pattrib;
struct sk_buff *skb, *sub_skb;
struct sk_buff_head skb_list;
 
-   pattrib = &prframe->attrib;
-
skb = prframe->pkt;
skb_pull(skb, prframe->attrib.hdrlen);
__skb_queue_head_init(&skb_list);
@@ -1921,10 +1910,8 @@ int recv_indicatepkts_in_order(struct rtw_adapter 
*padapter,
struct rx_pkt_attrib *pattrib;
/* u8 index = 0; */
int bPktInBuf = false;
-   struct recv_priv *precvpriv;
struct rtw_queue *ppending_recvframe_queue;
 
-   precvpriv = &padapter->recvpriv;
ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
/* DbgPrint("+recv_indicatepkts_in_order\n"); */
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au: core: rtw_security: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8723au/core/rtw_security.c |3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_security.c 
b/drivers/staging/rtl8723au/core/rtw_security.c
index 715a474..8799ba4 100644
--- a/drivers/staging/rtl8723au/core/rtw_security.c
+++ b/drivers/staging/rtl8723au/core/rtw_security.c
@@ -612,7 +612,6 @@ int rtw_tkip_encrypt23a(struct rtw_adapter *padapter,
u8   hw_hdr_offset = 0;
struct arc4context mycontext;
int curfragnum, length;
-   u32 prwskeylen;
u8  *pframe, *payload, *iv, *prwskey;
union pn48 dot11txpn;
struct  sta_info*stainfo;
@@ -651,8 +650,6 @@ int rtw_tkip_encrypt23a(struct rtw_adapter *padapter,
else
prwskey = &stainfo->dot118021x_UncstKey.skey[0];
 
-   prwskeylen = 16;
-
for (curfragnum = 
0;curfragnumnr_frags;curfragnum++) {
iv = pframe+pattrib->hdrlen;
payload = 
pframe+pattrib->iv_len+pattrib->hdrlen;
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au: core: rtw_sta_mgt: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8723au/core/rtw_sta_mgt.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_sta_mgt.c 
b/drivers/staging/rtl8723au/core/rtw_sta_mgt.c
index d17998d..7a9feb6 100644
--- a/drivers/staging/rtl8723au/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723au/core/rtw_sta_mgt.c
@@ -390,7 +390,6 @@ int rtw_init_bcmc_stainfo23a(struct rtw_adapter *padapter)
 {
struct  sta_priv *pstapriv = &padapter->stapriv;
struct sta_info *psta;
-   struct tx_servq *ptxservq;
int res = _SUCCESS;
 
psta = rtw_alloc_stainfo23a(pstapriv, bc_addr, GFP_KERNEL);
@@ -403,7 +402,6 @@ int rtw_init_bcmc_stainfo23a(struct rtw_adapter *padapter)
/*  default broadcast & multicast use macid 1 */
psta->mac_id = 1;
 
-   ptxservq = &psta->sta_xmitpriv.be_q;
return _SUCCESS;
 }
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au: core: rtw_wlan_util: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8723au/core/rtw_wlan_util.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c 
b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
index 69d9e0f..ee2d024 100644
--- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
@@ -1531,7 +1531,7 @@ void process_addba_req23a(struct rtw_adapter *padapter,
  u8 *paddba_req, u8 *addr)
 {
struct sta_info *psta;
-   u16 tid, start_seq, param;
+   u16 tid, param;
struct recv_reorder_ctrl *preorder_ctrl;
struct sta_priv *pstapriv = &padapter->stapriv;
struct ADDBA_request *preq = (struct ADDBA_request *)paddba_req;
@@ -1541,8 +1541,6 @@ void process_addba_req23a(struct rtw_adapter *padapter,
psta = rtw_get_stainfo23a(pstapriv, addr);
 
if (psta) {
-   start_seq = le16_to_cpu(preq->BA_starting_seqctrl) >> 4;
-
param = le16_to_cpu(preq->BA_para_set);
tid = (param >> 2) & 0x0f;
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au: hal: HalDMOutSrc8723A_CE: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c 
b/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
index 179a1ba..3cbbfb7 100644
--- a/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
+++ b/drivers/staging/rtl8723au/hal/HalDMOutSrc8723A_CE.c
@@ -743,10 +743,8 @@ static void _PHY_IQCalibrate(struct rtw_adapter *pAdapter, 
int result[][8], u8 t
/*  Note: IQ calibration must be performed after loading  */
/*  PHY_REG.txt , and radio_a, radio_b.txt   */
 
-   u32 bbvalue;
-
if (t == 0) {
-   bbvalue = PHY_QueryBBReg(pAdapter, rFPGA0_RFMOD, bMaskDWord);
+   PHY_QueryBBReg(pAdapter, rFPGA0_RFMOD, bMaskDWord);
 
/*  Save ADDA parameters, turn Path A ADDA on */
_PHY_SaveADDARegisters(pAdapter, ADDA_REG, 
pdmpriv->ADDA_backup, IQK_ADDA_REG_NUM);
@@ -1047,7 +1045,7 @@ void rtl8723a_phy_iq_calibrate(struct rtw_adapter 
*pAdapter, bool bReCovery)
bPathAOK = bPathBOK = true;
} else {
RegE94 = RegEB4 = pdmpriv->RegE94 = pdmpriv->RegEB4 = 0x100;
/* X default value */
-   RegE9C = RegEBC = pdmpriv->RegE9C = pdmpriv->RegEBC = 0x0;  
/* Y default value */
+   pdmpriv->RegE9C = pdmpriv->RegEBC = 0x0;/* Y 
default value */
}
 
if ((RegE94 != 0)/*&&(RegEA4 != 0)*/)
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au: hal: rtl8723a_bt-coexist: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 .../staging/rtl8723au/hal/rtl8723a_bt-coexist.c|   27 +++-
 1 file changed, 3 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
index 86a8397..dae3a33 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
@@ -219,7 +219,6 @@ static void bthci_DecideBTChannel(struct rtw_adapter 
*padapter, u8 EntryNum)
struct chnl_txpower_triple *pTriple_subband = NULL;
struct common_triple *pTriple;
u8 i, j, localchnl, firstRemoteLegalChnlInTriplet = 0;
-   u8 regulatory_skipLen = 0;
u8 subbandTripletCnt = 0;
 
pmlmepriv = &padapter->mlmepriv;
@@ -243,7 +242,6 @@ static void bthci_DecideBTChannel(struct rtw_adapter 
*padapter, u8 EntryNum)
/*  Regulatory Extension Identifier, skip it */
RTPRINT(FIOCTL, (IOCTL_BT_HCICMD|IOCTL_BT_LOGO),
("Find Regulatory ID, regulatory class = %d\n", 
pTriple->byte_2nd));
-   regulatory_skipLen += 3;
pTriple_subband = NULL;
continue;
} else {/*  Sub-band triplet */
@@ -5203,12 +5201,8 @@ static void btdm_NotifyFwScan(struct rtw_adapter 
*padapter, u8 scanType)
 static void btdm_1AntSetPSMode(struct rtw_adapter *padapter,
   u8 enable, u8 smartps, u8 mode)
 {
-   struct pwrctrl_priv *pwrctrl;
-
RTPRINT(FBT, BT_TRACE, ("[BTCoex], Current LPS(%s, %d), smartps =%d\n", 
enable == true?"ON":"OFF", mode, smartps));
 
-   pwrctrl = &padapter->pwrctrlpriv;
-
if (enable == true) {
rtw_set_ps_mode23a(padapter, PS_MODE_MIN, smartps, mode);
} else {
@@ -5549,7 +5543,7 @@ static s8 btdm_1AntTdmaJudgement(struct rtw_adapter 
*padapter, u8 retry)
 {
struct hal_data_8723a *pHalData;
struct btdm_8723a_1ant *pBtdm8723;
-   static s8 up, dn, m = 1, n = 3, WaitCount;
+   static s8 up, dn, m = 1, WaitCount;
s8 ret;
 
pHalData = GET_HAL_DATA(padapter);
@@ -5560,7 +5554,6 @@ static s8 btdm_1AntTdmaJudgement(struct rtw_adapter 
*padapter, u8 retry)
up = 0;
dn = 0;
m = 1;
-   n = 3;
WaitCount = 0;
} else {
WaitCount++;
@@ -5576,7 +5569,6 @@ static s8 btdm_1AntTdmaJudgement(struct rtw_adapter 
*padapter, u8 retry)
/*  retry = 0 in consecutive 3m*(2s), add WiFi duration 
*/
ret = 1;
 
-   n = 3;
up = 0;
dn = 0;
WaitCount = 0;
@@ -5693,13 +5685,11 @@ static void btdm_1AntTdmaDurationAdjustForACL(struct 
rtw_adapter *padapter)
 
 static void btdm_1AntCoexProcessForWifiConnect(struct rtw_adapter *padapter)
 {
-   struct mlme_priv *pmlmepriv;
struct hal_data_8723a *pHalData;
struct bt_coexist_8723a *pBtCoex;
struct btdm_8723a_1ant *pBtdm8723;
u8 BtState;
 
-   pmlmepriv = &padapter->mlmepriv;
pHalData = GET_HAL_DATA(padapter);
pBtCoex = &pHalData->bt_coexist.halCoex8723;
pBtdm8723 = &pBtCoex->btdm1Ant;
@@ -6272,12 +6262,10 @@ void BTDM_1AntForDhcp(struct rtw_adapter *padapter)
struct hal_data_8723a *pHalData;
u8 BtState;
struct bt_coexist_8723a *pBtCoex;
-   struct btdm_8723a_1ant *pBtdm8723;
 
pHalData = GET_HAL_DATA(padapter);
pBtCoex = &pHalData->bt_coexist.halCoex8723;
BtState = pBtCoex->c2hBtInfo;
-   pBtdm8723 = &pBtCoex->btdm1Ant;
 
RTPRINT(FBT, BT_TRACE, ("\n[BTCoex], 1Ant for DHCP\n"));
RTPRINT(FBT, BT_TRACE, ("[BTCoex], 1Ant for DHCP, WiFi is %s\n",
@@ -6421,11 +6409,9 @@ static void BTDM_1AntFwC2hBtInfo8723A(struct rtw_adapter 
*padapter)
 void BTDM_1AntBtCoexist8723A(struct rtw_adapter *padapter)
 {
struct mlme_priv *pmlmepriv;
-   struct hal_data_8723a *pHalData;
unsigned long delta_time;
 
pmlmepriv = &padapter->mlmepriv;
-   pHalData = GET_HAL_DATA(padapter);
 
if (check_fwstate(pmlmepriv, WIFI_SITE_MONITOR)) {
/*  already done in BTDM_1AntForScan() */
@@ -8463,10 +8449,7 @@ static void btdm_2Ant8723AHIDA2DPAction(struct 
rtw_adapter *padapter)
 
 static void btdm_2Ant8723AA2dp(struct rtw_adapter *padapter)
 {
-   struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
-   u8 btRssiState, btRssiState1, btInfoExt;
-
-   btInfoExt = pHalData->bt_coexist.halCoex8723.btInfoExt;
+   u8 btRssiState, btRssiState1;
 
if (btdm_NeedT

[PATCH] staging: rtl8723au: hal: rtl8723a_hal_init: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c |   10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index a5eadd4..f2bcf4f 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -604,7 +604,7 @@ rtl8723a_readefuse(struct rtw_adapter *padapter,
 u16 rtl8723a_EfuseGetCurrentSize_WiFi(struct rtw_adapter *padapter)
 {
u16 efuse_addr = 0;
-   u8 hoffset = 0, hworden = 0;
+   u8 hworden = 0;
u8 efuse_data, word_cnts = 0;
struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
 
@@ -627,17 +627,14 @@ u16 rtl8723a_EfuseGetCurrentSize_WiFi(struct rtw_adapter 
*padapter)
break;
 
if (EXT_HEADER(efuse_data)) {
-   hoffset = GET_HDR_OFFSET_2_0(efuse_data);
efuse_addr++;
efuse_OneByteRead23a(padapter, efuse_addr, &efuse_data);
if (ALL_WORDS_DISABLED(efuse_data)) {
continue;
}
 
-   hoffset |= ((efuse_data & 0xF0) >> 1);
hworden = efuse_data & 0x0F;
} else {
-   hoffset = (efuse_data >> 4) & 0x0F;
hworden = efuse_data & 0x0F;
}
 
@@ -657,7 +654,7 @@ u16 rtl8723a_EfuseGetCurrentSize_BT(struct rtw_adapter 
*padapter)
u16 btusedbytes;
u16 efuse_addr;
u8 bank, startBank;
-   u8 hoffset = 0, hworden = 0;
+   u8 hworden = 0;
u8 efuse_data, word_cnts = 0;
u16 retU2 = 0;
struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
@@ -700,7 +697,6 @@ u16 rtl8723a_EfuseGetCurrentSize_BT(struct rtw_adapter 
*padapter)
break;
 
if (EXT_HEADER(efuse_data)) {
-   hoffset = GET_HDR_OFFSET_2_0(efuse_data);
efuse_addr++;
efuse_OneByteRead23a(padapter, efuse_addr,
  &efuse_data);
@@ -709,10 +705,8 @@ u16 rtl8723a_EfuseGetCurrentSize_BT(struct rtw_adapter 
*padapter)
continue;
}
 
-   hoffset |= ((efuse_data & 0xF0) >> 1);
hworden = efuse_data & 0x0F;
} else {
-   hoffset = (efuse_data >> 4) & 0x0F;
hworden = efuse_data & 0x0F;
}
word_cnts = Efuse_CalculateWordCnts23a(hworden);
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723au: hal: usb_ops_linux: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/rtl8723au/hal/usb_ops_linux.c |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_ops_linux.c 
b/drivers/staging/rtl8723au/hal/usb_ops_linux.c
index a6d16ad..4ae0a8a 100644
--- a/drivers/staging/rtl8723au/hal/usb_ops_linux.c
+++ b/drivers/staging/rtl8723au/hal/usb_ops_linux.c
@@ -26,11 +26,10 @@ u8 rtl8723au_read8(struct rtw_adapter *padapter, u16 addr)
 {
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
struct usb_device *udev = pdvobjpriv->pusbdev;
-   int len;
u8 data;
 
mutex_lock(&pdvobjpriv->usb_vendor_req_mutex);
-   len = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+   usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
  REALTEK_USB_VENQT_CMD_REQ, REALTEK_USB_VENQT_READ,
  addr, 0, &pdvobjpriv->usb_buf.val8, sizeof(data),
  RTW_USB_CONTROL_MSG_TIMEOUT);
@@ -45,11 +44,10 @@ u16 rtl8723au_read16(struct rtw_adapter *padapter, u16 addr)
 {
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
struct usb_device *udev = pdvobjpriv->pusbdev;
-   int len;
u16 data;
 
mutex_lock(&pdvobjpriv->usb_vendor_req_mutex);
-   len = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+   usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
  REALTEK_USB_VENQT_CMD_REQ, REALTEK_USB_VENQT_READ,
  addr, 0, &pdvobjpriv->usb_buf.val16, sizeof(data),
  RTW_USB_CONTROL_MSG_TIMEOUT);
@@ -64,11 +62,10 @@ u32 rtl8723au_read32(struct rtw_adapter *padapter, u16 addr)
 {
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
struct usb_device *udev = pdvobjpriv->pusbdev;
-   int len;
u32 data;
 
mutex_lock(&pdvobjpriv->usb_vendor_req_mutex);
-   len = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
+   usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
  REALTEK_USB_VENQT_CMD_REQ, REALTEK_USB_VENQT_READ,
  addr, 0, &pdvobjpriv->usb_buf.val32, sizeof(data),
  RTW_USB_CONTROL_MSG_TIMEOUT);
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: slicoss: slicoss: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/slicoss/slicoss.c |   12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index 42d62ef..41b3687 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -1395,14 +1395,11 @@ static void slic_cmdq_reset(struct adapter *adapter)
 {
struct slic_hostcmd *hcmd;
struct sk_buff *skb;
-   u32 outstanding;
 
spin_lock_irqsave(&adapter->cmdq_free.lock.lock,
adapter->cmdq_free.lock.flags);
spin_lock_irqsave(&adapter->cmdq_done.lock.lock,
adapter->cmdq_done.lock.flags);
-   outstanding = adapter->cmdq_all.count - adapter->cmdq_done.count;
-   outstanding -= adapter->cmdq_free.count;
hcmd = adapter->cmdq_all.head;
while (hcmd) {
if (hcmd->busy) {
@@ -1728,7 +1725,6 @@ static u32 slic_rcvqueue_reinsert(struct adapter 
*adapter, struct sk_buff *skb)
  */
 static void slic_link_event_handler(struct adapter *adapter)
 {
-   int status;
struct slic_shmem *pshmem;
 
if (adapter->state != ADAPT_UP) {
@@ -1739,13 +1735,13 @@ static void slic_link_event_handler(struct adapter 
*adapter)
pshmem = (struct slic_shmem *)(unsigned long)adapter->phys_shmem;
 
 #if BITS_PER_LONG == 64
-   status = slic_upr_request(adapter,
+   slic_upr_request(adapter,
  SLIC_UPR_RLSR,
  SLIC_GET_ADDR_LOW(&pshmem->linkstatus),
  SLIC_GET_ADDR_HIGH(&pshmem->linkstatus),
  0, 0);
 #else
-   status = slic_upr_request(adapter, SLIC_UPR_RLSR,
+   slic_upr_request(adapter, SLIC_UPR_RLSR,
(u32) &pshmem->linkstatus,  /* no 4GB wrap guaranteed */
  0, 0, 0);
 #endif
@@ -2087,8 +2083,6 @@ static void slic_interrupt_card_up(u32 isr, struct 
adapter *adapter,
adapter->error_interrupts++;
if (isr & ISR_RMISS) {
int count;
-   int pre_count;
-   int errors;
 
struct slic_rcvqueue *rcvq =
&adapter->rcvqueue;
@@ -2097,8 +2091,6 @@ static void slic_interrupt_card_up(u32 isr, struct 
adapter *adapter,
 
if (!rcvq->errors)
rcv_count = rcvq->count;
-   pre_count = rcvq->count;
-   errors = rcvq->errors;
 
while (rcvq->count < SLIC_RCVQ_FILLTHRESH) {
count = slic_rcvqueue_fill(adapter);
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: speakup: varhandlers: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/speakup/varhandlers.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/speakup/varhandlers.c 
b/drivers/staging/speakup/varhandlers.c
index 1b0d1c0..4618ae1 100644
--- a/drivers/staging/speakup/varhandlers.c
+++ b/drivers/staging/speakup/varhandlers.c
@@ -178,7 +178,6 @@ int spk_set_num_var(int input, struct st_var_header *var, 
int how)
int val;
short ret = 0;
int *p_val = var->p_val;
-   int l;
char buf[32];
char *cp;
struct var_t *var_data = var->data;
@@ -235,10 +234,9 @@ int spk_set_num_var(int input, struct st_var_header *var, 
int how)
else
cp = buf;
if (!var_data->u.n.out_str)
-   l = sprintf(cp, var_data->u.n.synth_fmt, (int)val);
+   sprintf(cp, var_data->u.n.synth_fmt, (int)val);
else
-   l = sprintf(cp,
-   var_data->u.n.synth_fmt, var_data->u.n.out_str[val]);
+   sprintf(cp, var_data->u.n.synth_fmt, 
var_data->u.n.out_str[val]);
synth_printf("%s", cp);
return ret;
 }
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: vt6655: device_main: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/vt6655/device_main.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index cd1a277..77dcb3fc 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -540,7 +540,6 @@ static bool device_get_pci_info(struct vnt_private *pDevice,
 {
u16 pci_cmd;
u8  b;
-   unsigned int cis_addr;
 
pci_read_config_byte(pcid, PCI_REVISION_ID, &pDevice->byRevId);
pci_read_config_word(pcid, PCI_SUBSYSTEM_ID, &pDevice->SubSystemID);
@@ -552,7 +551,7 @@ static bool device_get_pci_info(struct vnt_private *pDevice,
pDevice->memaddr = pci_resource_start(pcid, 0);
pDevice->ioaddr = pci_resource_start(pcid, 1);
 
-   cis_addr = pci_resource_start(pcid, 2);
+   pci_resource_start(pcid, 2);
 
pDevice->pcid = pcid;
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: vt6655: dpc: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/vt6655/dpc.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index 977683c..9e9da3c 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -43,7 +43,7 @@ static bool vnt_rx_data(struct vnt_private *priv, struct 
sk_buff *skb,
struct ieee80211_rx_status rx_status = { 0 };
struct ieee80211_hdr *hdr;
__le16 fc;
-   u8 *rsr, *new_rsr, *rssi;
+   u8 *rssi;
__le64 *tsf_time;
u16 frame_size;
int ii, r;
@@ -88,9 +88,7 @@ static bool vnt_rx_data(struct vnt_private *priv, struct 
sk_buff *skb,
 
tsf_time = (__le64 *)(skb_data + bytes_received - 12);
sq = skb_data + bytes_received - 4;
-   new_rsr = skb_data + bytes_received - 3;
rssi = skb_data + bytes_received - 2;
-   rsr = skb_data + bytes_received - 1;
 
RFvRSSITodBm(priv, *rssi, &rx_dbm);
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: vt6656: dpc: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/vt6656/dpc.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
index e6367ed..0bcc092 100644
--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -45,7 +45,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
struct ieee80211_rx_status rx_status = { 0 };
struct ieee80211_hdr *hdr;
__le16 fc;
-   u8 *rsr, *new_rsr, *rssi, *frame;
+   u8 *rsr, *new_rsr, *rssi;
__le64 *tsf_time;
u32 frame_size;
int ii, r;
@@ -147,8 +147,6 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
priv->bb_pre_ed_rssi = (u8)rx_dbm + 1;
priv->current_rssi = priv->bb_pre_ed_rssi;
 
-   frame = skb_data + 8;
-
skb_pull(skb, 8);
skb_trim(skb, frame_size);
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: vt6656: int: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/vt6656/int.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/vt6656/int.c b/drivers/staging/vt6656/int.c
index 2ef70e4..2a9ab899 100644
--- a/drivers/staging/vt6656/int.c
+++ b/drivers/staging/vt6656/int.c
@@ -56,13 +56,12 @@ static const u8 fallback_rate1[5][5] = {
 void vnt_int_start_interrupt(struct vnt_private *priv)
 {
unsigned long flags;
-   int status;
 
dev_dbg(&priv->usb->dev, ">Interrupt Polling Thread\n");
 
spin_lock_irqsave(&priv->lock, flags);
 
-   status = vnt_start_interrupt_urb(priv);
+   vnt_start_interrupt_urb(priv);
 
spin_unlock_irqrestore(&priv->lock, flags);
 }
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: vt6656: rxtx: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/vt6656/rxtx.c |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index ea5140a..aa7b7c5 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -786,7 +786,7 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff 
*skb)
unsigned long flags;
u16 tx_bytes, tx_header_size, tx_body_size, current_rate, duration_id;
u8 pkt_type, fb_option = AUTO_FB_NONE;
-   bool need_rts = false, is_pspoll = false;
+   bool need_rts = false;
bool need_mic = false;
 
hdr = (struct ieee80211_hdr *)(skb->data);
@@ -869,9 +869,6 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff 
*skb)
if (ieee80211_has_a4(hdr->frame_control))
tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_LHEAD);
 
-   if (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER)
-   is_pspoll = true;
-
tx_buffer_head->frag_ctl =
cpu_to_le16(ieee80211_get_hdrlen_from_skb(skb) << 10);
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: xgifb: vb_init: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/xgifb/vb_init.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 2b233af..6384077 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -1187,7 +1187,7 @@ unsigned char XGIInitNew(struct pci_dev *pdev)
struct xgi_hw_device_info *HwDeviceExtension = &xgifb_info->hw_info;
struct vb_device_info VBINF;
struct vb_device_info *pVBInfo = &VBINF;
-   unsigned char i, temp = 0, temp1;
+   unsigned char i, temp = 0;
 
pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress;
 
@@ -1286,8 +1286,6 @@ unsigned char XGIInitNew(struct pci_dev *pdev)
/* disable VideoCapture */
xgifb_reg_and_or(pVBInfo->Part0Port, 0x3F, 0xEF, 0x00);
xgifb_reg_set(pVBInfo->Part1Port, 0x00, 0x00);
-   /* chk if BCLK>=100MHz */
-   temp1 = xgifb_reg_get(pVBInfo->P3d4, 0x7B);
 
xgifb_reg_set(pVBInfo->Part1Port,
  0x02, XGI330_CRT2Data_1_2);
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: xgifb: vb_setmode: Removed variables that is never used

2015-01-31 Thread Rickard Strandqvist
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
 drivers/staging/xgifb/vb_setmode.c |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/xgifb/vb_setmode.c 
b/drivers/staging/xgifb/vb_setmode.c
index 1f6f699..6eb8c55 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -730,7 +730,6 @@ static void XGI_SetCRT1DE(unsigned short ModeIdIndex,
tempax |= 0x40;
 
xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x42, tempax);
-   data = xgifb_reg_get(pVBInfo->P3d4, 0x07);
tempax = 0;
 
if (tempbx & 0x04)
@@ -2245,9 +2244,8 @@ static unsigned char XGI_XG27GetPSCValue(struct 
vb_device_info *pVBInfo)
 static void XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short tempbl,
struct vb_device_info *pVBInfo)
 {
-   unsigned char CR4A, temp;
+   unsigned char temp;
 
-   CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A);
tempbh &= 0x23;
tempbl &= 0x23;
xgifb_reg_and(pVBInfo->P3d4, 0x4A, ~tempbh); /* enable GPIO write */
@@ -2271,7 +2269,7 @@ static void XGI_XG21BLSignalVDD(unsigned short tempbh, 
unsigned short tempbl,
 static void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl,
struct vb_device_info *pVBInfo)
 {
-   unsigned char CR4A, temp;
+   unsigned char temp;
unsigned short tempbh0, tempbl0;
 
tempbh0 = tempbh;
@@ -2290,7 +2288,6 @@ static void XGI_XG27BLSignalVDD(unsigned short tempbh, 
unsigned short tempbl,
}
xgifb_reg_and_or(pVBInfo->P3d4, 0xB4, ~tempbh0, tempbl0);
 
-   CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A);
tempbh &= 0x03;
tempbl &= 0x03;
tempbh <<= 2;
@@ -5160,7 +5157,7 @@ unsigned short XGI_GetRatePtrCRT2(struct 
xgi_hw_device_info *pXGIHWDE,
}
i--;
if ((pVBInfo->SetFlag & ProgrammingCRT2)) {
-   temp = XGI_AjustCRT2Rate(ModeIdIndex, RefreshRateTableIndex,
+   XGI_AjustCRT2Rate(ModeIdIndex, RefreshRateTableIndex,
 &i, pVBInfo);
}
return RefreshRateTableIndex + i;
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8188eu: hal: phy: Removed variables that is never used

2015-01-31 Thread Dan Carpenter
> I have also removed all the code that thereby serves no purpose.

[ snip ]

> @@ -743,7 +743,7 @@ static u8 phy_path_a_iqk(struct adapter *adapt, bool 
> config_pathb)
>   reg_eac = phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord);
>   reg_e94 = phy_query_bb_reg(adapt, rTx_Power_Before_IQK_A, bMaskDWord);
>   reg_e9c = phy_query_bb_reg(adapt, rTx_Power_After_IQK_A, bMaskDWord);
> - reg_ea4 = phy_query_bb_reg(adapt, rRx_Power_Before_IQK_A_2, bMaskDWord);
> + phy_query_bb_reg(adapt, rRx_Power_Before_IQK_A_2, bMaskDWord);
>  
>   if (!(reg_eac & BIT28) &&
>   (((reg_e94 & 0x03FF)>>16) != 0x142) &&

You clearly didn't remove *all* the "code that thereby serves no
purpose".

Could we call a cease fire on these and stop sending them until Greg or
someone else weighs in?  It's hard for me to comment on 50 patches that
I don't like.

To re-iterate:

1) Removing part of the line is 90% likely to be wrong.  We can't know
   without knowing the code better, knowing the hardware, or testing.

2) Silencing static checker warnings in the wrong way, negates the
   usefulness of static checkers and makes bad code hard to find.  Some
   of these "unused" variable warnings could easily be bugs so we are
   hiding bugs.

3) From an aesthetic point of view the code was easier to understand
   before.  The line you have deleted was clearly copy and pasted from
   the line before.  But now it looks deliberate and the information we
   need to understand the original intent is hidden in the git log.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8188eu: core: rtw_mlme: Removed variables that is never used

2015-01-31 Thread Dan Carpenter
On Sat, Jan 31, 2015 at 03:44:33PM +0100, Rickard Strandqvist wrote:
> Variable was assigned a value that was never used.
> I have also removed all the code that thereby serves no purpose.
> 
> This was found using a static code analysis program called cppcheck
> 
> Signed-off-by: Rickard Strandqvist 
> ---

> @@ -2042,7 +2039,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 
> *pie, uint ie_len)
>   phtpriv->rx_ampdu_maxlen = max_ampdu_sz;
>   }
>   len = 0;
> - p = rtw_get_ie(pie+sizeof(struct ndis_802_11_fixed_ie), 
> _HT_ADD_INFO_IE_, &len, ie_len-sizeof(struct ndis_802_11_fixed_ie));
> + rtw_get_ie(pie+sizeof(struct ndis_802_11_fixed_ie), _HT_ADD_INFO_IE_, 
> &len, ie_len-sizeof(struct ndis_802_11_fixed_ie));

Nope.

And delete the "len = 0" line as well.

Rickard, these are too many patches and you didn't think about them
carefully enough.  I'm not reviewing the rest.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8188eu: core: rtw_sta_mgt: Removed variables that is never used

2015-01-31 Thread Dan Carpenter
On Sat, Jan 31, 2015 at 03:45:33PM +0100, Rickard Strandqvist wrote:
>   while (phead != plist) {
> - psta = container_of(plist, struct sta_info , list);
> + container_of(plist, struct sta_info, list);


Argh!!!  No.

For this one, I didn't need an context to see that it was wrong, so I
accidentally reviewed it instead of just marking it as read.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Warning that occured while compiling the nvec in 3.19.0-rc5+ is fixed

2015-01-31 Thread Greg KH
On Sat, Jan 31, 2015 at 05:24:42PM +0530, varsharamt wrote:
> The task was to fix  a warning which was shown while compiling a driver
> called NVEC. I wrote a brief description about how to enable support for
> a nVidya complaint embedded controller.

This makes no sense, what "task"?

> Signed-off-by:Varsha Ram T

Please use proper spaces.

Also, this doesn't match your From: line.  And, is this the name you use
to sign legal documents?


> ---
>  drivers/staging/nvec/Kconfig | 20 ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/nvec/Kconfig b/drivers/staging/nvec/Kconfig
> index 9475e20..a65ad4c 100644
> --- a/drivers/staging/nvec/Kconfig
> +++ b/drivers/staging/nvec/Kconfig
> @@ -3,33 +3,33 @@ config MFD_NVEC
>   depends on I2C && GPIOLIB && ARCH_TEGRA
>   select MFD_CORE
>   help
> - Say Y here to enable support for a nVidia compliant embedded
> - controller.
> + Say Y to enable support for a nVidia complaint embedded controller.
> + nVidia complaint embedded controller is used to communicate with EC.
> + This is done through I2C bus.
> + The request to the EC can be initiated by triggering a gpio line.
> + The gpio line is a generic pin on integrated circuit whose input or 
> output pin can be controlled by the user at run time.


There's no way this is correct, look at how long your line is.

>  
>  config KEYBOARD_NVEC
>   tristate "Keyboard on nVidia compliant EC"
>   depends on MFD_NVEC && INPUT
>   help
> -   Say Y here to enable support for a keyboard connected to
> -   a nVidia compliant embedded controller.
> + Say Y here to enable support for a keyboard connected to a nVidia 
> compliant embedded controller.

Why did you change these lines and the rest of the lines in this patch?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8188eu: core: rtw_sta_mgt: Removed variables that is never used

2015-01-31 Thread Larry Finger

On 01/31/2015 10:19 AM, Dan Carpenter wrote:

On Sat, Jan 31, 2015 at 03:45:33PM +0100, Rickard Strandqvist wrote:

while (phead != plist) {
-   psta = container_of(plist, struct sta_info , list);
+   container_of(plist, struct sta_info, list);



Argh!!!  No.

For this one, I didn't need an context to see that it was wrong, so I
accidentally reviewed it instead of just marking it as read.



Dan,

This guy does not have a brain - he only knows how to run cppcheck. You cannot 
expect him to think about what he does. In addition, he does not have any of the 
hardware that uses the drivers he is mangling. He can only test that it builds 
correctly. Do not bother to ever review anything he sends.


Earlier this month, he submitted a set of patches that impacted routines that I 
was working on. I asked him to hold those until I was finished to avoid 
conflicts. Guess what? The same set was resubmitted 4 days later!!


He was told that sets of patches were supposed to be submitted with a [PATCH 
X/Y] structure, but he has ignored that suggestion, thus there is no way to send 
an overall NACK.


@Greg: Please put this guy on your permanent blacklist. It takes too much time 
to read and respond to his multiple posts. Kalle has already done that for wireless.


Larry

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8192e: Fixed unnecessary line continuation.

2015-01-31 Thread Kolbeinn Karlsson
Fixed a coding style issue.

Signed-off-by: Kolbeinn Karlsson 
---
 drivers/staging/rtl8192e/rtllib_module.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_module.c 
b/drivers/staging/rtl8192e/rtllib_module.c
index 91e98e8..0cf3809 100644
--- a/drivers/staging/rtl8192e/rtllib_module.c
+++ b/drivers/staging/rtl8192e/rtllib_module.c
@@ -202,9 +202,7 @@ void free_rtllib(struct net_device *dev)
 EXPORT_SYMBOL(free_rtllib);
 
 u32 rtllib_debug_level;
-static int debug = \
-   RTLLIB_DL_ERR
-   ;
+static int debug = RTLLIB_DL_ERR;
 static struct proc_dir_entry *rtllib_proc;
 
 static int show_debug_level(struct seq_file *m, void *v)
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Warning that occured while compiling the nvec in 3.19.0-rc5+ is fixed

2015-01-31 Thread Julian Andres Klode
On 31 January 2015 at 17:29, Greg KH  wrote:
> On Sat, Jan 31, 2015 at 05:24:42PM +0530, varsharamt wrote:
>> The task was to fix  a warning which was shown while compiling a driver
>> called NVEC. I wrote a brief description about how to enable support for
>> a nVidya complaint embedded controller.
>
> This makes no sense, what "task"?
>
>> Signed-off-by:Varsha Ram T
>
> Please use proper spaces.
>
> Also, this doesn't match your From: line.  And, is this the name you use
> to sign legal documents?
>
>
>> ---
>>  drivers/staging/nvec/Kconfig | 20 ++--
>>  1 file changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/staging/nvec/Kconfig b/drivers/staging/nvec/Kconfig
>> index 9475e20..a65ad4c 100644
>> --- a/drivers/staging/nvec/Kconfig
>> +++ b/drivers/staging/nvec/Kconfig
>> @@ -3,33 +3,33 @@ config MFD_NVEC
>>   depends on I2C && GPIOLIB && ARCH_TEGRA
>>   select MFD_CORE
>>   help
>> - Say Y here to enable support for a nVidia compliant embedded
>> - controller.
>> + Say Y to enable support for a nVidia complaint embedded controller.
>> + nVidia complaint embedded controller is used to communicate with EC.
>> + This is done through I2C bus.
>> + The request to the EC can be initiated by triggering a gpio line.
>> + The gpio line is a generic pin on integrated circuit whose input or 
>> output pin can be controlled by the user at run time.
>
>
> There's no way this is correct, look at how long your line is.
>

I'm not even sure if this level of detail is needed. Why should anyone
that reads the config option care how NVEC is enabled or communicated
with?

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Warning that occured while compiling the nvec in3.19.0-rc5+ is fixed

2015-01-31 Thread Marc Dietrich
Am Samstag 31 Januar 2015, 20:11:29 schrieb Julian Andres Klode:
> On 31 January 2015 at 17:29, Greg KH  wrote:
> > On Sat, Jan 31, 2015 at 05:24:42PM +0530, varsharamt wrote:
> >> The task was to fix  a warning which was shown while compiling a driver
> >> called NVEC. I wrote a brief description about how to enable support for
> >> a nVidya complaint embedded controller.
> > 
> > This makes no sense, what "task"?
> > 
> >> Signed-off-by:Varsha Ram T
> > 
> > Please use proper spaces.
> > 
> > Also, this doesn't match your From: line.  And, is this the name you use
> > to sign legal documents?
> > 
> >> ---
> >> 
> >>  drivers/staging/nvec/Kconfig | 20 ++--
> >>  1 file changed, 10 insertions(+), 10 deletions(-)
> >> 
> >> diff --git a/drivers/staging/nvec/Kconfig b/drivers/staging/nvec/Kconfig
> >> index 9475e20..a65ad4c 100644
> >> --- a/drivers/staging/nvec/Kconfig
> >> +++ b/drivers/staging/nvec/Kconfig
> >> @@ -3,33 +3,33 @@ config MFD_NVEC
> >> 
> >>   depends on I2C && GPIOLIB && ARCH_TEGRA
> >>   select MFD_CORE
> >>   help
> >> 
> >> - Say Y here to enable support for a nVidia compliant embedded
> >> - controller.
> >> + Say Y to enable support for a nVidia complaint embedded controller.
> >> + nVidia complaint embedded controller is used to communicate with
> >> EC.
> >> + This is done through I2C bus.
> >> + The request to the EC can be initiated by triggering a gpio line.
> >> + The gpio line is a generic pin on integrated circuit whose input or
> >> output pin can be controlled by the user at run time.> 
> > There's no way this is correct, look at how long your line is.
> 
> I'm not even sure if this level of detail is needed. Why should anyone
> that reads the config option care how NVEC is enabled or communicated
> with?

I didn't received the original mail, but I think this is related to a 
checkpatch warning which demands at least *three* lines of help text (we only 
have two). While the sense of such requirement is discussable, blowing up
an already complete help text just to avoid a checkpatch warning doesn't make 
much sense to me.

Marc


signature.asc
Description: This is a digitally signed message part.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv3] staging: vt6656: removed erroneous else statement

2015-01-31 Thread Derrick Greenspan
This patch fixes the checkpatch.pl warning:

WARNING: else is not generally useful after a break or return
559: FILE: drivers/staging/vt6656/rxtx.c:559:
return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head);
} else {

Signed-off-by: Derrick Greenspan 
---
Changes in v2:
 - Hopefully fixed whitespace!
Changes in v3:
 - Fixed GCC compiler warning
---
 drivers/staging/vt6656/rxtx.c | 33 -
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index b74f672..cb5d5ca 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -556,25 +556,24 @@ static u16 vnt_fill_cts_head(struct vnt_usb_send_context 
*tx_context,
ether_addr_copy(buf->data.ra, priv->current_net_addr);
 
return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head);
-   } else {
-   struct vnt_cts *buf = &head->cts_g;
-   /* Get SignalField,ServiceField,Length */
-   vnt_get_phy_field(priv, cts_frame_len,
-   priv->top_cck_basic_rate, PK_TYPE_11B, &buf->b);
-   /* Get CTSDuration_ba */
-   buf->duration_ba =
-   vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA,
-  tx_context->pkt_type,
-  current_rate);
-   /*Get CTS Frame body*/
-   buf->data.duration = buf->duration_ba;
-   buf->data.frame_control =
-   cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
+   }
+   struct vnt_cts *buf = &head->cts_g;
+   /* Get SignalField,ServiceField,Length */
+   vnt_get_phy_field(priv, cts_frame_len,
+   priv->top_cck_basic_rate, PK_TYPE_11B, &buf->b);
+   /* Get CTSDuration_ba */
+   buf->duration_ba =
+   vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA,
+  tx_context->pkt_type,
+  current_rate);
+   /*Get CTS Frame body*/
+   buf->data.duration = buf->duration_ba;
+   buf->data.frame_control =
+   cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
 
-   ether_addr_copy(buf->data.ra, priv->current_net_addr);
+   ether_addr_copy(buf->data.ra, priv->current_net_addr);
 
-   return vnt_rxtx_datahead_g(tx_context, &buf->data_head);
-   }
+   return vnt_rxtx_datahead_g(tx_context, &buf->data_head);
 }
 
 static u16 vnt_rxtx_rts(struct vnt_usb_send_context *tx_context,
-- 
2.2.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: vt6655: dpc: Removed variables that is never used

2015-01-31 Thread Malcolm Priestley



On 31/01/15 15:16, Rickard Strandqvist wrote:

Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist 
---
  drivers/staging/vt6655/dpc.c |4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index 977683c..9e9da3c 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -43,7 +43,7 @@ static bool vnt_rx_data(struct vnt_private *priv, struct 
sk_buff *skb,
struct ieee80211_rx_status rx_status = { 0 };
struct ieee80211_hdr *hdr;
__le16 fc;
-   u8 *rsr, *new_rsr, *rssi;
+   u8 *rssi;

I rather this was not removed, these are error reporting.

I have a patch for them that I will send shortly.


Malcolm



__le64 *tsf_time;
u16 frame_size;
int ii, r;
@@ -88,9 +88,7 @@ static bool vnt_rx_data(struct vnt_private *priv, struct 
sk_buff *skb,

tsf_time = (__le64 *)(skb_data + bytes_received - 12);
sq = skb_data + bytes_received - 4;
-   new_rsr = skb_data + bytes_received - 3;
rssi = skb_data + bytes_received - 2;
-   rsr = skb_data + bytes_received - 1;

RFvRSSITodBm(priv, *rssi, &rx_dbm);



___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: speakup: Fix warning of line over 80 characters.

2015-01-31 Thread Shirish Gajera
This patch fixes the checkpatch.pl warning:

WARNING: line over 80 characters

All line over 80 characters in driver/staging/speakup/* are fixed.
Aditional changes suggest by mailing list are also fixed.

Signed-off-by: Shirish Gajera 
---
 drivers/staging/speakup/main.c   | 12 
 drivers/staging/speakup/serialio.h   |  3 ++-
 drivers/staging/speakup/speakup.h|  6 --
 drivers/staging/speakup/speakup_decext.c |  6 --
 drivers/staging/speakup/speakup_decpc.c  |  6 --
 drivers/staging/speakup/spk_priv.h   |  3 ++-
 drivers/staging/speakup/spk_types.h  |  3 ++-
 drivers/staging/speakup/synth.c  | 10 +-
 8 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index e9f0c15..4af36ca 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -422,8 +422,10 @@ static void announce_edge(struct vc_data *vc, int msg_id)
 {
if (spk_bleeps & 1)
bleep(spk_y);
-   if ((spk_bleeps & 2) && (msg_id < edge_quiet))
-   synth_printf("%s\n", spk_msg_get(MSG_EDGE_MSGS_START + msg_id - 
1));
+   if ((spk_bleeps & 2) && (msg_id < edge_quiet)) {
+   synth_printf("%s\n",
+   spk_msg_get(MSG_EDGE_MSGS_START + msg_id - 1));
+   }
 }
 
 static void speak_char(u_char ch)
@@ -1131,7 +1133,8 @@ static void spkup_write(const char *in_buf, int count)
if (in_count > 2 && rep_count > 2) {
if (last_type & CH_RPT) {
synth_printf(" ");
-   synth_printf(spk_msg_get(MSG_REPEAT_DESC2), 
++rep_count);
+   synth_printf(spk_msg_get(MSG_REPEAT_DESC2),
+++rep_count);
synth_printf(" ");
}
rep_count = 0;
@@ -1847,7 +1850,8 @@ static void speakup_win_set(struct vc_data *vc)
win_right = spk_x;
}
snprintf(info, sizeof(info), spk_msg_get(MSG_WINDOW_BOUNDARY),
-(win_start) ? spk_msg_get(MSG_END) : 
spk_msg_get(MSG_START),
+(win_start) ? spk_msg_get(MSG_END) :
+  spk_msg_get(MSG_START),
 (int)spk_y + 1, (int)spk_x + 1);
}
synth_printf("%s\n", info);
diff --git a/drivers/staging/speakup/serialio.h 
b/drivers/staging/speakup/serialio.h
index 317bb84..1b39921 100644
--- a/drivers/staging/speakup/serialio.h
+++ b/drivers/staging/speakup/serialio.h
@@ -34,6 +34,7 @@ struct old_serial_port {
 #define SPK_TIMEOUT 100
 #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
 
-#define spk_serial_tx_busy() ((inb(speakup_info.port_tts + UART_LSR) & 
BOTH_EMPTY) != BOTH_EMPTY)
+#define spk_serial_tx_busy() \
+   ((inb(speakup_info.port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY)
 
 #endif
diff --git a/drivers/staging/speakup/speakup.h 
b/drivers/staging/speakup/speakup.h
index 898dce5..d194ebb 100644
--- a/drivers/staging/speakup/speakup.h
+++ b/drivers/staging/speakup/speakup.h
@@ -61,10 +61,12 @@ extern struct st_var_header *spk_get_var_header(enum 
var_id_t var_id);
 extern struct st_var_header *spk_var_header_by_name(const char *name);
 extern struct punc_var_t *spk_get_punc_var(enum var_id_t var_id);
 extern int spk_set_num_var(int val, struct st_var_header *var, int how);
-extern int spk_set_string_var(const char *page, struct st_var_header *var, int 
len);
+extern int spk_set_string_var(const char *page, struct st_var_header *var,
+ int len);
 extern int spk_set_mask_bits(const char *input, const int which, const int 
how);
 extern special_func spk_special_handler;
-extern int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short 
key);
+extern int spk_handle_help(struct vc_data *vc, u_char type, u_char ch,
+  u_short key);
 extern int synth_init(char *name);
 extern void synth_release(void);
 
diff --git a/drivers/staging/speakup/speakup_decext.c 
b/drivers/staging/speakup/speakup_decext.c
index 5550290..d86a579 100644
--- a/drivers/staging/speakup/speakup_decext.c
+++ b/drivers/staging/speakup/speakup_decext.c
@@ -207,10 +207,12 @@ static void do_catch_up(struct spk_synth *synth)
if (time_after_eq(jiffies, jiff_max)) {
if (!in_escape)
spk_serial_out(PROCSPEECH);
-   spin_lock_irqsave(&speakup_info.spinlock, 
flags);
+   spin_lock_irqsave(&speakup_info.spinlock,
+ flags);
jiffy_delta_val = jiffy_delta->u.n.value;
delay_time_val = delay_time->u.n.value;
-   spin_unlock_irqrestore(&speakup_info.spinlock, 
flags);
+   

Re: [PATCHv3] staging: vt6656: removed erroneous else statement

2015-01-31 Thread Malcolm Priestley



On 31/01/15 19:05, Derrick Greenspan wrote:

This patch fixes the checkpatch.pl warning:

WARNING: else is not generally useful after a break or return
559: FILE: drivers/staging/vt6656/rxtx.c:559:


Checkpatch does not check that the if and else has different function scope.

It isn't erroneous but now looks a little odd.

If it really bothers people split the function into two.


Malcolm



return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head);
} else {

Signed-off-by: Derrick Greenspan 
---
Changes in v2:
  - Hopefully fixed whitespace!
Changes in v3:
  - Fixed GCC compiler warning
---
  drivers/staging/vt6656/rxtx.c | 33 -
  1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index b74f672..cb5d5ca 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -556,25 +556,24 @@ static u16 vnt_fill_cts_head(struct vnt_usb_send_context 
*tx_context,
ether_addr_copy(buf->data.ra, priv->current_net_addr);

return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head);
-   } else {
-   struct vnt_cts *buf = &head->cts_g;
-   /* Get SignalField,ServiceField,Length */
-   vnt_get_phy_field(priv, cts_frame_len,
-   priv->top_cck_basic_rate, PK_TYPE_11B, &buf->b);
-   /* Get CTSDuration_ba */
-   buf->duration_ba =
-   vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA,
-  tx_context->pkt_type,
-  current_rate);
-   /*Get CTS Frame body*/
-   buf->data.duration = buf->duration_ba;
-   buf->data.frame_control =
-   cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
+   }
+   struct vnt_cts *buf = &head->cts_g;
+   /* Get SignalField,ServiceField,Length */
+   vnt_get_phy_field(priv, cts_frame_len,
+   priv->top_cck_basic_rate, PK_TYPE_11B, &buf->b);
+   /* Get CTSDuration_ba */
+   buf->duration_ba =
+   vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA,
+  tx_context->pkt_type,
+  current_rate);
+   /*Get CTS Frame body*/
+   buf->data.duration = buf->duration_ba;
+   buf->data.frame_control =
+   cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);

-   ether_addr_copy(buf->data.ra, priv->current_net_addr);
+   ether_addr_copy(buf->data.ra, priv->current_net_addr);

-   return vnt_rxtx_datahead_g(tx_context, &buf->data_head);
-   }
+   return vnt_rxtx_datahead_g(tx_context, &buf->data_head);
  }

  static u16 vnt_rxtx_rts(struct vnt_usb_send_context *tx_context,


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Fixed spaced comma in speakup/i18n.h

2015-01-31 Thread Derrick Greenspan
Fixed the checkpatch error:

ERROR: space prohibited before that ',' (ctx:WxE)
6: FILE: drivers/staging/speakup/i18n.h:6:
+   MSG_FIRST_INDEX ,
^

Signed-off-by: Derrick Greenspan 
---
 drivers/staging/speakup/i18n.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/i18n.h b/drivers/staging/speakup/i18n.h
index 16a0871..326d086 100644
--- a/drivers/staging/speakup/i18n.h
+++ b/drivers/staging/speakup/i18n.h
@@ -3,7 +3,7 @@
 /* Internationalization declarations */
 
 enum msg_index_t {
-   MSG_FIRST_INDEX ,
+   MSG_FIRST_INDEX,
MSG_ANNOUNCEMENTS_START = MSG_FIRST_INDEX,
MSG_BLANK = MSG_ANNOUNCEMENTS_START,
MSG_IAM_ALIVE,
-- 
2.2.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv3] staging: vt6656: removed erroneous else statement

2015-01-31 Thread Greg Kroah-Hartman
On Sat, Jan 31, 2015 at 02:05:21PM -0500, Derrick Greenspan wrote:
> This patch fixes the checkpatch.pl warning:
> 
> WARNING: else is not generally useful after a break or return
> 559: FILE: drivers/staging/vt6656/rxtx.c:559:
> return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head);
> } else {
> 
> Signed-off-by: Derrick Greenspan 
> ---
> Changes in v2:
>  - Hopefully fixed whitespace!
> Changes in v3:
>  - Fixed GCC compiler warning

I don't believe you really did fix that warning, as you still are
creating a variable in the middle of a function, which isn't allowed.

Just leave the existing code as-is, this is getting too messy.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH net] hyperv: Fix the error processing in netvsc_send()

2015-01-31 Thread David Miller
From: Haiyang Zhang 
Date: Thu, 29 Jan 2015 12:34:49 -0800

> The existing code frees the skb in EAGAIN case, in which the skb will be
> retried from upper layer and used again.
> Also, the existing code doesn't free send buffer slot in error case, because
> there is no completion message for unsent packets.
> This patch fixes these problems.
> 
> (Please also include this patch for stable trees. Thanks!)
> 
> Signed-off-by: Haiyang Zhang 
> Reviewed-by: K. Y. Srinivasan 

Applied and queued up for -stable, thanks.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 2/3] hv: vmbus_post_msg: retry the hypercall on HV_STATUS_INVALID_CONNECTION_ID

2015-01-31 Thread Dexuan Cui
> -Original Message-
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> Sent: Saturday, January 31, 2015 1:29 AM
> To: Dexuan Cui
> Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; driverdev-
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
> jasow...@redhat.com; KY Srinivasan; Haiyang Zhang
> Subject: Re: [PATCH 2/3] hv: vmbus_post_msg: retry the hypercall on
> HV_STATUS_INVALID_CONNECTION_ID
> 
> Dexuan Cui  writes:
> 
> >> -Original Message-
> >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> >> Sent: Thursday, January 29, 2015 21:31 PM
> >> To: Dexuan Cui
> >> Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; driverdev-
> >> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
> >> jasow...@redhat.com; KY Srinivasan; Haiyang Zhang
> >> Subject: Re: [PATCH 2/3] hv: vmbus_post_msg: retry the hypercall on
> >> HV_STATUS_INVALID_CONNECTION_ID
> >>
> >> Dexuan Cui  writes:
> >>
> >> > I got the hypercall error code on Hyper-V 2008 R2 when keeping running
> >> > "rmmod hv_netvsc; modprobe hv_netvsc; rmmod hv_utils; modprobe
> hv_utils"
> >> > in a Linux guest.
> >> >
> >> > Without the patch, the driver can occasionally fail to load.
> >> >
> >> > CC: "K. Y. Srinivasan" 
> >> > Signed-off-by: Dexuan Cui 
> >> > ---
> >> >  arch/x86/include/uapi/asm/hyperv.h | 1 +
> >> >  drivers/hv/connection.c| 9 +
> >> >  2 files changed, 10 insertions(+)
> >> >
> >> > diff --git a/arch/x86/include/uapi/asm/hyperv.h
> >> b/arch/x86/include/uapi/asm/hyperv.h
> >> > index 90c458e..b9daffb 100644
> >> > --- a/arch/x86/include/uapi/asm/hyperv.h
> >> > +++ b/arch/x86/include/uapi/asm/hyperv.h
> >> > @@ -225,6 +225,7 @@
> >> >  #define HV_STATUS_INVALID_HYPERCALL_CODE2
> >> >  #define HV_STATUS_INVALID_HYPERCALL_INPUT   3
> >> >  #define HV_STATUS_INVALID_ALIGNMENT 4
> >> > +#define HV_STATUS_INVALID_CONNECTION_ID 18
> >> >  #define HV_STATUS_INSUFFICIENT_BUFFERS  19
> >>
> >> The gap beween 4 and 18 tells me there are other codes here ;-) Are they
> >> all 'permanent failures'?
> > It looks we only need to care about these error codes here.
> >
> > BTW, you can get all the hypercall error codes in the top level functional 
> > spec:
> > http://blogs.msdn.com/b/virtual_pc_guy/archive/2014/02/17/updated-
> hypervisor-top-level-functional-specification.aspx
> > For this hypercall (0x005c), see "14.9.7 HvPostMessage".
> 
> Thanks, interesting!
> 
> Btw, HV_STATUS_INSUFFICIENT_MEMORY looks suspicious, looks like we can
> hit it as well...
> 
> I suggest we split all failures here in 2 classes:
> 1) permanent
> 2) worth retrying
> 
> and treat them accordingly (no big changes, just maybe group them within
> hv_post_message() together as it is the only place where these codes are
> being used).
Thanks for the suggestion, Vitaly!
I'll send out  v2.

-- Dexuan

> >
> >> >
> >> >  typedef struct _HV_REFERENCE_TSC_PAGE {
> >> > diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
> >> > index c4acd1c..8bd05f3 100644
> >> > --- a/drivers/hv/connection.c
> >> > +++ b/drivers/hv/connection.c
> >> > @@ -440,6 +440,15 @@ int vmbus_post_msg(void *buffer, size_t buflen)
> >> >  ret = hv_post_message(conn_id, 1, buffer, buflen);
> >> >
> >> >  switch (ret) {
> >> > +case HV_STATUS_INVALID_CONNECTION_ID:
> >> > +/*
> >> > + * We could get this if we send messages too
> >> > + * frequently or the host is under low resource
> >> > + * conditions: let's wait 1 more second before
> >> > + * retrying the hypercall.
> >> > + */
> >> > +msleep(1000);
> >> > +break;
> >>
> >> In case it is our last try (No. 10) we will return '18' from the
> >> function. I suggest we set ret = -ENOMEM here as well.
> > Thanks for the suggestion!
> >
> > I think it would be better to add this to the case
> > HV_STATUS_INVALID_CONNECTION_ID:
> >  ret = -EAGAIN;
> > ?
> 
> Yes, like fallthrough
> 
> >
> >> >  case HV_STATUS_INSUFFICIENT_BUFFERS:
> >> >  ret = -ENOMEM;
> >>
> >> Or should we treat these two equally? There is a smaller (100ms) sleep
> >> between tries already, we can consider changing it instead.
> >>
> >> >  case -ENOMEM:
> >>
> >> --
> >>   Vitaly
> > In my experiments, in the HV_STATUS_INVALID_CONNECTION_ID case,
> > waiting 100ms is not enough sometimes, so I'd like to wait more time.
> > I agree with you both cases can wait 1000ms. I'll update my patch.
> >
> > BTW, the " case -ENOMEM:" is not reachable(the hypervisor itself doesn't
> > return -ENOMEM), I think. I can remove it.
> 
> hv_post_message() can return -EMSGSIZE or do_hypercall() return value
> (which becomes u16 in hv_post_message()). So yes, I agree, 

Re: [PATCH] staging: xgifb: vb_init: Removed variables that is never used

2015-01-31 Thread Greg Kroah-Hartman
On Sat, Jan 31, 2015 at 04:20:48PM +0100, Rickard Strandqvist wrote:
> Variable was assigned a value that was never used.
> I have also removed all the code that thereby serves no purpose.
> 
> This was found using a static code analysis program called cppcheck
> 
> Signed-off-by: Rickard Strandqvist 
> ---
>  drivers/staging/xgifb/vb_init.c |4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
> index 2b233af..6384077 100644
> --- a/drivers/staging/xgifb/vb_init.c
> +++ b/drivers/staging/xgifb/vb_init.c
> @@ -1187,7 +1187,7 @@ unsigned char XGIInitNew(struct pci_dev *pdev)
>   struct xgi_hw_device_info *HwDeviceExtension = &xgifb_info->hw_info;
>   struct vb_device_info VBINF;
>   struct vb_device_info *pVBInfo = &VBINF;
> - unsigned char i, temp = 0, temp1;
> + unsigned char i, temp = 0;
>  
>   pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress;
>  
> @@ -1286,8 +1286,6 @@ unsigned char XGIInitNew(struct pci_dev *pdev)
>   /* disable VideoCapture */
>   xgifb_reg_and_or(pVBInfo->Part0Port, 0x3F, 0xEF, 0x00);
>   xgifb_reg_set(pVBInfo->Part1Port, 0x00, 0x00);
> - /* chk if BCLK>=100MHz */
> - temp1 = xgifb_reg_get(pVBInfo->P3d4, 0x7B);

With hardware, you can't just remove all 'read' calls and expect things
to work because a static code checker things something is not right.

I'm going to drop _all_ of the patches you sent me in the past few days
as I really think they all are wrong.  Please be more careful and work
on fixing real problems, not just ones that random tools think might be
wrong.  Weeding out false-positives should not be my job, that's not
scalable at all.

sorry,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8188eu: core: rtw_sta_mgt: Removed variables that is never used

2015-01-31 Thread Greg Kroah-Hartman
On Sat, Jan 31, 2015 at 11:41:04AM -0600, Larry Finger wrote:
> On 01/31/2015 10:19 AM, Dan Carpenter wrote:
> >On Sat, Jan 31, 2015 at 03:45:33PM +0100, Rickard Strandqvist wrote:
> >>while (phead != plist) {
> >>-   psta = container_of(plist, struct sta_info , list);
> >>+   container_of(plist, struct sta_info, list);
> >
> >
> >Argh!!!  No.
> >
> >For this one, I didn't need an context to see that it was wrong, so I
> >accidentally reviewed it instead of just marking it as read.
> >
> 
> Dan,
> 
> This guy does not have a brain - he only knows how to run cppcheck. You
> cannot expect him to think about what he does. In addition, he does not have
> any of the hardware that uses the drivers he is mangling. He can only test
> that it builds correctly. Do not bother to ever review anything he sends.
> 
> Earlier this month, he submitted a set of patches that impacted routines
> that I was working on. I asked him to hold those until I was finished to
> avoid conflicts. Guess what? The same set was resubmitted 4 days later!!
> 
> He was told that sets of patches were supposed to be submitted with a [PATCH
> X/Y] structure, but he has ignored that suggestion, thus there is no way to
> send an overall NACK.
> 
> @Greg: Please put this guy on your permanent blacklist. It takes too much
> time to read and respond to his multiple posts. Kalle has already done that
> for wireless.

I've now dropped all patches he recently sent me.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8188eu: core: rtw_sta_mgt: Removed variables that is never used

2015-01-31 Thread Greg Kroah-Hartman
On Sat, Jan 31, 2015 at 03:45:33PM +0100, Rickard Strandqvist wrote:
> Variable was assigned a value that was never used.
> I have also removed all the code that thereby serves no purpose.
> 
> This was found using a static code analysis program called cppcheck
> 
> Signed-off-by: Rickard Strandqvist 
> ---
>  drivers/staging/rtl8188eu/core/rtw_sta_mgt.c |3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c 
> b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
> index dc9d0dd..1e737ed 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
> @@ -149,7 +149,6 @@ inline struct sta_info *rtw_get_stainfo_by_offset(struct 
> sta_priv *stapriv, int
>  static void rtw_mfree_all_stainfo(struct sta_priv *pstapriv)
>  {
>   struct list_head *plist, *phead;
> - struct sta_info *psta = NULL;
>  
>  
>   spin_lock_bh(&pstapriv->sta_hash_lock);
> @@ -158,7 +157,7 @@ static void rtw_mfree_all_stainfo(struct sta_priv 
> *pstapriv)
>   plist = phead->next;
>  
>   while (phead != plist) {
> - psta = container_of(plist, struct sta_info , list);
> + container_of(plist, struct sta_info, list);

How did this patch even compile?

{sigh}

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel