Re: [PATCH] Staging: Silicom: bpctl_mod.c: Fixed a lot of checkpatch.pl warnings

2014-05-23 Thread Chaitanya Hazarey
Thanks Greg for looking into it,

I have resubmitted using a new email, hope that works out.

Thanks,

Chaitanya

On Fri, May 23, 2014 at 3:26 PM, Greg KH  wrote:
> On Fri, May 23, 2014 at 02:47:10PM -0700, Chaitanya Hazarey wrote:
>> Added a blank line after declarations in many places to fix the following 
>> warning issued by checkpatch.pl:
>>
>> WARNING: Missing a blank line after declarations
>> ---
>>  drivers/staging/silicom/bpctl_mod.c |   90 
>> ++-
>>  1 file changed, 88 insertions(+), 2 deletions(-)
>
> Something is corrupted in this patch and it doesn't apply properly.  Can
> you resend it to yourself and try to figure out what went wrong?
>
> thanks,
>
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: Silicom: bpctl_mod.c: Fixed a lot of checkpatch.pl warnings

2014-05-23 Thread Chaitanya Hazarey
Forgot to add - what went wrong - I had deleted some whitespaces which
made the git apply mad.

Thanks,

Chaitanya

On Fri, May 23, 2014 at 10:32 PM, Chaitanya Hazarey  wrote:
> Thanks Greg for looking into it,
>
> I have resubmitted using a new email, hope that works out.
>
> Thanks,
>
> Chaitanya
>
> On Fri, May 23, 2014 at 3:26 PM, Greg KH  wrote:
>> On Fri, May 23, 2014 at 02:47:10PM -0700, Chaitanya Hazarey wrote:
>>> Added a blank line after declarations in many places to fix the following 
>>> warning issued by checkpatch.pl:
>>>
>>> WARNING: Missing a blank line after declarations
>>> ---
>>>  drivers/staging/silicom/bpctl_mod.c |   90 
>>> ++-
>>>  1 file changed, 88 insertions(+), 2 deletions(-)
>>
>> Something is corrupted in this patch and it doesn't apply properly.  Can
>> you resend it to yourself and try to figure out what went wrong?
>>
>> thanks,
>>
>> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: Silicom: Bypasslib: Fixed a couple of checkpatch.pl warnings

2014-05-23 Thread Chaitanya Hazarey
Hey Dan,

Thanks for your patience, I have resubmitted via a new email. Hope that works.

Thanks,

Chaitanya

On Fri, May 23, 2014 at 3:54 PM, Dan Carpenter  wrote:
> On Fri, May 23, 2014 at 02:39:43PM -0700, Chaitanya Hazarey wrote:
>> Added a blank line after declarations to fix the following warnings issued 
>> by checkpatch.pl:
>>
>> drivers/staging/silicom/bypasslib/bypass.c:138: WARNING: Missing a blank 
>> line after declarations
>> drivers/staging/silicom/bypasslib/bypass.c:189: WARNING: Missing a blank 
>> line after declarations
>>
>> Signed-off-by: Chaitanya Hazarey 
>
> Still doesn't apply, I'm afraid.
>
>> ---
>>  drivers/staging/silicom/bypasslib/bypass.c |2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/staging/silicom/bypasslib/bypass.c 
>> b/drivers/staging/silicom/bypasslib/bypass.c
>> index a58251f..8e714a8 100644
>> --- a/drivers/staging/silicom/bypasslib/bypass.c
>> +++ b/drivers/staging/silicom/bypasslib/bypass.c
>> @@ -135,6 +135,7 @@ static int doit(int cmd, int if_index, int *data)
>>  static int is_dev_sd(int if_index)
>>  {
>>   int ret = 0;
>> +
>>   SET_BPLIB_INT_FN(is_bypass, int, if_index, ret);
>>   return ret >= 0 ? 1 : 0;
>>  }
>> @@ -186,6 +187,7 @@ static int is_bypass_dev(int if_index)
>>  static int is_bypass(int if_index)
>>  {
>>   int ret = 0;
>> +
>>   SET_BPLIB_INT_FN(is_bypass, int, if_index, ret);
>>   if (ret < 0)
>
> There was supposed to be a blank line between the call to
> SET_BPLIB_INT_FN() and the return check and it got deleted for some
> reason.
>
> regards,
> dan carpetner
>
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Fixed a lot of checkpatch.pl warnings

2014-05-23 Thread Chaitanya Hazarey
Added a blank line after declarations in many places to fix the following 
warning issued by checkpatch.pl:

WARNING: Missing a blank line after declarations

Thanks Greg K-H and Dan for the patience. Hope it works this time, I did apply 
it against staging and it was ok. 

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/silicom/bpctl_mod.c|   92 +++-
 drivers/staging/silicom/bypasslib/bypass.c |2 +
 2 files changed, 91 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/silicom/bpctl_mod.c 
b/drivers/staging/silicom/bpctl_mod.c
index 7f3d884..83f1072 100644
--- a/drivers/staging/silicom/bpctl_mod.c
+++ b/drivers/staging/silicom/bpctl_mod.c
@@ -752,6 +752,7 @@ static void write_reg(struct bpctl_dev *pbpctl_dev, 
unsigned char value,
uint32_t ctrl_ext = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_c = NULL;
unsigned long flags;
+
if (pbpctl_dev->bp_10g9) {
pbpctl_dev_c = get_status_port_fn(pbpctl_dev);
if (!pbpctl_dev_c)
@@ -927,6 +928,7 @@ static int read_reg(struct bpctl_dev *pbpctl_dev, unsigned 
char addr)
 
 #ifdef BP_SYNC_FLAG
unsigned long flags;
+
spin_lock_irqsave(&pbpctl_dev->bypass_wr_lock, flags);
 #else
atomic_set(&pbpctl_dev->wdt_busy, 1);
@@ -1563,6 +1565,7 @@ int pulse_set_fn(struct bpctl_dev *pbpctl_dev, unsigned 
int counter)
 int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1588,6 +1591,7 @@ int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1603,6 +1607,7 @@ int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get1_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1666,6 +1671,7 @@ static struct bpctl_dev *lookup_port(struct bpctl_dev 
*dev)
 {
struct bpctl_dev *p;
int n;
+
for (n = 0, p = bpctl_dev_arr; n < device_num && p->pdev; n++) {
if (p->bus == dev->bus
&& p->slot == dev->slot
@@ -1843,6 +1849,7 @@ static int bypass_off(struct bpctl_dev *pbpctl_dev)
 static int tap_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_OFF);
@@ -1856,6 +1863,7 @@ static int tap_off(struct bpctl_dev *pbpctl_dev)
 static int tap_on(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_ON);
@@ -1869,6 +1877,7 @@ static int tap_on(struct bpctl_dev *pbpctl_dev)
 static int disc_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = 0;
+
if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 
0x8)) {
write_data(pbpctl_dev, DISC_OFF);
msec_delay_bp(LATCH_DELAY);
@@ -1881,6 +1890,7 @@ static int disc_off(struct bpctl_dev *pbpctl_dev)
 static int disc_on(struct bpctl_dev *pbpctl_dev)
 {
int ret = 0;
+
if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 
0x8)) {
write_data(pbpctl_dev, /*DISC_ON */ 0x85);
msec_delay_bp(LATCH_DELAY);
@@ -2270,6 +2280,7 @@ static int set_tx(struct bpctl_dev *pbpctl_dev, int 
tx_state)
 {
int ret = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -2802,6 +2813,7 @@ int wdt_time_left(struct bpctl_dev *pbpctl_dev)
 static int wdt_timer(struct bpctl_dev *pbpctl_dev, int *time_left)
 {
int ret = 0;
+
if (pbpctl_dev->bp_caps & WD_CTL_CAP) {
{
if (pbpctl_dev->wdt_status == WDT_STATUS_UNKNOWN)
@@ -3014,6 +3026,7 @@ static int tx_status(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -3195,6 +3208,7 @@ static int bypass_change_status(struct bpctl_dev 
*pbpctl_dev)
 static int bypass_status(struct bpctl_dev *pbpctl_dev)
 {
u32 ctrl_ext = 0;
+
if (pbpctl_dev->bp_caps & BP_CAP) {
 
struct bpctl_dev *pbpctl_dev_b = NULL;
@@ -3323,6 +3337,7 @@ static int dis_bypass_cap_status(struct bpctl_dev 
*pbpctl_dev)
 static int wdt_programmed(struct bpctl_dev *pbpctl_dev, int *timeout)
 {
int ret = 0;
+
if (pbpctl_dev->bp_caps & WD_CTL_CAP) {
if (pbpctl_dev->bp_ext_ver >= PXG2BPI_VER) {
if ((read_reg(pbpctl_dev, STATUS_

[PATCH] staging: Convert __FUNCTION__ to __func__

2014-05-23 Thread Joe Perches
Use the normal mechanism for emitting a function name.

Signed-off-by: Joe Perches 
---
 drivers/staging/bcm/Qos.c  | 14 -
 drivers/staging/keucr/scsiglue.c   |  2 +-
 drivers/staging/octeon-usb/octeon-hcd.c|  2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211.h |  2 +-
 .../rtl8192u/ieee80211/ieee80211_crypt_ccmp.c  |  2 +-
 .../rtl8192u/ieee80211/ieee80211_crypt_tkip.c  |  2 +-
 .../rtl8192u/ieee80211/ieee80211_crypt_wep.c   |  2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c  | 34 +++---
 .../staging/rtl8192u/ieee80211/ieee80211_softmac.c | 10 +++
 drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c  |  2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c  |  2 +-
 .../staging/rtl8192u/ieee80211/rtl819x_BAProc.c| 22 +++---
 .../staging/rtl8192u/ieee80211/rtl819x_HTProc.c| 10 +++
 .../staging/rtl8192u/ieee80211/rtl819x_TSProc.c| 10 +++
 drivers/staging/rtl8192u/r8192U_dm.c   | 12 
 drivers/staging/rtl8192u/r8192U_wx.c   | 12 
 drivers/staging/rtl8192u/r819xU_firmware.c |  6 ++--
 drivers/staging/rtl8723au/hal/hal_com.c|  4 +--
 drivers/staging/rtl8723au/hal/odm.c|  4 +--
 drivers/staging/rtl8723au/hal/rtl8723a_cmd.c   | 24 +++
 drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c|  2 +-
 drivers/staging/rtl8723au/hal/rtl8723au_recv.c |  2 +-
 drivers/staging/rtl8723au/hal/usb_ops_linux.c  | 16 +-
 .../rtl8723au/include/rtl8723a_bt-coexist.h|  2 +-
 drivers/staging/rtl8723au/include/rtw_mlme_ext.h   |  4 +--
 .../staging/usbip/userspace/libsrc/usbip_common.h  |  2 +-
 26 files changed, 103 insertions(+), 103 deletions(-)

diff --git a/drivers/staging/bcm/Qos.c b/drivers/staging/bcm/Qos.c
index 64ae92b..0c742da 100644
--- a/drivers/staging/bcm/Qos.c
+++ b/drivers/staging/bcm/Qos.c
@@ -591,7 +591,7 @@ static bool EthCSMatchSrcMACAddress(struct 
bcm_classifier_rule *pstClassifierRul
struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev);
if (pstClassifierRule->ucEthCSSrcMACLen == 0)
return TRUE;
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL,  "%s\n", 
__FUNCTION__);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL,  "%s\n", 
__func__);
for (i = 0; i < MAC_ADDRESS_SIZE; i++) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL,  
"SRC MAC[%x] = %x ClassifierRuleSrcMAC = %x Mask : %x\n", i, Mac[i], 
pstClassifierRule->au8EThCSSrcMAC[i], pstClassifierRule->au8EThCSSrcMACMask[i]);
if ((pstClassifierRule->au8EThCSSrcMAC[i] & 
pstClassifierRule->au8EThCSSrcMACMask[i]) !=
@@ -607,7 +607,7 @@ static bool EthCSMatchDestMACAddress(struct 
bcm_classifier_rule *pstClassifierRu
struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev);
if (pstClassifierRule->ucEthCSDestMACLen == 0)
return TRUE;
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "%s\n", 
__FUNCTION__);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "%s\n", 
__func__);
for (i = 0; i < MAC_ADDRESS_SIZE; i++) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, 
"SRC MAC[%x] = %x ClassifierRuleSrcMAC = %x Mask : %x\n", i, Mac[i], 
pstClassifierRule->au8EThCSDestMAC[i], 
pstClassifierRule->au8EThCSDestMACMask[i]);
if ((pstClassifierRule->au8EThCSDestMAC[i] & 
pstClassifierRule->au8EThCSDestMACMask[i]) !=
@@ -624,9 +624,9 @@ static bool EthCSMatchEThTypeSAP(struct bcm_classifier_rule 
*pstClassifierRule,
(pstClassifierRule->au8EthCSEtherType[0] == 0))
return TRUE;
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL,  "%s 
SrcEtherType:%x CLS EtherType[0]:%x\n", __FUNCTION__, 
pstEthCsPktInfo->usEtherType, pstClassifierRule->au8EthCSEtherType[0]);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL,  "%s 
SrcEtherType:%x CLS EtherType[0]:%x\n", __func__, pstEthCsPktInfo->usEtherType, 
pstClassifierRule->au8EthCSEtherType[0]);
if (pstClassifierRule->au8EthCSEtherType[0] == 1) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL,  
"%s  CLS EtherType[1]:%x EtherType[2]:%x\n", __FUNCTION__, 
pstClassifierRule->au8EthCSEtherType[1], 
pstClassifierRule->au8EthCSEtherType[2]);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL,  
"%s  CLS EtherType[1]:%x EtherType[2]:%x\n", __func__, 
pstClassifierRule->au8EthCSEtherType[1], 
pstClassifierRule->au8EthCSEtherType[2]);
 
if (memcmp(&pstEthCsPktInfo->usEtherType, 
&pstClassifierRule->au8EthCSEtherType[1], 2) == 0)
return TRUE;
@@ -638,7 +638,7 @@ static bool EthCSMatchEThTypeSAP(struct bcm_classifier_rule 
*pstClassifierRule,
if (eEth802LLCFrame != 

[PATCH RESEND] staging: slicoss: clean up use of dev_err

2014-05-23 Thread David Matlack
First, don't print pci device information or driver prefixes, this
is already printed by dev_err. Next, don't report error messages
via dev_err when the failing function already reports all errors
via dev_err.

Signed-off-by: David Matlack 
---
 drivers/staging/slicoss/slicoss.c | 28 +---
 1 file changed, 9 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index 0165899..1278de8 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -395,7 +395,7 @@ static int slic_card_download_gbrcv(struct adapter *adapter)
ret = request_firmware(&fw, file, &adapter->pcidev->dev);
if (ret) {
dev_err(&adapter->pcidev->dev,
-   "SLICOSS: Failed to load firmware %s\n", file);
+   "Failed to load firmware %s\n", file);
return ret;
}
 
@@ -473,7 +473,7 @@ static int slic_card_download(struct adapter *adapter)
ret = request_firmware(&fw, file, &adapter->pcidev->dev);
if (ret) {
dev_err(&adapter->pcidev->dev,
-   "SLICOSS: Failed to load firmware %s\n", file);
+   "Failed to load firmware %s\n", file);
return ret;
}
numsects = *(u32 *)(fw->data + index);
@@ -2783,13 +2783,8 @@ static int slic_card_init(struct sliccard *card, struct 
adapter *adapter)
 
/* Download the microcode */
status = slic_card_download(adapter);
-
-   if (status != 0) {
-   dev_err(&adapter->pcidev->dev,
-   "download failed bus %d slot %d\n",
-   adapter->busnumber, adapter->slotnumber);
+   if (status)
return status;
-   }
 
if (!card->config_set) {
peeprom = pci_alloc_consistent(adapter->pcidev,
@@ -2801,8 +2796,7 @@ static int slic_card_init(struct sliccard *card, struct 
adapter *adapter)
 
if (!peeprom) {
dev_err(&adapter->pcidev->dev,
-   "eeprom read failed to get memory bus %d slot 
%d\n", adapter->busnumber,
-   adapter->slotnumber);
+   "Failed to allocate DMA memory for EEPROM.\n");
return -ENOMEM;
} else {
memset(peeprom, 0, sizeof(struct slic_eeprom));
@@ -2846,8 +2840,7 @@ static int slic_card_init(struct sliccard *card, struct 
adapter *adapter)
i++;
if (i > 5000) {
dev_err(&adapter->pcidev->dev,
-   "%d config data fetch timed 
out!\n",
-   adapter->port);
+   "Fetch of config data timed 
out.\n");
slic_reg64_write(adapter,
&slic_regs->slic_isp, 0,
&slic_regs->slic_addr_upper,
@@ -2931,19 +2924,16 @@ static int slic_card_init(struct sliccard *card, struct 
adapter *adapter)
slic_reg64_write(adapter, &slic_regs->slic_isp, 0,
 &slic_regs->slic_addr_upper,
 0, FLUSH);
-   dev_err(&adapter->pcidev->dev,
-   "unsupported CONFIGURATION EEPROM invalid\n");
+   dev_err(&adapter->pcidev->dev, "EEPROM invalid.\n");
return -EINVAL;
}
 
card->config_set = 1;
}
 
-   if (slic_card_download_gbrcv(adapter)) {
-   dev_err(&adapter->pcidev->dev,
-   "unable to download GB receive microcode\n");
-   return -EINVAL;
-   }
+   status = slic_card_download_gbrcv(adapter);
+   if (status)
+   return status;
 
if (slic_global.dynamic_intagg)
slic_intagg_set(adapter, 0);
-- 
1.9.2

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


[PATCH RESEND] staging: slicoss: remove private netdev list

2014-05-23 Thread David Matlack
Remove the private linked list of netdev structs. This list isn't
being used anyway.

This patch has no noticable effect.

Signed-off-by: David Matlack 
---
 drivers/staging/slicoss/slic.h| 1 -
 drivers/staging/slicoss/slicoss.c | 4 
 2 files changed, 5 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 7de57c4..0dc73d5 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -407,7 +407,6 @@ struct adapter {
uintcard_size;
uintchipid;
struct net_device  *netdev;
-   struct net_device  *next_netdevice;
struct slic_spinlock adapter_lock;
struct slic_spinlock reset_lock;
struct pci_dev *pcidev;
diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index b8eeb3b..0165899 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -104,8 +104,6 @@ static char *slic_banner = "Alacritech SLIC Technology(tm) 
Server "
 
 static char *slic_proc_version = "2.0.351  2006/07/14 12:26:00";
 
-static struct net_device *head_netdevice;
-
 static struct base_driver slic_global = { {}, 0, 0, 0, 1, NULL, NULL };
 static int intagg_delay = 100;
 static u32 dynamic_intagg;
@@ -2993,8 +2991,6 @@ static void slic_init_adapter(struct net_device *netdev,
adapter->slic_regs = (__iomem struct slic_regs *)memaddr;
adapter->irq = pcidev->irq;
 /* adapter->netdev = netdev;*/
-   adapter->next_netdevice = head_netdevice;
-   head_netdevice = netdev;
adapter->chipid = chip_idx;
adapter->port = 0;  /*adapter->functionnumber;*/
adapter->cardindex = adapter->port;
-- 
1.9.2

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


[PATCH] staging: lustre: Fixed warnings about using 0 as NULL ptr

2014-05-23 Thread Greg DeAngelis
Fixed a bunch of warnings pointed out by sparse about using 0 to
represent a NULL pointer.

Signed-off-by: Greg DeAngelis 
---
 drivers/staging/lustre/lustre/mgc/lproc_mgc.c |   22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c 
b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
index 1506af1..6c877c5 100644
--- a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
+++ b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
@@ -56,21 +56,21 @@ static int mgc_ir_state_seq_show(struct seq_file *m, void 
*v)
 LPROC_SEQ_FOPS_RO(mgc_ir_state);
 
 static struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
-   { "uuid",&mgc_uuid_fops,  0, 0 },
-   { "ping",&mgc_ping_fops,  0, 0222 },
-   { "connect_flags",   &mgc_connect_flags_fops, 0, 0 },
-   { "mgs_server_uuid", &mgc_server_uuid_fops,   0, 0 },
-   { "mgs_conn_uuid",   &mgc_conn_uuid_fops, 0, 0 },
-   { "import",  &mgc_import_fops,  0, 0 },
-   { "state",   &mgc_state_fops,0, 0 },
-   { "ir_state",&mgc_ir_state_fops,  0, 0 },
-   { 0 }
+   { "uuid",&mgc_uuid_fops,  NULL, 0 },
+   { "ping",&mgc_ping_fops,  NULL, 0222 },
+   { "connect_flags",   &mgc_connect_flags_fops, NULL, 0 },
+   { "mgs_server_uuid", &mgc_server_uuid_fops,   NULL, 0 },
+   { "mgs_conn_uuid",   &mgc_conn_uuid_fops, NULL, 0 },
+   { "import",  &mgc_import_fops,  NULL, 0 },
+   { "state",   &mgc_state_fops,NULL, 0 },
+   { "ir_state",&mgc_ir_state_fops,  NULL, 0 },
+   { NULL }
 };
 
 LPROC_SEQ_FOPS_RO_TYPE(mgc, numrefs);
 static struct lprocfs_vars lprocfs_mgc_module_vars[] = {
-   { "num_refs",   &mgc_numrefs_fops,   0, 0 },
-   { 0 }
+   { "num_refs",   &mgc_numrefs_fops,   NULL, 0 },
+   { NULL }
 };
 
 void lprocfs_mgc_init_vars(struct lprocfs_static_vars *lvars)
-- 
1.7.10.4

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


Re: [PATCH] Staging: Silicom: Bypasslib: Fixed a couple of checkpatch.pl warnings

2014-05-23 Thread Dan Carpenter
On Fri, May 23, 2014 at 02:39:43PM -0700, Chaitanya Hazarey wrote:
> Added a blank line after declarations to fix the following warnings issued by 
> checkpatch.pl:
> 
> drivers/staging/silicom/bypasslib/bypass.c:138: WARNING: Missing a blank line 
> after declarations
> drivers/staging/silicom/bypasslib/bypass.c:189: WARNING: Missing a blank line 
> after declarations
> 
> Signed-off-by: Chaitanya Hazarey 

Still doesn't apply, I'm afraid.

> ---
>  drivers/staging/silicom/bypasslib/bypass.c |2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/silicom/bypasslib/bypass.c 
> b/drivers/staging/silicom/bypasslib/bypass.c
> index a58251f..8e714a8 100644
> --- a/drivers/staging/silicom/bypasslib/bypass.c
> +++ b/drivers/staging/silicom/bypasslib/bypass.c
> @@ -135,6 +135,7 @@ static int doit(int cmd, int if_index, int *data)
>  static int is_dev_sd(int if_index)
>  {
>   int ret = 0;
> +
>   SET_BPLIB_INT_FN(is_bypass, int, if_index, ret);
>   return ret >= 0 ? 1 : 0;
>  }
> @@ -186,6 +187,7 @@ static int is_bypass_dev(int if_index)
>  static int is_bypass(int if_index)
>  {
>   int ret = 0;
> +
>   SET_BPLIB_INT_FN(is_bypass, int, if_index, ret);
>   if (ret < 0)

There was supposed to be a blank line between the call to
SET_BPLIB_INT_FN() and the return check and it got deleted for some
reason.

regards,
dan carpetner


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


Re: [PATCH] Staging: Silicom: bpctl_mod.c: Fixed a lot of checkpatch.pl warnings

2014-05-23 Thread Greg KH
On Fri, May 23, 2014 at 02:47:10PM -0700, Chaitanya Hazarey wrote:
> Added a blank line after declarations in many places to fix the following 
> warning issued by checkpatch.pl:
> 
> WARNING: Missing a blank line after declarations
> ---
>  drivers/staging/silicom/bpctl_mod.c |   90 
> ++-
>  1 file changed, 88 insertions(+), 2 deletions(-)

Something is corrupted in this patch and it doesn't apply properly.  Can
you resend it to yourself and try to figure out what went wrong?

thanks,

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


Re: [PATCH] Staging: Silicom: Bypasslib: Fixed a couple of checkpatch.pl warnings

2014-05-23 Thread Greg KH
On Fri, May 23, 2014 at 02:39:43PM -0700, Chaitanya Hazarey wrote:
> Added a blank line after declarations to fix the following warnings issued by 
> checkpatch.pl:
> 
> drivers/staging/silicom/bypasslib/bypass.c:138: WARNING: Missing a blank line 
> after declarations
> drivers/staging/silicom/bypasslib/bypass.c:189: WARNING: Missing a blank line 
> after declarations
> 
> Signed-off-by: Chaitanya Hazarey 
> ---
>  drivers/staging/silicom/bypasslib/bypass.c |2 ++
>  1 file changed, 2 insertions(+)

This patch doesn't apply cleanly.  Can you please refresh it against my
staging-next branch of staging.git on git.kernel.org and resend?

thanks,

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


Re: [PATCH] staging: slicoss: remove private netdev list

2014-05-23 Thread Greg KH
On Fri, May 23, 2014 at 01:11:01PM -0700, David Matlack wrote:
> Greg, this is one of the two patches that got dropped. It should apply cleanly
> in any order with respect to all my other patches.

As my patch queue is now flushed out, what is "this" patch?  :)

Can you please just resend the two missing patches?

thanks,

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


[PATCH] Staging: Silicom: bpctl_mod.c: Fixed a lot of checkpatch.pl warnings

2014-05-23 Thread Chaitanya Hazarey
Added a blank line after declarations in many places to fix the following 
warning issued by checkpatch.pl:

WARNING: Missing a blank line after declarations
---
 drivers/staging/silicom/bpctl_mod.c |   90 ++-
 1 file changed, 88 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/silicom/bpctl_mod.c 
b/drivers/staging/silicom/bpctl_mod.c
index 7f3d884..f0c6831 100644
--- a/drivers/staging/silicom/bpctl_mod.c
+++ b/drivers/staging/silicom/bpctl_mod.c
@@ -752,6 +752,7 @@ static void write_reg(struct bpctl_dev *pbpctl_dev, 
unsigned char value,
uint32_t ctrl_ext = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_c = NULL;
unsigned long flags;
+
if (pbpctl_dev->bp_10g9) {
pbpctl_dev_c = get_status_port_fn(pbpctl_dev);
if (!pbpctl_dev_c)
@@ -927,6 +928,7 @@ static int read_reg(struct bpctl_dev *pbpctl_dev, unsigned 
char addr)
 #ifdef BP_SYNC_FLAG
unsigned long flags;
+
spin_lock_irqsave(&pbpctl_dev->bypass_wr_lock, flags);
 #else
atomic_set(&pbpctl_dev->wdt_busy, 1);
@@ -1563,6 +1565,7 @@ int pulse_set_fn(struct bpctl_dev *pbpctl_dev, unsigned 
int counter)
 int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
@@ -1588,6 +1591,7 @@ int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
@@ -1603,6 +1607,7 @@ int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get1_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
@@ -1666,6 +1671,7 @@ static struct bpctl_dev *lookup_port(struct bpctl_dev 
*dev)
 {
struct bpctl_dev *p;
int n;
+
for (n = 0, p = bpctl_dev_arr; n < device_num && p->pdev; n++) {
if (p->bus == dev->bus
&& p->slot == dev->slot
@@ -1843,6 +1849,7 @@ static int bypass_off(struct bpctl_dev *pbpctl_dev)
 static int tap_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_OFF);
@@ -1856,6 +1863,7 @@ static int tap_off(struct bpctl_dev *pbpctl_dev)
 static int tap_on(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_ON);
@@ -1869,6 +1877,7 @@ static int tap_on(struct bpctl_dev *pbpctl_dev)
 static int disc_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = 0;
+
if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 
0x8)) {
write_data(pbpctl_dev, DISC_OFF);
msec_delay_bp(LATCH_DELAY);
@@ -2270,6 +2279,7 @@ static int set_tx(struct bpctl_dev *pbpctl_dev, int 
tx_state)
 {
int ret = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -2802,6 +2812,7 @@ int wdt_time_left(struct bpctl_dev *pbpctl_dev)
 static int wdt_timer(struct bpctl_dev *pbpctl_dev, int *time_left)
 {
int ret = 0;
+
if (pbpctl_dev->bp_caps & WD_CTL_CAP) {
{
if (pbpctl_dev->wdt_status == WDT_STATUS_UNKNOWN)
@@ -3014,6 +3025,7 @@ static int tx_status(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -3195,6 +3207,7 @@ static int bypass_change_status(struct bpctl_dev 
*pbpctl_dev)
 static int bypass_status(struct bpctl_dev *pbpctl_dev)
 {
u32 ctrl_ext = 0;
+
if (pbpctl_dev->bp_caps & BP_CAP) {
struct bpctl_dev *pbpctl_dev_b = NULL;
@@ -3323,6 +3336,7 @@ static int dis_bypass_cap_status(struct bpctl_dev 
*pbpctl_dev)
 static int wdt_programmed(struct bpctl_dev *pbpctl_dev, int *timeout)
 {
int ret = 0;
+
if (pbpctl_dev->bp_caps & WD_CTL_CAP) {
if (pbpctl_dev->bp_ext_ver >= PXG2BPI_VER) {
if ((read_reg(pbpctl_dev, STATUS_REG_ADDR)) &
@@ -3386,6 +3400,7 @@ static int tap_flag_status(struct bpctl_dev *pbpctl_dev)
 static int tap_flag_status_clear(struct bpctl_dev *pbpctl_dev)
 {
uint32_t status_reg = 0;
+
if (pbpctl_dev->bp_caps & TAP_STATUS_CAP) {
if (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER) {
status_reg = read_reg(pbpctl_dev, STATUS_TAP_REG_ADDR);
@@ -3400,6 +3415,7 @@ static int tap_flag_status_clear(struct bpctl_dev 
*pbpctl_dev)
 static int tap_change_status(struct bpctl_dev *pbpctl_dev)
 {
int r

[PATCH] Staging: Silicom: Bypasslib: Fixed a couple of checkpatch.pl warnings

2014-05-23 Thread Chaitanya Hazarey
Added a blank line after declarations to fix the following warnings issued by 
checkpatch.pl:

drivers/staging/silicom/bypasslib/bypass.c:138: WARNING: Missing a blank line 
after declarations
drivers/staging/silicom/bypasslib/bypass.c:189: WARNING: Missing a blank line 
after declarations

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/silicom/bypasslib/bypass.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/silicom/bypasslib/bypass.c 
b/drivers/staging/silicom/bypasslib/bypass.c
index a58251f..8e714a8 100644
--- a/drivers/staging/silicom/bypasslib/bypass.c
+++ b/drivers/staging/silicom/bypasslib/bypass.c
@@ -135,6 +135,7 @@ static int doit(int cmd, int if_index, int *data)
 static int is_dev_sd(int if_index)
 {
int ret = 0;
+
SET_BPLIB_INT_FN(is_bypass, int, if_index, ret);
return ret >= 0 ? 1 : 0;
 }
@@ -186,6 +187,7 @@ static int is_bypass_dev(int if_index)
 static int is_bypass(int if_index)
 {
int ret = 0;
+
SET_BPLIB_INT_FN(is_bypass, int, if_index, ret);
if (ret < 0)
--
1.7.9.5

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


[PATCH 22/27] Staging: bcm: Shortened lines and replaced member accessing in CopyIpAddrToClassifier()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 94f3f15..d5d5a9f 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -222,16 +222,20 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule 
*pstClassifierEntry,
 void ClearTargetDSXBuffer(struct bcm_mini_adapter *Adapter, B_UINT16 TID, bool 
bFreeAll)
 {
int i;
+   struct bcm_targetdsx_buffer *curr_buf;
 
for (i = 0; i < Adapter->ulTotalTargetBuffersAvailable; i++) {
-   if (Adapter->astTargetDsxBuffer[i].valid)
+   curr_buf = &Adapter->astTargetDsxBuffer[i];
+
+   if (curr_buf->valid)
continue;
 
-   if ((bFreeAll) || (Adapter->astTargetDsxBuffer[i].tid == TID)) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, 
"ClearTargetDSXBuffer: found tid %d buffer cleared %lx\n",
-   TID, 
Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer);
-   Adapter->astTargetDsxBuffer[i].valid = 1;
-   Adapter->astTargetDsxBuffer[i].tid = 0;
+   if ((bFreeAll) || (curr_buf->tid == TID)) {
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
+   "ClearTargetDSXBuffer: found tid %d 
buffer cleared %lx\n",
+   TID, curr_buf->ulTargetDsxBuffer);
+   curr_buf->valid = 1;
+   curr_buf->tid = 0;
Adapter->ulFreeTargetBufferCnt++;
}
}
-- 
1.9.3

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


[PATCH 21/27] Staging: bcm: Shortened lines in CopyClassifierRuleToSF()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 128 ++-
 1 file changed, 89 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 20e4174..94f3f15 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -241,7 +241,10 @@ void ClearTargetDSXBuffer(struct bcm_mini_adapter 
*Adapter, B_UINT16 TID, bool b
  * @ingroup ctrl_pkt_functions
  * copy classifier rule into the specified SF index
  */
-static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter, 
struct bcm_convergence_types *psfCSType, UINT uiSearchRuleIndex, UINT 
nClassifierIndex)
+static inline VOID CopyClassifierRuleToSF(struct bcm_mini_adapter *Adapter,
+   struct bcm_convergence_types *psfCSType,
+   UINT uiSearchRuleIndex,
+   UINT nClassifierIndex)
 {
struct bcm_classifier_rule *pstClassifierEntry = NULL;
/* VOID *pvPhsContext = NULL; */
@@ -256,7 +259,8 @@ static inline VOID CopyClassifierRuleToSF(struct 
bcm_mini_adapter *Adapter, stru
nClassifierIndex > (MAX_CLASSIFIERS-1))
return;
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"Storing Classifier Rule Index : %X",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Storing Classifier Rule Index : %X",

ntohs(pack_class_rule->u16PacketClassificationRuleIndex));
 
if (nClassifierIndex > MAX_CLASSIFIERS-1)
@@ -265,31 +269,42 @@ static inline VOID CopyClassifierRuleToSF(struct 
bcm_mini_adapter *Adapter, stru
pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
if (pstClassifierEntry) {
/* Store if Ipv6 */
-   pstClassifierEntry->bIpv6Protocol = 
(Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ? TRUE : false;
+   pstClassifierEntry->bIpv6Protocol =
+   (Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == 
IPV6) ? TRUE : false;
 
/* Destinaiton Port */
-   pstClassifierEntry->ucDestPortRangeLength = 
pack_class_rule->u8ProtocolDestPortRangeLength / 4;
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Destination Port Range Length:0x%X ", 
pstClassifierEntry->ucDestPortRangeLength);
+   pstClassifierEntry->ucDestPortRangeLength =
+   pack_class_rule->u8ProtocolDestPortRangeLength / 4;
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Destination Port Range Length:0x%X ",
+   pstClassifierEntry->ucDestPortRangeLength);
 
if (pack_class_rule->u8ProtocolDestPortRangeLength <= 
MAX_PORT_RANGE) {
for (i = 0; i < 
(pstClassifierEntry->ucDestPortRangeLength); i++) {
-   pstClassifierEntry->usDestPortRangeLo[i] = 
*((PUSHORT)(pack_class_rule->u8ProtocolDestPortRange+i));
+   pstClassifierEntry->usDestPortRangeLo[i] =
+   
*((PUSHORT)(pack_class_rule->u8ProtocolDestPortRange+i));
pstClassifierEntry->usDestPortRangeHi[i] =

*((PUSHORT)(pack_class_rule->u8ProtocolDestPortRange+2+i));
-   pstClassifierEntry->usDestPortRangeLo[i] = 
ntohs(pstClassifierEntry->usDestPortRangeLo[i]);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, 
CONN_MSG, DBG_LVL_ALL, "Destination Port Range Lo:0x%X ",
+   pstClassifierEntry->usDestPortRangeLo[i] =
+   
ntohs(pstClassifierEntry->usDestPortRangeLo[i]);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
+   CONN_MSG, DBG_LVL_ALL,
+   "Destination Port Range Lo:0x%X 
",

pstClassifierEntry->usDestPortRangeLo[i]);
-   pstClassifierEntry->usDestPortRangeHi[i] = 
ntohs(pstClassifierEntry->usDestPortRangeHi[i]);
+   pstClassifierEntry->usDestPortRangeHi[i] =
+   
ntohs(pstClassifierEntry->usDestPortRangeHi[i]);
}
} else {
pstClassifierEntry->ucDestPortRangeLength = 0;
}
 
/* Source Port */
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Source Port Range Length:0x%X ",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Source Port Range Length:0x%X ",

pack_class_rule->u8Prot

[PATCH 20/27] Staging: bcm: Replaced member accessing with variable

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 77 +++-
 1 file changed, 40 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 9186619..20e4174 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -249,12 +249,15 @@ static inline VOID CopyClassifierRuleToSF(struct 
bcm_mini_adapter *Adapter, stru
/* UCHAR ucProtocolLength=0; */
/* ULONG ulPhsStatus; */
 
+   struct bcm_packet_class_rules *pack_class_rule =
+   &psfCSType->cCPacketClassificationRule;
+
if (Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value == 0 ||
nClassifierIndex > (MAX_CLASSIFIERS-1))
return;
 
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"Storing Classifier Rule Index : %X",
-   
ntohs(psfCSType->cCPacketClassificationRule.u16PacketClassificationRuleIndex));
+   
ntohs(pack_class_rule->u16PacketClassificationRuleIndex));
 
if (nClassifierIndex > MAX_CLASSIFIERS-1)
return;
@@ -265,14 +268,14 @@ static inline VOID CopyClassifierRuleToSF(struct 
bcm_mini_adapter *Adapter, stru
pstClassifierEntry->bIpv6Protocol = 
(Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion == IPV6) ? TRUE : false;
 
/* Destinaiton Port */
-   pstClassifierEntry->ucDestPortRangeLength = 
psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength / 4;
+   pstClassifierEntry->ucDestPortRangeLength = 
pack_class_rule->u8ProtocolDestPortRangeLength / 4;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Destination Port Range Length:0x%X ", 
pstClassifierEntry->ucDestPortRangeLength);
 
-   if 
(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRangeLength <= 
MAX_PORT_RANGE) {
+   if (pack_class_rule->u8ProtocolDestPortRangeLength <= 
MAX_PORT_RANGE) {
for (i = 0; i < 
(pstClassifierEntry->ucDestPortRangeLength); i++) {
-   pstClassifierEntry->usDestPortRangeLo[i] = 
*((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+i));
+   pstClassifierEntry->usDestPortRangeLo[i] = 
*((PUSHORT)(pack_class_rule->u8ProtocolDestPortRange+i));
pstClassifierEntry->usDestPortRangeHi[i] =
-   
*((PUSHORT)(psfCSType->cCPacketClassificationRule.u8ProtocolDestPortRange+2+i));
+   
*((PUSHORT)(pack_class_rule->u8ProtocolDestPortRange+2+i));
pstClassifierEntry->usDestPortRangeLo[i] = 
ntohs(pstClassifierEntry->usDestPortRangeLo[i]);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, 
CONN_MSG, DBG_LVL_ALL, "Destination Port Range Lo:0x%X ",

pstClassifierEntry->usDestPortRangeLo[i]);
@@ -284,15 +287,15 @@ static inline VOID CopyClassifierRuleToSF(struct 
bcm_mini_adapter *Adapter, stru
 
/* Source Port */
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Source Port Range Length:0x%X ",
-   
psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
-   if 
(psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength <= 
MAX_PORT_RANGE) {
-   pstClassifierEntry->ucSrcPortRangeLength = 
psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength/4;
+   
pack_class_rule->u8ProtocolSourcePortRangeLength);
+   if (pack_class_rule->u8ProtocolSourcePortRangeLength <= 
MAX_PORT_RANGE) {
+   pstClassifierEntry->ucSrcPortRangeLength = 
pack_class_rule->u8ProtocolSourcePortRangeLength/4;
for (i = 0; i < 
(pstClassifierEntry->ucSrcPortRangeLength); i++) {
pstClassifierEntry->usSrcPortRangeLo[i] =
-   
*((PUSHORT)(psfCSType->cCPacketClassificationRule.
+   *((PUSHORT)(pack_class_rule->

u8ProtocolSourcePortRange+i));
pstClassifierEntry->usSrcPortRangeHi[i] =
-   
*((PUSHORT)(psfCSType->cCPacketClassificationRule.
+   *((PUSHORT)(pack_class_rule->

u8ProtocolSourcePortRange+2+i));
pstClassifierEntry->usSrcPortRangeLo[i] =

ntohs(pstClassifierEntry->usSrcPortRangeLo[i]);
@@ -304,8 +307,8 @@ static inline VOID CopyClassifierRuleToSF(struct 
bcm_mini_adapter *Adapter, stru
 

[PATCH 23/27] Staging: bcm: Replaced member accessing by variable

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 43 +--
 1 file changed, 25 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index d5d5a9f..7fb8568 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -139,6 +139,13 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule 
*pstClassifierEntry,
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Ip 
Address Range Length:0x%X ", u8IpAddressLen);
if ((bIpVersion6 ? (IPV6_ADDRESS_SIZEINBYTES * MAX_IP_RANGE_LENGTH * 2) 
:
(TOTAL_MASKED_ADDRESS_IN_BYTES)) >= u8IpAddressLen) {
+
+   union u_ip_address *st_dest_ip =
+   &pstClassifierEntry->stDestIpAddress;
+
+   union u_ip_address *st_src_ip =
+   &pstClassifierEntry->stSrcIpAddress;
+
/*
 * checking both the mask and address togethor in 
Classification.
 * So length will be : 
TotalLengthInBytes/nSizeOfIPAddressInBytes * 2
@@ -147,20 +154,20 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule 
*pstClassifierEntry,
if (eIpAddrContext == eDestIpAddress) {
pstClassifierEntry->ucIPDestinationAddressLength = 
u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
if (bIpVersion6) {
-   ptrClassifierIpAddress = 
pstClassifierEntry->stDestIpAddress.ucIpv6Address;
-   ptrClassifierIpMask = 
pstClassifierEntry->stDestIpAddress.ucIpv6Mask;
+   ptrClassifierIpAddress = 
st_dest_ip->ucIpv6Address;
+   ptrClassifierIpMask = st_dest_ip->ucIpv6Mask;
} else {
-   ptrClassifierIpAddress = 
pstClassifierEntry->stDestIpAddress.ucIpv4Address;
-   ptrClassifierIpMask = 
pstClassifierEntry->stDestIpAddress.ucIpv4Mask;
+   ptrClassifierIpAddress = 
st_dest_ip->ucIpv4Address;
+   ptrClassifierIpMask = st_dest_ip->ucIpv4Mask;
}
} else if (eIpAddrContext == eSrcIpAddress) {
pstClassifierEntry->ucIPSourceAddressLength = 
u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
if (bIpVersion6) {
-   ptrClassifierIpAddress = 
pstClassifierEntry->stSrcIpAddress.ucIpv6Address;
-   ptrClassifierIpMask = 
pstClassifierEntry->stSrcIpAddress.ucIpv6Mask;
+   ptrClassifierIpAddress = 
st_src_ip->ucIpv6Address;
+   ptrClassifierIpMask = st_src_ip->ucIpv6Mask;
} else {
-   ptrClassifierIpAddress = 
pstClassifierEntry->stSrcIpAddress.ucIpv4Address;
-   ptrClassifierIpMask = 
pstClassifierEntry->stSrcIpAddress.ucIpv4Mask;
+   ptrClassifierIpAddress = 
st_src_ip->ucIpv4Address;
+   ptrClassifierIpMask = st_src_ip->ucIpv4Mask;
}
}
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Address Length:0x%X\n", 
pstClassifierEntry->ucIPDestinationAddressLength);
@@ -172,13 +179,13 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule 
*pstClassifierEntry,
 
if (!bIpVersion6) {
if (eIpAddrContext == eSrcIpAddress) {
-   
pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[i] = 
ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[i]);
+   st_src_ip->ulIpv4Addr[i] = 
ntohl(st_src_ip->ulIpv4Addr[i]);
BCM_DEBUG_PRINT(Adapter, 
DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Src Ip Address:0x%luX ",
-   
pstClassifierEntry->stSrcIpAddress.ulIpv4Addr[i]);
+   
st_src_ip->ulIpv4Addr[i]);
} else if (eIpAddrContext == eDestIpAddress) {
-   
pstClassifierEntry->stDestIpAddress.ulIpv4Addr[i] = 
ntohl(pstClassifierEntry->stDestIpAddress.ulIpv4Addr[i]);
+   st_dest_ip->ulIpv4Addr[i] = 
ntohl(st_dest_ip->ulIpv4Addr[i]);
BCM_DEBUG_PRINT(Adapter, 
DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Dest Ip Address:0x%luX ",
-   
pstClassifierEntry->stDestIpAddress.ulIpv4Addr[i]);
+   
st_dest_ip->ulIpv4Addr[i]);
}
}
u8IpAddressL

[PATCH 19/27] Staging: bcm: Shortened lines in DeleteClassifierRuleFromSF()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index aa121b7..9186619 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -370,7 +370,8 @@ static inline VOID CopyClassifierRuleToSF(struct 
bcm_mini_adapter *Adapter, stru
 /*
  * @ingroup ctrl_pkt_functions
  */
-static inline VOID DeleteClassifierRuleFromSF(struct bcm_mini_adapter 
*Adapter, UINT uiSearchRuleIndex, UINT nClassifierIndex)
+static inline VOID DeleteClassifierRuleFromSF(struct bcm_mini_adapter *Adapter,
+   UINT uiSearchRuleIndex, UINT nClassifierIndex)
 {
struct bcm_classifier_rule *pstClassifierEntry = NULL;
B_UINT16 u16PacketClassificationRuleIndex;
@@ -386,15 +387,18 @@ static inline VOID DeleteClassifierRuleFromSF(struct 
bcm_mini_adapter *Adapter,
if (usVCID == 0)
return;
 
-   u16PacketClassificationRuleIndex = 
Adapter->astClassifierTable[nClassifierIndex].uiClassifierRuleIndex;
+   u16PacketClassificationRuleIndex =
+   
Adapter->astClassifierTable[nClassifierIndex].uiClassifierRuleIndex;
pstClassifierEntry = &Adapter->astClassifierTable[nClassifierIndex];
if (pstClassifierEntry) {
pstClassifierEntry->bUsed = false;
pstClassifierEntry->uiClassifierRuleIndex = 0;
-   memset(pstClassifierEntry, 0, sizeof(struct 
bcm_classifier_rule));
+   memset(pstClassifierEntry, 0,
+   sizeof(struct bcm_classifier_rule));
 
/* Delete the PHS Rule for this classifier */
-   PhsDeleteClassifierRule(&Adapter->stBCMPhsContext, usVCID, 
u16PacketClassificationRuleIndex);
+   PhsDeleteClassifierRule(&Adapter->stBCMPhsContext, usVCID,
+   u16PacketClassificationRuleIndex);
}
 }
 
-- 
1.9.3

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


[PATCH 17/27] Staging: bcm: Shortened lines in CopyToAdapter()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 97 
 1 file changed, 70 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index d5e2ac2..a13f2ad 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -453,9 +453,12 @@ static VOID CopyToAdapter(register struct bcm_mini_adapter 
*Adapter, /* bValid = TRUE;
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"Search Rule Index = %d\n", uiSearchRuleIndex);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "%s: 
SFID= %x ", __func__, ntohl(psfLocalSet->u32SFID));
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"Updating Queue %d", uiSearchRuleIndex);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Search Rule Index = %d\n", uiSearchRuleIndex);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "%s: SFID= %x ", __func__, ntohl(psfLocalSet->u32SFID));
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Updating Queue %d", uiSearchRuleIndex);
 
ulSFID = ntohl(psfLocalSet->u32SFID);
/* Store IP Version used */
@@ -465,7 +468,9 @@ static VOID CopyToAdapter(register struct bcm_mini_adapter 
*Adapter, /* bEthCSSupport = 0;
 
/* Enable IP/ETh CS Support As Required */
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"CopyToAdapter : u8CSSpecification : %X\n", psfLocalSet->u8CSSpecification);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "CopyToAdapter : u8CSSpecification : %X\n",
+   psfLocalSet->u8CSSpecification);
switch (psfLocalSet->u8CSSpecification) {
case eCSPacketIPV4:
curr_packinfo->bIPCSSupport = IPV4_CS;
@@ -488,12 +493,14 @@ static VOID CopyToAdapter(register struct 
bcm_mini_adapter *Adapter, /* bEthCSSupport = ETH_CS_802_3;
break;
default:
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Error in value of CS Classification.. setting default to IP 
CS\n");
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Error in value of CS Classification.. setting 
default to IP CS\n");
curr_packinfo->bIPCSSupport = IPV4_CS;
break;
}
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"CopyToAdapter : Queue No : %X ETH CS Support :  %X  , IP CS Support : %X\n",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "CopyToAdapter : Queue No : %X ETH CS Support :  %X  , 
IP CS Support : %X\n",
uiSearchRuleIndex,
curr_packinfo->bEthCSSupport,
curr_packinfo->bIPCSSupport);
@@ -510,7 +517,9 @@ static VOID CopyToAdapter(register struct bcm_mini_adapter 
*Adapter, /* bEthCSSupport = 0;
 
if (psfLocalSet->u8ServiceClassNameLength > 0 && 
psfLocalSet->u8ServiceClassNameLength < 32)
-   memcpy(curr_packinfo->ucServiceClassName,   
psfLocalSet->u8ServiceClassName, psfLocalSet->u8ServiceClassNameLength);
+   memcpy(curr_packinfo->ucServiceClassName,
+   psfLocalSet->u8ServiceClassName,
+   psfLocalSet->u8ServiceClassNameLength);
 
curr_packinfo->u8QueueType = psfLocalSet->u8ServiceFlowSchedulingType;
 
@@ -523,9 +532,11 @@ static VOID CopyToAdapter(register struct bcm_mini_adapter 
*Adapter, /* u8TotalClassifiers; i++) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Classifier index =%d", i);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Classifier index =%d", i);
psfCSType = &psfLocalSet->cConvergenceSLTypes[i];
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Classifier index =%d", i);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Classifier index =%d", i);
 
if 
(psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority)
curr_packinfo->bClassifierPriority = TRUE;
@@ -557,20 +568,30 @@ static VOID CopyToAdapter(register struct 
bcm_mini_adapter *Adapter, /*  MAX_CLASSIFIERS) {
nClassifierIndex = SearchFreeClsid(Adapter);
if (nClassifierIndex > MAX_CLASSIFIERS) {
/* Failed To get a free Entry */
-   BCM_DEBUG_PRINT(Adapter, 
DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Error Failed To get a fr

[PATCH 18/27] Staging: bcm: Shortened line in DeleteAllClassifiersForSF()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index a13f2ad..aa121b7 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -401,7 +401,8 @@ static inline VOID DeleteClassifierRuleFromSF(struct 
bcm_mini_adapter *Adapter,
 /*
  * @ingroup ctrl_pkt_functions
  */
-VOID DeleteAllClassifiersForSF(struct bcm_mini_adapter *Adapter, UINT 
uiSearchRuleIndex)
+VOID DeleteAllClassifiersForSF(struct bcm_mini_adapter *Adapter,
+   UINT uiSearchRuleIndex)
 {
struct bcm_classifier_rule *pstClassifierEntry = NULL;
int i;
@@ -420,7 +421,8 @@ VOID DeleteAllClassifiersForSF(struct bcm_mini_adapter 
*Adapter, UINT uiSearchRu
pstClassifierEntry = &Adapter->astClassifierTable[i];
 
if (pstClassifierEntry->bUsed)
-   DeleteClassifierRuleFromSF(Adapter, 
uiSearchRuleIndex, i);
+   DeleteClassifierRuleFromSF(Adapter,
+   uiSearchRuleIndex, i);
}
}
 
-- 
1.9.3

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


[PATCH 16/27] Staging: bcm: Replaced struct member accessing with variable

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 96 ++--
 1 file changed, 49 insertions(+), 47 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 21074ae..d5e2ac2 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -447,10 +447,12 @@ static VOID CopyToAdapter(register struct 
bcm_mini_adapter *Adapter, /* PackInfo[uiSearchRuleIndex].usVCID_Value;
+   struct bcm_packet_info *curr_packinfo =
+   &Adapter->PackInfo[uiSearchRuleIndex];
+   USHORT uVCID = curr_packinfo->usVCID_Value;
UINT UGIValue = 0;
 
-   Adapter->PackInfo[uiSearchRuleIndex].bValid = TRUE;
+   curr_packinfo->bValid = TRUE;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"Search Rule Index = %d\n", uiSearchRuleIndex);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "%s: 
SFID= %x ", __func__, ntohl(psfLocalSet->u32SFID));
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"Updating Queue %d", uiSearchRuleIndex);
@@ -459,65 +461,65 @@ static VOID CopyToAdapter(register struct 
bcm_mini_adapter *Adapter, /* PackInfo[uiSearchRuleIndex].bIPCSSupport = 0;
-   Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0;
+   curr_packinfo->bIPCSSupport = 0;
+   curr_packinfo->bEthCSSupport = 0;
 
/* Enable IP/ETh CS Support As Required */
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"CopyToAdapter : u8CSSpecification : %X\n", psfLocalSet->u8CSSpecification);
switch (psfLocalSet->u8CSSpecification) {
case eCSPacketIPV4:
-   Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
+   curr_packinfo->bIPCSSupport = IPV4_CS;
break;
case eCSPacketIPV6:
-   Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV6_CS;
+   curr_packinfo->bIPCSSupport = IPV6_CS;
break;
case eCS802_3PacketEthernet:
case eCS802_1QPacketVLAN:
-   Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 
ETH_CS_802_3;
+   curr_packinfo->bEthCSSupport = ETH_CS_802_3;
break;
case eCSPacketIPV4Over802_1QVLAN:
case eCSPacketIPV4Over802_3Ethernet:
-   Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
-   Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 
ETH_CS_802_3;
+   curr_packinfo->bIPCSSupport = IPV4_CS;
+   curr_packinfo->bEthCSSupport = ETH_CS_802_3;
break;
case eCSPacketIPV6Over802_1QVLAN:
case eCSPacketIPV6Over802_3Ethernet:
-   Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV6_CS;
-   Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 
ETH_CS_802_3;
+   curr_packinfo->bIPCSSupport = IPV6_CS;
+   curr_packinfo->bEthCSSupport = ETH_CS_802_3;
break;
default:
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Error in value of CS Classification.. setting default to IP 
CS\n");
-   Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport = IPV4_CS;
+   curr_packinfo->bIPCSSupport = IPV4_CS;
break;
}
 
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"CopyToAdapter : Queue No : %X ETH CS Support :  %X  , IP CS Support : %X\n",
uiSearchRuleIndex,
-   Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport,
-   Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport);
+   curr_packinfo->bEthCSSupport,
+   curr_packinfo->bIPCSSupport);
 
/* Store IP Version used */
/* Get The Version Of IP used (IPv6 or IPv4) from CSSpecification field 
of SF */
-   if (Adapter->PackInfo[uiSearchRuleIndex].bIPCSSupport == IPV6_CS)
-   Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = IPV6;
+   if (curr_packinfo->bIPCSSupport == IPV6_CS)
+   curr_packinfo->ucIpVersion = IPV6;
else
-   Adapter->PackInfo[uiSearchRuleIndex].ucIpVersion = IPV4;
+   curr_packinfo->ucIpVersion = IPV4;
 
/* To ensure that the ETH CS code doesn't gets executed if the BS 
doesn't supports ETH CS */
if (!Adapter->bETHCSEnabled)
-   Adapter->PackInfo[uiSearchRuleIndex].bEthCSSupport = 0;
+   curr_packinfo->bEthCSSupport = 0;
 
if (psfLocalSet->u8ServiceClassNameLength > 0 && 
psfLocalSet->u8ServiceClassNameLength < 32)
-   memcpy(Adapter->PackInfo[uiSearchRuleIndex].ucServiceClassName, 
psfLocalSet->u8ServiceClassName, psfLocalSet->u8ServiceClassNameLength);
+   memcpy(curr_packinfo->ucServiceClassName,   
psfLocalSet->u8ServiceClassName, psfLocalSet->u8ServiceClas

[PATCH 11/27] Staging: bcm: Shortened lines in StoreSFParam()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index f54b177..ea73c52 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1275,7 +1275,8 @@ static inline ULONG RestoreSFParam(struct 
bcm_mini_adapter *Adapter, ULONG ulAdd
return 1;
 }
 
-static ULONG StoreSFParam(struct bcm_mini_adapter *Adapter, PUCHAR 
pucSrcBuffer, ULONG ulAddrSFParamSet)
+static ULONG StoreSFParam(struct bcm_mini_adapter *Adapter, PUCHAR 
pucSrcBuffer,
+   ULONG ulAddrSFParamSet)
 {
UINT nBytesToWrite = sizeof(struct bcm_connect_mgr_params);
int ret = 0;
@@ -1285,7 +1286,8 @@ static ULONG StoreSFParam(struct bcm_mini_adapter 
*Adapter, PUCHAR pucSrcBuffer,
 
ret = wrm(Adapter, ulAddrSFParamSet, (u8 *)pucSrcBuffer, nBytesToWrite);
if (ret < 0) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "%s:%d WRM failed", __func__, __LINE__);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "%s:%d WRM failed", __func__, __LINE__);
return ret;
}
return 1;
-- 
1.9.3

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


[PATCH 13/27] Staging: bcm: Replaced long member-accessing

2014-05-23 Thread Matthias Beyer
This patch replaces long object->member.member foo by variable useage.
Increases the reading experience a lot by introducing only one variable
(as it decreases the whoa-wall-of-text experience).

Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 107 ++-
 1 file changed, 55 insertions(+), 52 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 377e681..644087c 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1159,99 +1159,102 @@ static VOID DumpCmControlPacket(PVOID pvBuffer)
 
for (nIndex = 0; nIndex < nCurClassifierCnt; nIndex++)  {
struct bcm_convergence_types *psfCSType = NULL;
+   struct bcm_packet_class_rules *clsRule = NULL;
+
+   psfCSType = 
&pstAddIndication->sfActiveSet.cConvergenceSLTypes[nIndex];
+   clsRule = &psfCSType->cCPacketClassificationRule;
 
-   psfCSType =  
&pstAddIndication->sfActiveSet.cConvergenceSLTypes[nIndex];
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " CCPacketClassificationRuleSI>");
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8ClassifierRulePriority: 0x%X ",
-   
psfCSType->cCPacketClassificationRule.u8ClassifierRulePriority);
+   clsRule->u8ClassifierRulePriority);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8IPTypeOfServiceLength: 0x%X ",
-   
psfCSType->cCPacketClassificationRule.u8IPTypeOfServiceLength);
+   clsRule->u8IPTypeOfServiceLength);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8IPTypeOfService[3]: 0x%X ,0x%X ,0x%X ",
-   
psfCSType->cCPacketClassificationRule.u8IPTypeOfService[0],
-   
psfCSType->cCPacketClassificationRule.u8IPTypeOfService[1],
-   
psfCSType->cCPacketClassificationRule.u8IPTypeOfService[2]);
+   clsRule->u8IPTypeOfService[0],
+   clsRule->u8IPTypeOfService[1],
+   clsRule->u8IPTypeOfService[2]);
 
for (uiLoopIndex = 0; uiLoopIndex < 1; uiLoopIndex++)
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8Protocol: 0x%X ", 
psfCSType->cCPacketClassificationRule.u8Protocol);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8Protocol: 0x%X ", clsRule->u8Protocol);
 
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, "u8IPMaskedSourceAddressLength: 0x%X ",
-   
psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddressLength);
+   clsRule->u8IPMaskedSourceAddressLength);
 
for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++)
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, "u8IPMaskedSourceAddress[32]: 0x%X ",
-   
psfCSType->cCPacketClassificationRule.u8IPMaskedSourceAddress[uiLoopIndex]);
+   
clsRule->u8IPMaskedSourceAddress[uiLoopIndex]);
 
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, "u8IPDestinationAddressLength: 0x%02X ",
-   
psfCSType->cCPacketClassificationRule.u8IPDestinationAddressLength);
+   clsRule->u8IPDestinationAddressLength);
 
for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++)
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8IPDestinationAddress[32]:0x%X ",
-   
psfCSType->cCPacketClassificationRule.u8IPDestinationAddress[uiLoopIndex]);
+   
clsRule->u8IPDestinationAddress[uiLoopIndex]);
 
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8ProtocolSourcePortRangeLength: 0x%X ",
-   
psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRangeLength);
+   clsRule->u8ProtocolSourcePortRangeLength);
 
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8ProtocolSourcePortRange[4]: 0x%X ,0x%X ,0x%X ,0x%X ",
-   
psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[0],
-   
psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[1],
-   
psfCSType->cCPacketClassificationRule.u8ProtocolSourcePortRange[2],
-   
psfCSType->cCPacketClassificationRule.u8ProtocolS

[PATCH 15/27] Staging: bcm: Outsourced PHS rule applying

2014-05-23 Thread Matthias Beyer
This patch outsources the big PHS-rule-applying code chunk into a
function.

It also replaces member accessing by using variables.

Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 170 +--
 1 file changed, 99 insertions(+), 71 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 89030cc..21074ae 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -18,6 +18,14 @@ static void restore_endianess_of_pstClassifierEntry(
struct bcm_classifier_rule *pstClassifierEntry,
enum bcm_ipaddr_context eIpAddrContext);
 
+static void apply_phs_rule_to_all_classifiers(
+   register struct bcm_mini_adapter *Adapter,
+   register UINT uiSearchRuleIndex,
+   USHORT uVCID,
+   struct bcm_phs_rule *sPhsRule,
+   struct bcm_phs_rules *cPhsRule,
+   struct bcm_add_indication_alt *pstAddIndication);
+
 /
  * Function - SearchSfid
  *
@@ -627,79 +635,12 @@ static VOID CopyToAdapter(register struct 
bcm_mini_adapter *Adapter, /* cPhsRule.u8PHSI) {
/* Apply This PHS Rule to all classifiers whose 
Associated PHSI Match */
-   unsigned int uiClassifierIndex = 0;
-   if (pstAddIndication->u8Direction == 
UPLINK_DIR) {
-   for (uiClassifierIndex = 0; 
uiClassifierIndex < MAX_CLASSIFIERS; uiClassifierIndex++) {
-   if 
((Adapter->astClassifierTable[uiClassifierIndex].bUsed) &&
-   
(Adapter->astClassifierTable[uiClassifierIndex].ulSFID == 
Adapter->PackInfo[uiSearchRuleIndex].ulSFID) &&
-   
(Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI == 
psfCSType->cPhsRule.u8PHSI)) {
-   
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
-   "Adding 
PHS Rule For Classifier: 0x%x cPhsRule.u8PHSI: 0x%x\n",
-   
Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex,
-   
psfCSType->cPhsRule.u8PHSI);
-   /* Update The PHS Rule 
for this classifier as Associated PHSI id defined */
-
-   /* Copy the PHS Rule */
-   sPhsRule.u8PHSI = 
psfCSType->cPhsRule.u8PHSI;
-   sPhsRule.u8PHSFLength = 
psfCSType->cPhsRule.u8PHSFLength;
-   sPhsRule.u8PHSMLength = 
psfCSType->cPhsRule.u8PHSMLength;
-   sPhsRule.u8PHSS = 
psfCSType->cPhsRule.u8PHSS;
-   sPhsRule.u8PHSV = 
psfCSType->cPhsRule.u8PHSV;
-   memcpy(sPhsRule.u8PHSF, 
psfCSType->cPhsRule.u8PHSF, MAX_PHS_LENGTHS);
-   memcpy(sPhsRule.u8PHSM, 
psfCSType->cPhsRule.u8PHSM, MAX_PHS_LENGTHS);
-   sPhsRule.u8RefCnt = 0;
-   
sPhsRule.bUnclassifiedPHSRule = false;
-   
sPhsRule.PHSModifiedBytes = 0;
-   
sPhsRule.PHSModifiedNumPackets = 0;
-   
sPhsRule.PHSErrorNumPackets = 0;
-
-   /* bPHSRuleAssociated = 
TRUE; */
-   /* Store The PHS Rule 
for this classifier */
-
-   PhsUpdateClassifierRule(
-   
&Adapter->stBCMPhsContext,
-   uVCID,
-   
Adapter->astClassifierTable[uiClassifierIndex].uiClassifierRuleIndex,
-   &sPhsRule,
-   
Adapter->astClassifierTable[uiClassifierIndex].u8AssociatedPHSI);
-
-   /* Update PHS Rule For 
the Classifier */
-   if (sPhsRule.u8PHSI) {
-  

[PATCH 14/27] Staging: bcm: Shortened some lines in DumpCmControlPacker()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 106 +++
 1 file changed, 78 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 644087c..89030cc 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1164,53 +1164,81 @@ static VOID DumpCmControlPacket(PVOID pvBuffer)
psfCSType = 
&pstAddIndication->sfActiveSet.cConvergenceSLTypes[nIndex];
clsRule = &psfCSType->cCPacketClassificationRule;
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " CCPacketClassificationRuleSI>");
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8ClassifierRulePriority: 0x%X ",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
+   DBG_LVL_ALL, " 
CCPacketClassificationRuleSI>");
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
+   DBG_LVL_ALL, " u8ClassifierRulePriority: 0x%X ",
clsRule->u8ClassifierRulePriority);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8IPTypeOfServiceLength: 0x%X ",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
+   DBG_LVL_ALL, " u8IPTypeOfServiceLength: 0x%X ",
clsRule->u8IPTypeOfServiceLength);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8IPTypeOfService[3]: 0x%X ,0x%X ,0x%X ",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
+   DBG_LVL_ALL,
+   " u8IPTypeOfService[3]: 0x%X ,0x%X ,0x%X ",
clsRule->u8IPTypeOfService[0],
clsRule->u8IPTypeOfService[1],
clsRule->u8IPTypeOfService[2]);
 
for (uiLoopIndex = 0; uiLoopIndex < 1; uiLoopIndex++)
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8Protocol: 0x%X ", clsRule->u8Protocol);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
+   DBG_LVL_ALL,
+   " u8Protocol: 0x%X ",
+   clsRule->u8Protocol);
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, "u8IPMaskedSourceAddressLength: 0x%X ",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
+   DBG_LVL_ALL,
+   "u8IPMaskedSourceAddressLength: 0x%X ",
clsRule->u8IPMaskedSourceAddressLength);
 
for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++)
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, "u8IPMaskedSourceAddress[32]: 0x%X ",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
+   DBG_LVL_ALL,
+   "u8IPMaskedSourceAddress[32]: 0x%X ",

clsRule->u8IPMaskedSourceAddress[uiLoopIndex]);
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, "u8IPDestinationAddressLength: 0x%02X ",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
+   DBG_LVL_ALL,
+   "u8IPDestinationAddressLength: 0x%02X ",
clsRule->u8IPDestinationAddressLength);
 
for (uiLoopIndex = 0; uiLoopIndex < 32; uiLoopIndex++)
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8IPDestinationAddress[32]:0x%X ",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
+   DBG_LVL_ALL,
+   " u8IPDestinationAddress[32]:0x%X ",

clsRule->u8IPDestinationAddress[uiLoopIndex]);
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8ProtocolSourcePortRangeLength: 0x%X ",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
+   DBG_LVL_ALL,
+   " u8ProtocolSourcePortRangeLength: 0x%X ",
clsRule->u8ProtocolSourcePortRangeLength);
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, 
DBG_LVL_ALL, " u8ProtocolSourcePortRange[4]: 0x%X ,0x%X ,0x%X ,0x%X ",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL,
+   DBG_LVL_ALL,
+   " u8

[PATCH 12/27] Staging: bcm: Shortened lines in RestoreSFParam()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index ea73c52..377e681 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1258,18 +1258,20 @@ static VOID DumpCmControlPacket(PVOID pvBuffer)
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, " 
bValid: 0x%X", pstAddIndication->sfActiveSet.bValid);
 }
 
-static inline ULONG RestoreSFParam(struct bcm_mini_adapter *Adapter, ULONG 
ulAddrSFParamSet, PUCHAR pucDestBuffer)
+static inline ULONG RestoreSFParam(struct bcm_mini_adapter *Adapter,
+   ULONG ulAddrSFParamSet, PUCHAR pucDestBuffer)
 {
UINT  nBytesToRead = sizeof(struct bcm_connect_mgr_params);
 
if (ulAddrSFParamSet == 0 || NULL == pucDestBuffer) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Got Param address as 0!!");
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Got Param address as 0!!");
return 0;
}
ulAddrSFParamSet = ntohl(ulAddrSFParamSet);
 
/* Read out the SF Param Set At the indicated Location */
-   if (rdm(Adapter, ulAddrSFParamSet, (PUCHAR)pucDestBuffer, nBytesToRead) 
< 0)
+   if (rdm(Adapter, ulAddrSFParamSet,(PUCHAR)pucDestBuffer, nBytesToRead) 
< 0)
return STATUS_FAILURE;
 
return 1;
-- 
1.9.3

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


[PATCH 10/27] Staging: bcm: Shortened lines in StoreCmControlResponseMessage()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 33 +++--
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 3b65990..f54b177 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1291,7 +1291,8 @@ static ULONG StoreSFParam(struct bcm_mini_adapter 
*Adapter, PUCHAR pucSrcBuffer,
return 1;
 }
 
-ULONG StoreCmControlResponseMessage(struct bcm_mini_adapter *Adapter, PVOID 
pvBuffer, UINT *puBufferLength)
+ULONG StoreCmControlResponseMessage(struct bcm_mini_adapter *Adapter,
+   PVOID pvBuffer, UINT *puBufferLength)
 {
struct bcm_add_indication_alt *pstAddIndicationAlt = NULL;
struct bcm_add_indication *pstAddIndication = NULL;
@@ -1325,13 +1326,15 @@ ULONG StoreCmControlResponseMessage(struct 
bcm_mini_adapter *Adapter, PVOID pvBu
}
/* For DSA_REQ, only up to "psfAuthorizedSet" parameter should be 
accessed by driver! */
 
-   pstAddIndication = kmalloc(sizeof(struct bcm_add_indication), 
GFP_KERNEL);
+   pstAddIndication = kmalloc(sizeof(struct bcm_add_indication),
+   GFP_KERNEL);
if (pstAddIndication == NULL)
return 0;
 
/* AUTHORIZED SET */
pstAddIndication->psfAuthorizedSet = (struct bcm_connect_mgr_params *)
-   GetNextTargetBufferLocation(Adapter, 
pstAddIndicationAlt->u16TID);
+   GetNextTargetBufferLocation(Adapter,
+   pstAddIndicationAlt->u16TID);
if (!pstAddIndication->psfAuthorizedSet) {
kfree(pstAddIndication);
return 0;
@@ -1344,7 +1347,9 @@ ULONG StoreCmControlResponseMessage(struct 
bcm_mini_adapter *Adapter, PVOID pvBu
}
 
/* this can't possibly be right */
-   pstAddIndication->psfAuthorizedSet = (struct bcm_connect_mgr_params 
*)ntohl((ULONG)pstAddIndication->psfAuthorizedSet);
+   pstAddIndication->psfAuthorizedSet =
+   (struct bcm_connect_mgr_params *) ntohl(
+   (ULONG)pstAddIndication->psfAuthorizedSet);
 
if (pstAddIndicationAlt->u8Type == DSA_REQ) {
struct bcm_add_request AddRequest;
@@ -1373,31 +1378,39 @@ ULONG StoreCmControlResponseMessage(struct 
bcm_mini_adapter *Adapter, PVOID pvBu
 
/* ADMITTED SET */
pstAddIndication->psfAdmittedSet = (struct bcm_connect_mgr_params *)
-   GetNextTargetBufferLocation(Adapter, 
pstAddIndicationAlt->u16TID);
+   GetNextTargetBufferLocation(Adapter,
+   pstAddIndicationAlt->u16TID);
if (!pstAddIndication->psfAdmittedSet) {
kfree(pstAddIndication);
return 0;
}
-   if (StoreSFParam(Adapter, (PUCHAR)&pstAddIndicationAlt->sfAdmittedSet, 
(ULONG)pstAddIndication->psfAdmittedSet) != 1) {
+   if (StoreSFParam(Adapter, (PUCHAR)&pstAddIndicationAlt->sfAdmittedSet,
+   (ULONG)pstAddIndication->psfAdmittedSet) != 1) {
kfree(pstAddIndication);
return 0;
}
 
-   pstAddIndication->psfAdmittedSet = (struct bcm_connect_mgr_params 
*)ntohl((ULONG)pstAddIndication->psfAdmittedSet);
+   pstAddIndication->psfAdmittedSet =
+   (struct bcm_connect_mgr_params *) ntohl(
+   (ULONG) pstAddIndication->psfAdmittedSet);
 
/* ACTIVE SET */
pstAddIndication->psfActiveSet = (struct bcm_connect_mgr_params *)
-   GetNextTargetBufferLocation(Adapter, 
pstAddIndicationAlt->u16TID);
+   GetNextTargetBufferLocation(Adapter,
+   pstAddIndicationAlt->u16TID);
if (!pstAddIndication->psfActiveSet) {
kfree(pstAddIndication);
return 0;
}
-   if (StoreSFParam(Adapter, (PUCHAR)&pstAddIndicationAlt->sfActiveSet, 
(ULONG)pstAddIndication->psfActiveSet) != 1) {
+   if (StoreSFParam(Adapter, (PUCHAR)&pstAddIndicationAlt->sfActiveSet,
+   (ULONG)pstAddIndication->psfActiveSet) != 1) {
kfree(pstAddIndication);
return 0;
}
 
-   pstAddIndication->psfActiveSet = (struct bcm_connect_mgr_params 
*)ntohl((ULONG)pstAddIndication->psfActiveSet);
+   pstAddIndication->psfActiveSet =
+   (struct bcm_connect_mgr_params *) ntohl(
+   (ULONG)pstAddIndication->psfActiveSet);
 
(*puBufferLength) = sizeof(struct bcm_add_indication);
*(struct bcm_add_indication *)pvBuffer = *pstAddIndication;
-- 
1.9.3

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


[PATCH 27/27] Staging: bcm: Shortened prototype for GetNextTargetBufferLocation()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 182efccd..fb1d932 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -13,7 +13,8 @@ enum E_CLASSIFIER_ACTION {
eDeleteClassifier
 };
 
-static ULONG GetNextTargetBufferLocation(struct bcm_mini_adapter *Adapter, 
B_UINT16 tid);
+static ULONG GetNextTargetBufferLocation(struct bcm_mini_adapter *Adapter,
+   B_UINT16 tid);
 static void restore_endianess_of_pstClassifierEntry(
struct bcm_classifier_rule *pstClassifierEntry,
enum bcm_ipaddr_context eIpAddrContext);
-- 
1.9.3

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


[PATCH 25/27] Staging: bcm: Shortened lines in deleteSFBySfid()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 5bd6e1c..6dfa361 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -109,7 +109,8 @@ static int SearchFreeClsid(struct bcm_mini_adapter *Adapter 
/**Adapter Context*/
return MAX_CLASSIFIERS+1;
 }
 
-static VOID deleteSFBySfid(struct bcm_mini_adapter *Adapter, UINT 
uiSearchRuleIndex)
+static VOID deleteSFBySfid(struct bcm_mini_adapter *Adapter,
+   UINT uiSearchRuleIndex)
 {
/* deleting all the packet held in the SF */
flush_queue(Adapter, uiSearchRuleIndex);
@@ -118,7 +119,8 @@ static VOID deleteSFBySfid(struct bcm_mini_adapter 
*Adapter, UINT uiSearchRuleIn
DeleteAllClassifiersForSF(Adapter, uiSearchRuleIndex);
 
/* Resetting only MIBS related entries in the SF */
-   memset((PVOID)&Adapter->PackInfo[uiSearchRuleIndex], 0, sizeof(struct 
bcm_mibs_table));
+   memset((PVOID)&Adapter->PackInfo[uiSearchRuleIndex], 0,
+   sizeof(struct bcm_mibs_table));
 }
 
 static inline VOID
-- 
1.9.3

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


[PATCH 08/27] Staging: bcm: Shortened lines in SetupTargetDsxBuffers()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 31 ++-
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 9fea9a8..2743d16 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1492,31 +1492,44 @@ ULONG SetUpTargetDsxBuffers(struct bcm_mini_adapter 
*Adapter)
int Status;
 
if (!Adapter) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Adapter was NULL!!!");
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Adapter was NULL!!!");
return 0;
}
 
if (Adapter->astTargetDsxBuffer[0].ulTargetDsxBuffer)
return 1;
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Size 
of Each DSX Buffer(Also size of connection manager parameters): %zx ", 
sizeof(struct bcm_connect_mgr_params));
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"Reading DSX buffer From Target location %x ", DSX_MESSAGE_EXCHANGE_BUFFER);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Size of Each DSX Buffer(Also size of connection 
manager parameters): %zx ",
+   sizeof(struct bcm_connect_mgr_params));
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Reading DSX buffer From Target location %x ",
+   DSX_MESSAGE_EXCHANGE_BUFFER);
 
-   Status = rdmalt(Adapter, DSX_MESSAGE_EXCHANGE_BUFFER, 
(PUINT)&ulTargetDsxBuffersBase, sizeof(UINT));
+   Status = rdmalt(Adapter, DSX_MESSAGE_EXCHANGE_BUFFER,
+   (PUINT)&ulTargetDsxBuffersBase, sizeof(UINT));
if (Status < 0) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "RDM failed!!");
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "RDM failed!!");
return 0;
}
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Base 
Address Of DSX  Target Buffer : 0x%lx", ulTargetDsxBuffersBase);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,  "Tgt 
Buffer is Now %lx :", ulTargetDsxBuffersBase);
-   ulCntTargetBuffers = DSX_MESSAGE_EXCHANGE_BUFFER_SIZE / sizeof(struct 
bcm_connect_mgr_params);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Base Address Of DSX  Target Buffer : 0x%lx",
+   ulTargetDsxBuffersBase);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Tgt Buffer is Now %lx :", ulTargetDsxBuffersBase);
+   ulCntTargetBuffers = DSX_MESSAGE_EXCHANGE_BUFFER_SIZE /
+   sizeof(struct bcm_connect_mgr_params);
 
Adapter->ulTotalTargetBuffersAvailable =
ulCntTargetBuffers > MAX_TARGET_DSX_BUFFERS ?
MAX_TARGET_DSX_BUFFERS : ulCntTargetBuffers;
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, " 
Total Target DSX Buffer setup %lx ", Adapter->ulTotalTargetBuffersAvailable);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   " Total Target DSX Buffer setup %lx ",
+   Adapter->ulTotalTargetBuffersAvailable);
 
for (i = 0; i < Adapter->ulTotalTargetBuffersAvailable; i++) {
Adapter->astTargetDsxBuffer[i].ulTargetDsxBuffer = 
ulTargetDsxBuffersBase;
-- 
1.9.3

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


[PATCH 26/27] Staging: bcm: Shortened lines in SearchClsid()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 6dfa361..182efccd 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -78,13 +78,16 @@ static int SearchFreeSfid(struct bcm_mini_adapter *Adapter)
  *  B_UINT16  uiClassifierID - The classifier ID to be searched
  * Return: int :Classifier table index of matching entry
  */
-static int SearchClsid(struct bcm_mini_adapter *Adapter, ULONG ulSFID, 
B_UINT16  uiClassifierID)
+static int SearchClsid(struct bcm_mini_adapter *Adapter,
+   ULONG ulSFID,
+   B_UINT16 uiClassifierID)
 {
int i;
 
for (i = 0; i < MAX_CLASSIFIERS; i++) {
if ((Adapter->astClassifierTable[i].bUsed) &&
-   (Adapter->astClassifierTable[i].uiClassifierRuleIndex 
== uiClassifierID) &&
+   (Adapter->astClassifierTable[i].uiClassifierRuleIndex
+   == uiClassifierID) &&
(Adapter->astClassifierTable[i].ulSFID == ulSFID))
return i;
}
-- 
1.9.3

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


[PATCH 24/27] Staging: bcm: Shortened lines in CopyIpAddrToClassifier()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 72 
 1 file changed, 52 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 7fb8568..5bd6e1c 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -136,7 +136,8 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule 
*pstClassifierEntry,
nSizeOfIPAddressInBytes = IPV6_ADDRESS_SIZEINBYTES;
 
/* Destination Ip Address */
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Ip 
Address Range Length:0x%X ", u8IpAddressLen);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Ip Address Range Length:0x%X ", u8IpAddressLen);
if ((bIpVersion6 ? (IPV6_ADDRESS_SIZEINBYTES * MAX_IP_RANGE_LENGTH * 2) 
:
(TOTAL_MASKED_ADDRESS_IN_BYTES)) >= u8IpAddressLen) {
 
@@ -152,39 +153,61 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule 
*pstClassifierEntry,
 * (nSizeOfIPAddressInBytes for address and 
nSizeOfIPAddressInBytes for mask)
 */
if (eIpAddrContext == eDestIpAddress) {
-   pstClassifierEntry->ucIPDestinationAddressLength = 
u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
+   pstClassifierEntry->ucIPDestinationAddressLength =
+   u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
if (bIpVersion6) {
-   ptrClassifierIpAddress = 
st_dest_ip->ucIpv6Address;
-   ptrClassifierIpMask = st_dest_ip->ucIpv6Mask;
+   ptrClassifierIpAddress =
+   st_dest_ip->ucIpv6Address;
+   ptrClassifierIpMask =
+   st_dest_ip->ucIpv6Mask;
} else {
-   ptrClassifierIpAddress = 
st_dest_ip->ucIpv4Address;
-   ptrClassifierIpMask = st_dest_ip->ucIpv4Mask;
+   ptrClassifierIpAddress =
+   st_dest_ip->ucIpv4Address;
+   ptrClassifierIpMask =
+   st_dest_ip->ucIpv4Mask;
}
} else if (eIpAddrContext == eSrcIpAddress) {
-   pstClassifierEntry->ucIPSourceAddressLength = 
u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
+   pstClassifierEntry->ucIPSourceAddressLength =
+   u8IpAddressLen/(nSizeOfIPAddressInBytes * 2);
if (bIpVersion6) {
-   ptrClassifierIpAddress = 
st_src_ip->ucIpv6Address;
+   ptrClassifierIpAddress =
+   st_src_ip->ucIpv6Address;
ptrClassifierIpMask = st_src_ip->ucIpv6Mask;
} else {
-   ptrClassifierIpAddress = 
st_src_ip->ucIpv4Address;
+   ptrClassifierIpAddress =
+   st_src_ip->ucIpv4Address;
ptrClassifierIpMask = st_src_ip->ucIpv4Mask;
}
}
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Address Length:0x%X\n", 
pstClassifierEntry->ucIPDestinationAddressLength);
-   while ((u8IpAddressLen >= nSizeOfIPAddressInBytes) && (i < 
MAX_IP_RANGE_LENGTH)) {
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Address Length:0x%X\n",
+   
pstClassifierEntry->ucIPDestinationAddressLength);
+   while ((u8IpAddressLen >= nSizeOfIPAddressInBytes)
+   && (i < MAX_IP_RANGE_LENGTH)) {
memcpy(ptrClassifierIpAddress +
(i * nSizeOfIPAddressInBytes),
-   
(pu8IpAddressMaskSrc+(i*nSizeOfIPAddressInBytes*2)),
+   (pu8IpAddressMaskSrc
+   + (i * nSizeOfIPAddressInBytes * 2)),
nSizeOfIPAddressInBytes);
 
if (!bIpVersion6) {
if (eIpAddrContext == eSrcIpAddress) {
-   st_src_ip->ulIpv4Addr[i] = 
ntohl(st_src_ip->ulIpv4Addr[i]);
-   BCM_DEBUG_PRINT(Adapter, 
DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "Src Ip Address:0x%luX ",
+   st_src_ip->ulIpv4Addr[i] =
+   ntohl(st_src_ip->ulIpv4Addr[i]);
+   BCM_DEBUG_PRINT

[PATCH 09/27] Staging: bcm: Shortened lines in RestoreCmControlResponseMessage()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 102 +++
 1 file changed, 73 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 2743d16..3b65990 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1406,40 +1406,63 @@ ULONG StoreCmControlResponseMessage(struct 
bcm_mini_adapter *Adapter, PVOID pvBu
 }
 
 static inline struct bcm_add_indication_alt
-*RestoreCmControlResponseMessage(register struct bcm_mini_adapter *Adapter, 
register PVOID pvBuffer)
+*RestoreCmControlResponseMessage(register struct bcm_mini_adapter *Adapter,
+   register PVOID pvBuffer)
 {
ULONG ulStatus = 0;
struct bcm_add_indication *pstAddIndication = NULL;
struct bcm_add_indication_alt *pstAddIndicationDest = NULL;
 
pstAddIndication = pvBuffer;
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"=>");
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "=>");
if ((pstAddIndication->u8Type == DSD_REQ) ||
(pstAddIndication->u8Type == DSD_RSP) ||
(pstAddIndication->u8Type == DSD_ACK))
return pvBuffer;
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"Inside RestoreCmControlResponseMessage ");
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "Inside RestoreCmControlResponseMessage ");
/*
 * Need to Allocate memory to contain the SUPER Large structures
 * Our driver can't create these structures on Stack :(
 */
-   pstAddIndicationDest = kmalloc(sizeof(struct bcm_add_indication_alt), 
GFP_KERNEL);
+   pstAddIndicationDest = kmalloc(sizeof(struct bcm_add_indication_alt),
+   GFP_KERNEL);
 
if (pstAddIndicationDest) {
-   memset(pstAddIndicationDest, 0, sizeof(struct 
bcm_add_indication_alt));
+   memset(pstAddIndicationDest, 0,
+   sizeof(struct bcm_add_indication_alt));
} else {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Failed to allocate memory for SF Add Indication Structure ");
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG,
+   DBG_LVL_ALL,
+   "Failed to allocate memory for SF Add 
Indication Structure ");
return NULL;
}
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"AddIndication-u8Type : 0x%X", pstAddIndication->u8Type);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"AddIndication-u8Direction : 0x%X", pstAddIndication->eConnectionDir);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"AddIndication-u8TID : 0x%X", ntohs(pstAddIndication->u16TID));
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"AddIndication-u8CID : 0x%X", ntohs(pstAddIndication->u16CID));
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"AddIndication-u16VCID : 0x%X", ntohs(pstAddIndication->u16VCID));
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"AddIndication-autorized set loc : %p", pstAddIndication->psfAuthorizedSet);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"AddIndication-admitted set loc : %p", pstAddIndication->psfAdmittedSet);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"AddIndication-Active set loc : %p", pstAddIndication->psfActiveSet);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "AddIndication-u8Type : 0x%X",
+   pstAddIndication->u8Type);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "AddIndication-u8Direction : 0x%X",
+   pstAddIndication->eConnectionDir);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "AddIndication-u8TID : 0x%X",
+   ntohs(pstAddIndication->u16TID));
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "AddIndication-u8CID : 0x%X",
+   ntohs(pstAddIndication->u16CID));
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "AddIndication-u16VCID : 0x%X",
+   ntohs(pstAddIndication->u16VCID));
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "AddIndication-autorized set loc : %p",
+   pstAddIndication->psfAuthorizedSet);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "AddIndication-admitted set loc : %p",
+   

[PATCH 02/27] Staging: bcm: Shortened lines in OverrideServiceFlowParams()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 27 +++
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 6793e25..16262bb 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1853,7 +1853,8 @@ int get_dsx_sf_data_to_application(struct 
bcm_mini_adapter *Adapter, UINT uiSFId
return STATUS_SUCCESS;
 }
 
-VOID OverrideServiceFlowParams(struct bcm_mini_adapter *Adapter, PUINT 
puiBuffer)
+VOID OverrideServiceFlowParams(struct bcm_mini_adapter *Adapter,
+   PUINT puiBuffer)
 {
B_UINT32 u32NumofSFsinMsg = ntohl(*(puiBuffer + 1));
struct bcm_stim_sfhostnotify *pHostInfo = NULL;
@@ -1861,7 +1862,8 @@ VOID OverrideServiceFlowParams(struct bcm_mini_adapter 
*Adapter, PUINT puiBuffer
ULONG ulSFID = 0;
 
puiBuffer += 2;
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"u32NumofSFsinMsg: 0x%x\n", u32NumofSFsinMsg);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "u32NumofSFsinMsg: 0x%x\n", u32NumofSFsinMsg);
 
while (u32NumofSFsinMsg != 0 && u32NumofSFsinMsg < NO_OF_QUEUES) {
u32NumofSFsinMsg--;
@@ -1870,15 +1872,21 @@ VOID OverrideServiceFlowParams(struct bcm_mini_adapter 
*Adapter, PUINT puiBuffer
 
ulSFID = ntohl(pHostInfo->SFID);
uiSearchRuleIndex = SearchSfid(Adapter, ulSFID);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "SFID: 0x%lx\n", ulSFID);
-
-   if (uiSearchRuleIndex >= NO_OF_QUEUES || uiSearchRuleIndex == 
HiPriority) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "The SFID <%lx> doesn't exist in host entry or is Invalid\n", 
ulSFID);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "SFID: 0x%lx\n", ulSFID);
+
+   if (uiSearchRuleIndex >= NO_OF_QUEUES
+   || uiSearchRuleIndex == HiPriority) {
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG,
+   DBG_LVL_ALL,
+   "The SFID <%lx> doesn't exist in host 
entry or is Invalid\n",
+   ulSFID);
continue;
}
 
if (pHostInfo->RetainSF == false) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Going to Delete SF");
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG,
+   DBG_LVL_ALL, "Going to Delete SF");
deleteSFBySfid(Adapter, uiSearchRuleIndex);
} else {
struct bcm_packet_info *packinfo =
@@ -1888,7 +1896,10 @@ VOID OverrideServiceFlowParams(struct bcm_mini_adapter 
*Adapter, PUINT puiBuffer
packinfo->usCID = ntohs(pHostInfo->newCID);
packinfo->bActive = false;
 
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "pHostInfo->QoSParamSet: 0x%x\n", pHostInfo->QoSParamSet);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG,
+   DBG_LVL_ALL,
+   "pHostInfo->QoSParamSet: 0x%x\n",
+   pHostInfo->QoSParamSet);
 
if (pHostInfo->QoSParamSet & 0x1)
packinfo->bAuthorizedSet = TRUE;
-- 
1.9.3

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


[PATCH 05/27] Staging: bcm: Simplified by using variables

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 59a3eb9..181c4e9 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1923,13 +1923,16 @@ static void restore_endianess_of_pstClassifierEntry(
enum bcm_ipaddr_context eIpAddrContext)
 {
int i;
+   union u_ip_address *stSrc  = &pstClassifierEntry->stSrcIpAddress;
+   union u_ip_address *stDest = &pstClassifierEntry->stDestIpAddress;
+
for (i = 0; i < MAX_IP_RANGE_LENGTH * 4; i++) {
if (eIpAddrContext == eSrcIpAddress) {
-   pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[i] = 
ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[i]);
-   pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[i] = 
ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[i]);
+   stSrc->ulIpv6Addr[i] = ntohl(stSrc->ulIpv6Addr[i]);
+   stSrc->ulIpv6Mask[i] = ntohl(stSrc->ulIpv6Mask[i]);
} else if (eIpAddrContext == eDestIpAddress) {
-   pstClassifierEntry->stDestIpAddress.ulIpv6Addr[i] = 
ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Addr[i]);
-   pstClassifierEntry->stDestIpAddress.ulIpv6Mask[i] = 
ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Mask[i]);
+   stDest->ulIpv6Addr[i] = ntohl(stDest->ulIpv6Addr[i]);
+   stDest->ulIpv6Mask[i] = ntohl(stDest->ulIpv6Mask[i]);
}
}
 }
-- 
1.9.3

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


[PATCH 07/27] Staging: bcm: Shortenend lines in GetNextTargetBufferLocation()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 3f29dea..9fea9a8 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1531,12 +1531,14 @@ ULONG SetUpTargetDsxBuffers(struct bcm_mini_adapter 
*Adapter)
return 1;
 }
 
-static ULONG GetNextTargetBufferLocation(struct bcm_mini_adapter *Adapter, 
B_UINT16 tid)
+static ULONG GetNextTargetBufferLocation(struct bcm_mini_adapter *Adapter,
+   B_UINT16 tid)
 {
ULONG dsx_buf;
ULONG idx, max_try;
 
-   if ((Adapter->ulTotalTargetBuffersAvailable == 0) || 
(Adapter->ulFreeTargetBufferCnt == 0)) {
+   if ((Adapter->ulTotalTargetBuffersAvailable == 0)
+   || (Adapter->ulFreeTargetBufferCnt == 0)) {
ClearTargetDSXBuffer(Adapter, tid, false);
return 0;
}
@@ -1549,7 +1551,9 @@ static ULONG GetNextTargetBufferLocation(struct 
bcm_mini_adapter *Adapter, B_UIN
}
 
if (max_try == 0) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "\n 
GetNextTargetBufferLocation : Error No Free Target DSX Buffers FreeCnt : %lx ", 
Adapter->ulFreeTargetBufferCnt);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
+   "\n GetNextTargetBufferLocation : Error No Free 
Target DSX Buffers FreeCnt : %lx ",
+   Adapter->ulFreeTargetBufferCnt);
ClearTargetDSXBuffer(Adapter, tid, false);
return 0;
}
@@ -1560,7 +1564,9 @@ static ULONG GetNextTargetBufferLocation(struct 
bcm_mini_adapter *Adapter, B_UIN
Adapter->ulFreeTargetBufferCnt--;
idx = (idx+1)%Adapter->ulTotalTargetBuffersAvailable;
Adapter->ulCurrentTargetBuffer = idx;
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, 
"GetNextTargetBufferLocation :Returning address %lx tid %d\n", dsx_buf, tid);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
+   "GetNextTargetBufferLocation :Returning address %lx tid 
%d\n",
+   dsx_buf, tid);
 
return dsx_buf;
 }
-- 
1.9.3

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


[PATCH 03/27] Staging: bcm: Shortened lines in get_dsx_sf_data_to_application()

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 21 ++---
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 16262bb..3d8c049 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1831,22 +1831,29 @@ bool CmControlResponseMessage(struct bcm_mini_adapter 
*Adapter,  /* = NO_OF_QUEUES) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "SFID %d not present in queue !!!", uiSFId);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "SFID %d not present in queue !!!", uiSFId);
return -EINVAL;
}
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, 
"status =%d", status);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL,
+   "status =%d", status);
psSfInfo = &Adapter->PackInfo[status];
-   if (psSfInfo->pstSFIndication && copy_to_user(user_buffer,
-   
psSfInfo->pstSFIndication, sizeof(struct bcm_add_indication_alt))) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "copy to user 
failed SFID %d, present in queue !!!", uiSFId);
+   if (psSfInfo->pstSFIndication
+   && copy_to_user(user_buffer, psSfInfo->pstSFIndication,
+   sizeof(struct bcm_add_indication_alt))) {
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,
+   "copy to user failed SFID %d, present in queue 
!!!",
+   uiSFId);
status = -EFAULT;
return status;
}
-- 
1.9.3

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


[PATCH 04/27] Staging: bcm: Outsourced restoring of endianess for ip adresses

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 32 +++-
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 3d8c049..59a3eb9 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -14,6 +14,9 @@ enum E_CLASSIFIER_ACTION {
 };
 
 static ULONG GetNextTargetBufferLocation(struct bcm_mini_adapter *Adapter, 
B_UINT16 tid);
+static void restore_endianess_of_pstClassifierEntry(
+   struct bcm_classifier_rule *pstClassifierEntry,
+   enum bcm_ipaddr_context eIpAddrContext);
 
 /
  * Function - SearchSfid
@@ -200,15 +203,10 @@ CopyIpAddrToClassifier(struct bcm_classifier_rule 
*pstClassifierEntry,
}
if (bIpVersion6) {
/* Restore EndianNess of Struct */
-   for (i = 0; i < MAX_IP_RANGE_LENGTH * 4; i++) {
-   if (eIpAddrContext == eSrcIpAddress) {
-   
pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[i] = 
ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[i]);
-   
pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[i] = 
ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[i]);
-   } else if (eIpAddrContext == eDestIpAddress) {
-   
pstClassifierEntry->stDestIpAddress.ulIpv6Addr[i] = 
ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Addr[i]);
-   
pstClassifierEntry->stDestIpAddress.ulIpv6Mask[i] = 
ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Mask[i]);
-   }
-   }
+   restore_endianess_of_pstClassifierEntry(
+   pstClassifierEntry,
+   eIpAddrContext
+   );
}
}
 }
@@ -1919,3 +1917,19 @@ VOID OverrideServiceFlowParams(struct bcm_mini_adapter 
*Adapter,
}
}
 }
+
+static void restore_endianess_of_pstClassifierEntry(
+   struct bcm_classifier_rule *pstClassifierEntry,
+   enum bcm_ipaddr_context eIpAddrContext)
+{
+   int i;
+   for (i = 0; i < MAX_IP_RANGE_LENGTH * 4; i++) {
+   if (eIpAddrContext == eSrcIpAddress) {
+   pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[i] = 
ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Addr[i]);
+   pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[i] = 
ntohl(pstClassifierEntry->stSrcIpAddress.ulIpv6Mask[i]);
+   } else if (eIpAddrContext == eDestIpAddress) {
+   pstClassifierEntry->stDestIpAddress.ulIpv6Addr[i] = 
ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Addr[i]);
+   pstClassifierEntry->stDestIpAddress.ulIpv6Mask[i] = 
ntohl(pstClassifierEntry->stDestIpAddress.ulIpv6Mask[i]);
+   }
+   }
+}
-- 
1.9.3

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


[PATCH 06/27] Staging: bcm: Shortened line

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 181c4e9..3f29dea 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1571,7 +1571,8 @@ int AllocAdapterDsxBuffer(struct bcm_mini_adapter 
*Adapter)
 * Need to Allocate memory to contain the SUPER Large structures
 * Our driver can't create these structures on Stack
 */
-   Adapter->caDsxReqResp = kmalloc(sizeof(struct 
bcm_add_indication_alt)+LEADER_SIZE, GFP_KERNEL);
+   Adapter->caDsxReqResp = kmalloc(sizeof(struct bcm_add_indication_alt)
+   + LEADER_SIZE, GFP_KERNEL);
if (!Adapter->caDsxReqResp)
return -ENOMEM;
 
-- 
1.9.3

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


[PATCH 00/27] Cleanup for drivers/staging/bcm/CmHost.c

2014-05-23 Thread Matthias Beyer
Hi,

I have some cleanup patches for the

drivers/staging/bcm/CmHost.c

file. I hope you like them. I compiled every single one of them, but I'm not
able to test them as I do not have the appropriate hardware.

If you want me to squash/split single patches, let me know.

Regards,
Matthias Beyer

Matthias Beyer (27):
  Staging: bcm: Shortened code by using variable
  Staging: bcm: Shortened lines in OverrideServiceFlowParams()
  Staging: bcm: Shortened lines in get_dsx_sf_data_to_application()
  Staging: bcm: Outsourced restoring of endianess for ip adresses
  Staging: bcm: Simplified by using variables
  Staging: bcm: Shortened line
  Staging: bcm: Shortenend lines in GetNextTargetBufferLocation()
  Staging: bcm: Shortened lines in SetupTargetDsxBuffers()
  Staging: bcm: Shortened lines in RestoreCmControlResponseMessage()
  Staging: bcm: Shortened lines in StoreCmControlResponseMessage()
  Staging: bcm: Shortened lines in StoreSFParam()
  Staging: bcm: Shortened lines in RestoreSFParam()
  Staging: bcm: Replaced long member-accessing
  Staging: bcm: Shortened some lines in DumpCmControlPacker()
  Staging: bcm: Outsourced PHS rule applying
  Staging: bcm: Replaced struct member accessing with variable
  Staging: bcm: Shortened lines in CopyToAdapter()
  Staging: bcm: Shortened line in DeleteAllClassifiersForSF()
  Staging: bcm: Shortened lines in DeleteClassifierRuleFromSF()
  Staging: bcm: Replaced member accessing with variable
  Staging: bcm: Shortened lines in CopyClassifierRuleToSF()
  Staging: bcm: Shortened lines and replaced member accessing in
CopyIpAddrToClassifier()
  Staging: bcm: Replaced member accessing by variable
  Staging: bcm: Shortened lines in CopyIpAddrToClassifier()
  Staging: bcm: Shortened lines in deleteSFBySfid()
  Staging: bcm: Shortened lines in SearchClsid()
  Staging: bcm: Shortened prototype for GetNextTargetBufferLocation()

 drivers/staging/bcm/CmHost.c | 1181 +++---
 1 file changed, 767 insertions(+), 414 deletions(-)

-- 
1.9.3

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


[PATCH 01/27] Staging: bcm: Shortened code by using variable

2014-05-23 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/CmHost.c | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 4564c63..6793e25 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1881,19 +1881,22 @@ VOID OverrideServiceFlowParams(struct bcm_mini_adapter 
*Adapter, PUINT puiBuffer
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "Going to Delete SF");
deleteSFBySfid(Adapter, uiSearchRuleIndex);
} else {
-   Adapter->PackInfo[uiSearchRuleIndex].usVCID_Value = 
ntohs(pHostInfo->VCID);
-   Adapter->PackInfo[uiSearchRuleIndex].usCID = 
ntohs(pHostInfo->newCID);
-   Adapter->PackInfo[uiSearchRuleIndex].bActive = false;
+   struct bcm_packet_info *packinfo =
+   &Adapter->PackInfo[uiSearchRuleIndex];
+
+   packinfo->usVCID_Value = ntohs(pHostInfo->VCID);
+   packinfo->usCID = ntohs(pHostInfo->newCID);
+   packinfo->bActive = false;
 
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CONN_MSG, 
DBG_LVL_ALL, "pHostInfo->QoSParamSet: 0x%x\n", pHostInfo->QoSParamSet);
 
if (pHostInfo->QoSParamSet & 0x1)
-   
Adapter->PackInfo[uiSearchRuleIndex].bAuthorizedSet = TRUE;
+   packinfo->bAuthorizedSet = TRUE;
if (pHostInfo->QoSParamSet & 0x2)
-   
Adapter->PackInfo[uiSearchRuleIndex].bAdmittedSet = TRUE;
+   packinfo->bAdmittedSet = TRUE;
if (pHostInfo->QoSParamSet & 0x4) {
-   Adapter->PackInfo[uiSearchRuleIndex].bActiveSet 
= TRUE;
-   Adapter->PackInfo[uiSearchRuleIndex].bActive = 
TRUE;
+   packinfo->bActiveSet = TRUE;
+   packinfo->bActive = TRUE;
}
}
}
-- 
1.9.3

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


Re: [PATCH] staging: slicoss: clean up use of dev_err

2014-05-23 Thread David Matlack
Greg, this is the other patch (of two) that got dropped.

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


Re: [PATCH] staging: slicoss: remove private netdev list

2014-05-23 Thread David Matlack
Greg, this is one of the two patches that got dropped. It should apply cleanly
in any order with respect to all my other patches.

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


Re: [PATCH] staging: slicoss: fix use-after-free in slic_entry_probe

2014-05-23 Thread David Matlack
On Fri, May 23, 2014 at 4:14 AM, Greg KH  wrote:
> I think I've already applied all of these, if not, please let me know.
>
> Also, you forgot to number these patches to let me know what order to
> apply them in :(
>
> thanks,
>
> greg k-h

Thanks Greg. Sorry for the confusion. I resent these patches without numbers
because in retrospect, they were all independent changes and could be applied
in any order. In retro-retrospect, that probably just piled onto the confusion
:)

Looking at the emails I got from you about staging-next, _almost_ all the
patches were applied. I reply to the ones directly that were dropped.

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


[RESEND PATCH] staging: ion: WARN when the handle kmap_cnt is going to wrap around

2014-05-23 Thread Mitchel Humpherys
There are certain client bugs (double unmap, for example) that can cause
the handle->kmap_cnt (an unsigned int) to wrap around from zero. This
causes problems when the handle is destroyed because we have:

while (handle->kmap_cnt)
ion_handle_kmap_put(handle);

which takes a long time to complete when kmap_cnt starts at ~0 and can
result in a watchdog timeout.

WARN and bail when kmap_cnt is about to wrap around from zero.

Signed-off-by: Mitchel Humpherys 
Acked-by: Colin Cross 
---
Resending since I missed a few folks on the original. Also retaining
Colin's Acked-by.
---
 drivers/staging/android/ion/ion.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/android/ion/ion.c 
b/drivers/staging/android/ion/ion.c
index 3d5bf14722..f55f61a4cc 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -626,6 +626,10 @@ static void ion_handle_kmap_put(struct ion_handle *handle)
 {
struct ion_buffer *buffer = handle->buffer;
 
+   if (!handle->kmap_cnt) {
+   WARN(1, "%s: Double unmap detected! bailing...\n", __func__);
+   return;
+   }
handle->kmap_cnt--;
if (!handle->kmap_cnt)
ion_buffer_kmap_put(buffer);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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


[PATCH] staging/olpc_dcon: fix checkpatch warnings

2014-05-23 Thread Nicolas Joseph
WARNING: Missing a blank line after declarations

Signed-off-by: Nicolas Joseph 
---
 drivers/staging/olpc_dcon/olpc_dcon.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c 
b/drivers/staging/olpc_dcon/olpc_dcon.c
index 26b4ec5..eb83b28 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -210,6 +210,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)

if (sleep) {
u8 pm = 0;
+
x = olpc_ec_cmd(EC_DCON_POWER_MODE, &pm, 1, NULL, 0);
if (x)
pr_warn("unable to force dcon to power down: %d!\n", x);
@@ -240,6 +241,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
 static void dcon_load_holdoff(struct dcon_priv *dcon)
 {
struct timespec delta_t, now;
+
while (1) {
getnstimeofday(&now);
delta_t = timespec_sub(now, dcon->load_time);
@@ -399,14 +401,15 @@ static ssize_t dcon_mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
struct dcon_priv *dcon = dev_get_drvdata(dev);
+
return sprintf(buf, "%4.4X\n", dcon->disp_mode);
 }

 static ssize_t dcon_sleep_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
-
struct dcon_priv *dcon = dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", dcon->asleep);
 }

@@ -414,6 +417,7 @@ static ssize_t dcon_freeze_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
struct dcon_priv *dcon = dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", dcon->curr_src == DCON_SOURCE_DCON ? 1 : 0);
 }

@@ -421,6 +425,7 @@ static ssize_t dcon_mono_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
struct dcon_priv *dcon = dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", dcon->mono);
 }

@@ -534,6 +539,7 @@ static int dcon_bl_update(struct backlight_device *dev)
 static int dcon_bl_get(struct backlight_device *dev)
 {
struct dcon_priv *dcon = bl_get_data(dev);
+
return dcon->bl_val;
 }

--
2.0.0.rc4

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


Re: [PATCH] staging/olpc_dcon: fix checkpatch warnings

2014-05-23 Thread Nicolas Joseph
On 23/05/2014 14:42, Greg Kroah-Hartman wrote:
> All of the tabs were stripped out and replaced with spaces, making it
> impossible to apply this patch :(
> 
> Can you please fix up your email client and resend?

Sorry, I rebase and resend it.

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


[PATCH] Staging: rtl8192u: Remove old WIRELESS_EXT support

2014-05-23 Thread Joel Pelaez Jorge
Remove support for building against ancient WIRELESS_EXT versions,
only leaving support for the current version: 22

Signed-off-by: Joel Pelaez Jorge 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h| 14 -
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c |  5 +
 drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 24 +--
 drivers/staging/rtl8192u/r8192U_core.c|  6 +-
 drivers/staging/rtl8192u/r8192U_wx.c  | 20 +--
 5 files changed, 4 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h 
b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index cac2056..3b40b61 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -354,12 +354,10 @@ enum  _ReasonCode{
 #define ieee80211_wx_get_scan  ieee80211_wx_get_scan_rsl
 #define ieee80211_wx_set_encodeieee80211_wx_set_encode_rsl
 #define ieee80211_wx_get_encodeieee80211_wx_get_encode_rsl
-#if WIRELESS_EXT >= 18
 #define ieee80211_wx_set_mlme  ieee80211_wx_set_mlme_rsl
 #define ieee80211_wx_set_auth  ieee80211_wx_set_auth_rsl
 #define ieee80211_wx_set_encode_extieee80211_wx_set_encode_ext_rsl
 #define ieee80211_wx_get_encode_extieee80211_wx_get_encode_ext_rsl
-#endif
 
 
 typedef struct ieee_param {
@@ -392,16 +390,6 @@ typedef struct ieee_param {
 }ieee_param;
 
 
-#if WIRELESS_EXT < 17
-#define IW_QUAL_QUAL_INVALID   0x10
-#define IW_QUAL_LEVEL_INVALID  0x20
-#define IW_QUAL_NOISE_INVALID  0x40
-#define IW_QUAL_QUAL_UPDATED   0x1
-#define IW_QUAL_LEVEL_UPDATED  0x2
-#define IW_QUAL_NOISE_UPDATED  0x4
-#endif
-
-
 // linux under 2.6.9 release may not support it, so modify it for common use
 #define MSECS(t) msecs_to_jiffies(t)
 #define msleep_interruptible_rsl  msleep_interruptible
@@ -2398,7 +2386,6 @@ extern int ieee80211_wx_set_encode(struct 
ieee80211_device *ieee,
 extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *key);
-#if WIRELESS_EXT >= 18
 extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra);
@@ -2411,7 +2398,6 @@ extern int ieee80211_wx_set_auth(struct ieee80211_device 
*ieee,
 extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *extra);
-#endif
 extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, 
size_t len);
 
 /* ieee80211_softmac.c */
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 92707fb..89389c4 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -950,7 +950,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
 
//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len);
 #ifdef NOT_YET
-#if WIRELESS_EXT > 15
/* Put this code here so that we avoid duplicating it in all
 * Rx paths. - Jean II */
 #ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */
@@ -964,18 +963,16 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
wireless_spy_update(dev, hdr->addr2, &wstats);
}
 #endif /* IW_WIRELESS_SPY */
-#endif /* WIRELESS_EXT > 15 */
hostap_update_rx_stats(local->ap, hdr, rx_stats);
 #endif
 
-#if WIRELESS_EXT > 15
if (ieee->iw_mode == IW_MODE_MONITOR) {
ieee80211_monitor_rx(ieee, skb, rx_stats);
stats->rx_packets++;
stats->rx_bytes += skb->len;
return 1;
}
-#endif
+
if (ieee->host_decrypt) {
int idx = 0;
if (skb->len >= hdrlen + 3)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index 38f124d..d43e4a7 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -194,7 +194,7 @@ static inline char *rtl819x_translate_scan(struct 
ieee80211_device *ieee,
iwe.u.data.length = p - custom;
if (iwe.u.data.length)
start = iwe_stream_add_point(info, start, stop, &iwe, custom);
-#if (WIRELESS_EXT < 18)
+
if (ieee->wpa_enabled && network->wpa_ie_len){
char buf[MAX_WPA_IE_LEN * 2 + 30];
//  printk("WPA IE\n");
@@ -224,26 +224,6 @@ static inline char *rtl819x_translate_scan(struct 
ieee80211_device *ieee,
iwe.u.data.length = strlen(buf);
start = iwe_stream_add_point(info, start, stop, &iwe, buf);

[PATCH] Staging: xgifb: Fixed a code-style warning

2014-05-23 Thread Chaitanya Hazarey
Added a blank line after declarations to fix the following warning issued by 
checkpatch.pl:

drivers/staging/xgifb/vb_init.c:800: WARNING: Missing a blank line after 
declarations

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/xgifb/vb_setmode.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/xgifb/vb_setmode.c 
b/drivers/staging/xgifb/vb_setmode.c
index c638c8f..8795e17 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -5462,6 +5462,7 @@ unsigned char XGISetModeNew(struct xgifb_video_info 
*xgifb_info,
unsigned short ModeIdIndex;
struct vb_device_info VBINF;
struct vb_device_info *pVBInfo = &VBINF;
+
pVBInfo->IF_DEF_LVDS = 0;
 
if (HwDeviceExtension->jChipType >= XG20)
-- 
1.7.9.5

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


RE: [PATCH net-next] Add hash value into RNDIS Per-packet info

2014-05-23 Thread Haiyang Zhang


> -Original Message-
> From: David Miller [mailto:da...@davemloft.net]
> Sent: Friday, May 23, 2014 2:50 PM
> To: Haiyang Zhang
> Cc: net...@vger.kernel.org; KY Srinivasan; o...@aepfle.de;
> jasow...@redhat.com; linux-ker...@vger.kernel.org; driverdev-
> de...@linuxdriverproject.org
> Subject: Re: [PATCH net-next] Add hash value into RNDIS Per-packet info
> 
> From: Haiyang Zhang 
> Date: Wed, 21 May 2014 12:55:39 -0700
> 
> > It passes the hash value as the RNDIS Per-packet info to the Hyper-V
> host,
> > so that the send completion notices can be spread across multiple
> channels.
> > MS-TFS: 140273
> >
> > Signed-off-by: Haiyang Zhang 
> 
> Applied, but please craft your Subject lines correctly in the future.
> 
> You did not specify a subsystem prefix, which in this case should
> have been something like "hyperv: "
> 
> Otherwise people scanning the commit log headers have no idea where
> your changes might be taking place.
> 
> I fixed it up this time for you.

Thank you for fixing it! I will do this in the future.

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


Re: [PATCH] staging: ion: WARN when the handle kmap_cnt is going to wrap around

2014-05-23 Thread Greg Kroah-Hartman
On Fri, May 23, 2014 at 11:34:59AM -0700, Mitchel Humpherys wrote:
> ++greg-kh and de...@driverdev.osuosl.org
> (my bad for missing you the first time around)

What can I do with this?  Please send patches to me in a format that I
can actually apply them in...

thanks,

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


Re: [PATCH 3/8] drivers/staging: Remove useless return variables

2014-05-23 Thread Greg Kroah-Hartman
On Tue, May 20, 2014 at 12:33:43PM +0200, Peter Senna Tschudin wrote:
> This patch remove variables that are initialized with a constant,
> are never updated, and are only used as parameter of return.
> Return the constant instead of using a variable.
> 
> Verified by compilation only.
> 
> The coccinelle script that find and fixes this issue is:
> // 
> @@
> type T;
> constant C;
> identifier ret;
> @@
> - T ret = C;
> ... when != ret
> - return ret;
> + return C;
> // 
> 
> Signed-off-by: Peter Senna Tschudin 

This patch no longer applies to my tree, can you refresh it and resend?

thanks,

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


Greg caught up on staging patches

2014-05-23 Thread Greg KH
Hi all,

Thanks to a trans-pacific flight, I think I'm now caught up on all
drivers/staging/* patches that were sent to me before 10 hours ago.  If
you have sent something that I have not responded to, please consider it
lost and please resend, after making sure it still applies on top of my
latest tree.

thanks,

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


Re: [PATCH] staging: wlags49_h2: fix sparse warning "should it be static"

2014-05-23 Thread Greg KH
On Wed, May 07, 2014 at 06:31:48PM +0200, Luis Ortega wrote:
> Fixes the following warning:
> drivers/staging/wlags49_h2/sta_h2.c:4471:10: warning: symbol 'fw_image' was 
> not declared. Should it be static?
> 
> Signed-off-by: Luis Ortega 
> ---
>  drivers/staging/wlags49_h2/sta_h2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/wlags49_h2/sta_h2.c 
> b/drivers/staging/wlags49_h2/sta_h2.c
> index 0ba8def..2838faa 100644
> --- a/drivers/staging/wlags49_h2/sta_h2.c
> +++ b/drivers/staging/wlags49_h2/sta_h2.c
> @@ -4468,7 +4468,7 @@ static const CFG_RANGE20_STRCT fw_image_infocompat[] = {
>   { , , , , { { , ,  } } }/* endsentinel 
> */
>  };
> 
> -memimage fw_image = {
> +static memimage fw_image = {
>   "FUPU7D37dhfwci\001C",  /* signature, , 
> C/Bin type */
>   (CFG_PROG_STRCT *) fw_image_code,
>   0x000F368E,

ALWAYS test build your patches.  This patch breaks the build :(

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


Re: [PATCH net-next] Add hash value into RNDIS Per-packet info

2014-05-23 Thread David Miller
From: Haiyang Zhang 
Date: Wed, 21 May 2014 12:55:39 -0700

> It passes the hash value as the RNDIS Per-packet info to the Hyper-V host,
> so that the send completion notices can be spread across multiple channels.
> MS-TFS: 140273
> 
> Signed-off-by: Haiyang Zhang 

Applied, but please craft your Subject lines correctly in the future.

You did not specify a subsystem prefix, which in this case should
have been something like "hyperv: "

Otherwise people scanning the commit log headers have no idea where
your changes might be taking place.

I fixed it up this time for you.

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


Re: [PATCH] Staging: rtl8192u: Remove old WIRELESS_EXT support

2014-05-23 Thread Greg Kroah-Hartman
On Sat, May 17, 2014 at 12:05:01PM -0500, Joel Pelaez Jorge wrote:
> Remove support for building against ancient WIRELESS_EXT versions,
> only leaving support for the current version: 22
> 
> Signed-off-by: Joel Pelaez Jorge 
> ---
>  drivers/staging/rtl8192u/ieee80211/ieee80211.h| 14 -
>  drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c |  5 +--
>  drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 38 
> ++-
>  drivers/staging/rtl8192u/r8192U_core.c|  6 +---
>  drivers/staging/rtl8192u/r8192U_wx.c  | 20 +---
>  5 files changed, 5 insertions(+), 78 deletions(-)

This doesn't apply to my tree for some reason, can you please refresh it
against the staging-next branch of the staging.git tree on
git.kernel.org and resend?

thanks,

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


Re: [PATCH] staging/olpc_dcon: fix checkpatch warnings

2014-05-23 Thread Greg Kroah-Hartman
On Tue, May 06, 2014 at 06:32:15PM +0200, Nicolas Joseph wrote:
> WARNING: Missing a blank line after declarations
> 
> Signed-off-by: Nicolas Joseph 
> Acked-by: Jens Frederich 
> ---
>  drivers/staging/olpc_dcon/olpc_dcon.c | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c 
> b/drivers/staging/olpc_dcon/olpc_dcon.c
> index 26b4ec5..eb83b28 100644
> --- a/drivers/staging/olpc_dcon/olpc_dcon.c
> +++ b/drivers/staging/olpc_dcon/olpc_dcon.c
> @@ -210,6 +210,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
>  
> if (sleep) {
> u8 pm = 0;
> +
> x = olpc_ec_cmd(EC_DCON_POWER_MODE, &pm, 1, NULL, 0);
> if (x)
> pr_warn("unable to force dcon to power down: %d!\n", x);

All of the tabs were stripped out and replaced with spaces, making it
impossible to apply this patch :(

Can you please fix up your email client and resend?

thanks,

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


Re: [PATCH v2] staging: rtl8821ae: mark pci_mem_start (and _end) as __iomem

2014-05-23 Thread Greg KH
On Sun, May 04, 2014 at 02:22:19PM +0200, Martin Kepplinger wrote:
> Shared addresses can be marked as such.
> 
> Signed-off-by: Martin Kepplinger 
> ---
> I guess that's what you meant. Thanks for your feedback!

Yes, that is correct, but someone beat you to this patch, sorry :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: lustre: lnet: klnds: Fix coding style in socklnd.c

2014-05-23 Thread Greg KH
On Tue, May 20, 2014 at 12:03:23AM +0100, Masaru Nomura wrote:
> Remove prohibited space between function name and
> open parenthesis to meet kernel coding style.
> Also fix indenting due to changes to keep readability.
> 
> I undid modifications to memset(...) which I made in
> previous patches as it could be removed based on
> the fact LIBCFS_ALLOC is executed before memset.
> With this, others can notice warnings against memset
> caused by checkpatch.pl and modify it easily.
> 
> Signed-off-by: Masaru Nomura 
> ---
>  .../staging/lustre/lnet/klnds/socklnd/socklnd.c|  238 
> ++--
>  1 file changed, 119 insertions(+), 119 deletions(-)

This patch doesn't apply against my tree anymore.  Can you please
refresh it and resend?

thanks,

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


Re: [PATCH] staging: comedi: ii_pci20kc: fix usage of uninit scalar in ii20k_attach()

2014-05-23 Thread Greg KH
On Sun, May 04, 2014 at 02:26:09AM +0200, Christian Engelmayer wrote:
> This driver supports the PCI-20001C-1a and PCI-20001C-2a carrier boards.
> The -2a version has 32 on-board DIO channels. In case this variant is
> detected, local variable 'has_dio' is set accordingly. Otherwise it is
> left uninitialized and the following subdevice instantiation depends on
> the stack. Detected by Coverity - CID 1077830.
> 
> Signed-off-by: Christian Engelmayer 
> Reviewed-by: Ian Abbott 
> ---
> Compile tested and applies against branch staging-next of tree
> git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git

It doesn't apply there at all for some odd reason, can you refresh it
and resend?

thanks,

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


Re: [PATCH] staging: lustre: lnet: klnds: Remove prohibited space in socklnd.c

2014-05-23 Thread Greg KH
On Wed, May 21, 2014 at 11:23:33PM +0100, Masaru Nomura wrote:
> Remove prohibited space between function name and open parenthesis
> to meet kernel coding style. Also, fix indenting due to changes.
> 
> Signed-off-by: Masaru Nomura 
> ---
>  .../staging/lustre/lnet/klnds/socklnd/socklnd.c|  230 
> ++--
>  1 file changed, 116 insertions(+), 114 deletions(-)

This patch doesn't apply either, please refresh and resend.

thanks,

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


Re: [PATCH] staging/lustre: remove Peng Tao from Lustre contact list

2014-05-23 Thread Greg Kroah-Hartman
On Sun, May 04, 2014 at 03:45:50PM +0800, Peng Tao wrote:
> I am leaving emc for a new company where I cannot have much
> time working on Lustre. So remove myself from the contact
> list. I will still be around and continue to contribute as a
> hobbyist though.

Thanks for all of your help on this code and the best of luck at your
new job.

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


Re: [PATCH v7 4/4] memstick: Add realtek USB memstick host driver

2014-05-23 Thread Greg Kroah-Hartman
On Wed, Apr 30, 2014 at 03:56:20PM +0800, Roger wrote:
> On 04/28/2014 06:10 PM, Lee Jones wrote:
> >> From: Roger Tseng 
> >>
> >> Realtek USB memstick host driver provides memstick host support based on 
> >> the
> >> Realtek USB card reader MFD driver.
> >>
> >> Signed-off-by: Roger Tseng 
> >> ---
> >>   drivers/memstick/host/Kconfig   |  10 +
> >>   drivers/memstick/host/Makefile  |   1 +
> >>   drivers/memstick/host/rtsx_usb_ms.c | 839 
> >> 
> >>   3 files changed, 850 insertions(+)
> >>   create mode 100644 drivers/memstick/host/rtsx_usb_ms.c
> >
> > Applied, thanks.
> >
> Greg,
> 
> Since all patches have been applied and the device is now supported by 
> the new driver, would you remove the former staging one at 
> drivers/staging/rts5139? Similar removal had been done for our PCIE 
> devices in:
> 
> commit cd2112220b6b0a35fa12ba988a0dd837515dfaf8
> Author: Greg Kroah-Hartman 
> Date:   Fri Oct 26 09:03:21 2012 -0700
> 
>  Staging: remove rts_pstor driver
> 

Now removed, thanks.

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


Re: [PATCH] staging: ion: WARN when the handle kmap_cnt is going to wrap around

2014-05-23 Thread Mitchel Humpherys
++greg-kh and de...@driverdev.osuosl.org
(my bad for missing you the first time around)

On Thu, May 22 2014 at 06:09:11 PM, Colin Cross  wrote:
> On Thu, May 22, 2014 at 5:51 PM, Mitchel Humpherys
>  wrote:
>> There are certain client bugs (double unmap, for example) that can cause
>> the handle->kmap_cnt (an unsigned int) to wrap around from zero. This
>> causes problems when the handle is destroyed because we have:
>>
>> while (handle->kmap_cnt)
>> ion_handle_kmap_put(handle);
>>
>> which takes a long time to complete when kmap_cnt starts at ~0 and can
>> result in a watchdog timeout.
>>
>> WARN and bail when kmap_cnt is about to wrap around from zero.
>>
>> Signed-off-by: Mitchel Humpherys 
>> ---
>>  drivers/staging/android/ion/ion.c | 4 
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/staging/android/ion/ion.c 
>> b/drivers/staging/android/ion/ion.c
>> index 3d5bf14722..f55f61a4cc 100644
>> --- a/drivers/staging/android/ion/ion.c
>> +++ b/drivers/staging/android/ion/ion.c
>> @@ -626,6 +626,10 @@ static void ion_handle_kmap_put(struct ion_handle 
>> *handle)
>>  {
>> struct ion_buffer *buffer = handle->buffer;
>>
>> +   if (!handle->kmap_cnt) {
>> +   WARN(1, "%s: Double unmap detected! bailing...\n", __func__);
>> +   return;
>> +   }
>> handle->kmap_cnt--;
>> if (!handle->kmap_cnt)
>> ion_buffer_kmap_put(buffer);
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
>> hosted by The Linux Foundation
>>
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to kernel-team+unsubscr...@android.com.
>
> Acked-by: Colin Cross 

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/6] Staging: unisys: Fix sparse warnings in uislib

2014-05-23 Thread Greg KH
On Thu, May 22, 2014 at 12:31:10PM -0500, Ken Cox wrote:
> Added ULTRA_VBUS_IOinit_channel() and modified ULTRA_VBUS_init_channel()
> function so that it can operate on both memory space and IO space
> without getting sparse warnings.
> 
> Signed-off-by: Ken Cox 

Don't add a new function with a name that is going to have to later be
cleaned up as it doesn't follow our proper naming conventions.  Please
do it right the first time.

I'm dropping this one.

thanks,

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


Re: [PATCH 2/2] staging: slicoss: handle errors from slic_config_get

2014-05-23 Thread Greg KH
On Thu, May 22, 2014 at 09:38:45PM -0700, David Matlack wrote:
> slic_config_get() can fail. Change the return type from void to
> int and handle the error in slic_card_init(). So now, instead of
> silently failing (and then timing out waiting for the config data),
> the driver will fail loudly at request time.
> 
> Signed-off-by: David Matlack 
> ---
>  drivers/staging/slicoss/slicoss.c | 28 
>  1 file changed, 16 insertions(+), 12 deletions(-)

It looks like I had already applied patch 1/2 here, but not this one,
odd.

Anyway, I've applied this, and should be synced up with you now.  If I
have missed applying anything, please resend.

thanks,

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


Re: [PATCH 4/6] Staging: unisys: Remove unused macros from visorchannel/visorchannel.h

2014-05-23 Thread Greg KH
On Thu, May 22, 2014 at 12:31:12PM -0500, Ken Cox wrote:
> VISORCHANNEL_CHANGE_SERVER_STATE and VISORCHANNEL_CHANGE_CLIENT_STATE
> are never used in any of the source so they have been removed.
> 
> VISORCHANNEL_CHANGE_CLIENT_STATE would have caused a broken kernel build
> after commit  a8d7f21d, but since it was never used the kernel continued
> to build.

This whole driver is marked BROKEN, so it's not building no matter what :)

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


Re: [PATCH 0/6] Staging: unisys: code cleanup patches

2014-05-23 Thread Greg KH
On Thu, May 22, 2014 at 12:31:08PM -0500, Ken Cox wrote:
> This series of patches cleans up the unisys driver code in various ways:
> -fix sparse warnings related to accessing I/O space
> -fix sparse warnings related to dereferencing noderef types
> -add static to function declration 
> -remove unused functions and macros

How are you testing any of these given that the driver is still marked
BROKEN?

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


Re: [PATCH] staging: slicoss: fix use-after-free in slic_entry_probe

2014-05-23 Thread Greg KH
On Thu, May 22, 2014 at 09:25:40PM -0700, David Matlack wrote:
> Fix a use-after-free bug that can cause a kernel oops. If
> slic_card_init fails then slic_entry_probe() (the pci probe()
> function for this device) will return error without cleaning
> up memory (including the registered netdev struct).
> 
> Signed-off-by: David Matlack 
> ---
> This patch was originally sent here https://lkml.org/lkml/2014/5/6/10 with
> my google.com email address. But due to Google's recent change in DMARC
> policies, that patchset was silently dropped for at least some users
> (including my personal gmail account). So I'm sending it out now with
> my gmail.com account. Let me know if this is an issue. Thanks.

I think I've already applied all of these, if not, please let me know.

Also, you forgot to number these patches to let me know what order to
apply them in :(

thanks,

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


[PATCH] staging: dgap: Change GFP_ATOMICs to GFP_KERNEL

2014-05-23 Thread Mark Hounschell
We don't need to use GFP_ATOMIC at driver load time
so use GFP_KERNEL instead.

Signed-off-by: Mark Hounschell 
Cc: Greg Kroah-Hartman 
Tested-by: Mark Hounschell 
---
 drivers/staging/dgap/dgap.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index a89606e..ca264f9 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -1378,7 +1378,7 @@ static int dgap_tty_init(struct board_t *brd)
for (i = 0; i < brd->nasync; i++) {
if (!brd->channels[i]) {
brd->channels[i] =
-   kzalloc(sizeof(struct channel_t), GFP_ATOMIC);
+   kzalloc(sizeof(struct channel_t), GFP_KERNEL);
if (!brd->channels[i])
return -ENOMEM;
}
@@ -4121,11 +4121,11 @@ static int dgap_after_config_loaded(int board)
/*
 * allocate flip buffer for board.
 */
-   dgap_board[board]->flipbuf = kmalloc(MYFLIPLEN, GFP_ATOMIC);
+   dgap_board[board]->flipbuf = kmalloc(MYFLIPLEN, GFP_KERNEL);
if (!dgap_board[board]->flipbuf)
return -ENOMEM;
 
-   dgap_board[board]->flipflagbuf = kmalloc(MYFLIPLEN, GFP_ATOMIC);
+   dgap_board[board]->flipflagbuf = kmalloc(MYFLIPLEN, GFP_KERNEL);
if (!dgap_board[board]->flipflagbuf) {
kfree(dgap_board[board]->flipbuf);
return -ENOMEM;
@@ -7232,7 +7232,7 @@ static struct cnode *dgap_newnode(int t)
 {
struct cnode *n;
 
-   n = kmalloc(sizeof(struct cnode), GFP_ATOMIC);
+   n = kmalloc(sizeof(struct cnode), GFP_KERNEL);
if (n) {
memset((char *)n, 0, sizeof(struct cnode));
n->type = t;
-- 
1.8.4.5

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


[PATCH] staging: dgap: Simplify get_altpin and get_useintr functions

2014-05-23 Thread Mark Hounschell
Simplify dgap_config_get_useintr and dgap_config_get_altpin
changing the case statement to an if statement.

Signed-off-by: Mark Hounschell 
Cc: Greg Kroah-Hartman 
Tested-by: Mark Hounschell 
---
 drivers/staging/dgap/dgap.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index f811cbf..a89606e 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -7310,14 +7310,11 @@ static uint dgap_config_get_useintr(struct board_t *bd)
return 0;
 
for (p = bd->bd_config; p; p = p->next) {
-   switch (p->type) {
-   case INTRNODE:
+   if (p->type == INTRNODE) {
/*
 * check for pcxr types.
 */
return p->u.useintr;
-   default:
-   break;
}
}
 
@@ -7336,14 +7333,11 @@ static uint dgap_config_get_altpin(struct board_t *bd)
return 0;
 
for (p = bd->bd_config; p; p = p->next) {
-   switch (p->type) {
-   case ANODE:
+   if (p->type == ANODE) {
/*
 * check for pcxr types.
 */
return p->u.altpin;
-   default:
-   break;
}
}
 
-- 
1.8.4.5

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


Re: [PATCH] Staging: Media: sn9c102: Fixed a pointer declaration coding style issue

2014-05-23 Thread Hans Verkuil
On 05/23/2014 06:59 PM, Chaitanya Hazarey wrote:
> Hey Dan,
> 
> Sorry my bad, will resubmit the patch in a proper manner with the
> required corrections.
> 

Don't bother. This patch: 
http://comments.gmane.org/gmane.linux.drivers.driver-project.devel/48570
has just been merged and that has the same fixes as your patch.

But thanks anyway :-)

Regards,

Hans

> Thanks for looking into this.
> 
> Thanks,
> 
> Chaitanya
> 
> On Fri, May 23, 2014 at 12:10 AM, Dan Carpenter
>  wrote:
>> On Thu, May 22, 2014 at 04:11:38PM -0700, Chaitanya wrote:
>>> Fixed the ERROR thrown off by checkpatch.pl.
>>>
>>
>> Put the error message here, or say what it was.
>>
>>> Signed-off-by: Chaitanya Hazarey 
>>
>> Could you change your email client so it has your last in the From:
>> header?
>>
>> This patch doesn't apply.  Read this:
>> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/Documentation/email-clients.txt
>>
>> regards,
>> dan carpenter
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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


[PATCH] staging: dgap: Replace double negative conditionals

2014-05-23 Thread Mark Hounschell
This patch replaces double negativeconditionals

Signed-off-by: Mark Hounschell 
Cc: Greg Kroah-Hartman 
Tested-by: Mark Hounschell 
---
 drivers/staging/dgap/dgap.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index d7b27d6..f811cbf 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -6395,7 +6395,7 @@ static int dgap_parsefile(char **in, int remove)
brd = line = conc = NULL;
 
/* perhaps we are adding to an existing list? */
-   while (p->next != NULL)
+   while (p->next)
p = p->next;
 
/* file must start with a BEGIN */
@@ -7233,7 +7233,7 @@ static struct cnode *dgap_newnode(int t)
struct cnode *n;
 
n = kmalloc(sizeof(struct cnode), GFP_ATOMIC);
-   if (n != NULL) {
+   if (n) {
memset((char *)n, 0, sizeof(struct cnode));
n->type = t;
}
@@ -7361,7 +7361,7 @@ static struct cnode *dgap_find_config(int type, int bus, 
int slot)
 
p = &dgap_head;
 
-   while (p->next != NULL) {
+   while (p->next) {
prev = p;
p = p->next;
 
@@ -7381,7 +7381,7 @@ static struct cnode *dgap_find_config(int type, int bus, 
int slot)
 * Keep walking thru the list till we
 * find the next board.
 */
-   while (p->next != NULL) {
+   while (p->next) {
prev2 = p;
p = p->next;
if (p->type == BNODE) {
@@ -7478,13 +7478,11 @@ static char *dgap_create_config_string(struct board_t 
*bd, char *string)
 */
speed = p->u.conc.speed;
q = p->next;
-   if ((q != NULL) && (q->type == MNODE)) {
+   if (q && (q->type == MNODE)) {
*ptr = (p->u.conc.nport + 0x80);
ptr++;
p = q;
-   while ((q->next != NULL) &&
-  (q->next->type) == MNODE) {
-
+   while (q->next && (q->next->type) == MNODE) {
*ptr = (q->u.module.nport + 0x80);
ptr++;
p = q;
-- 
1.8.4.5

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


Re: [PATCH] Staging: Media: sn9c102: Fixed a pointer declaration coding style issue

2014-05-23 Thread Chaitanya Hazarey
Hey Dan,

Sorry my bad, will resubmit the patch in a proper manner with the
required corrections.

Thanks for looking into this.

Thanks,

Chaitanya

On Fri, May 23, 2014 at 12:10 AM, Dan Carpenter
 wrote:
> On Thu, May 22, 2014 at 04:11:38PM -0700, Chaitanya wrote:
>> Fixed the ERROR thrown off by checkpatch.pl.
>>
>
> Put the error message here, or say what it was.
>
>> Signed-off-by: Chaitanya Hazarey 
>
> Could you change your email client so it has your last in the From:
> header?
>
> This patch doesn't apply.  Read this:
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/Documentation/email-clients.txt
>
> regards,
> dan carpenter
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgap: Remove more extra white space and tabs

2014-05-23 Thread Mark Hounschell
Removes more extra white space and tabs

Signed-off-by: Mark Hounschell 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/dgap/dgap.c | 178 +---
 1 file changed, 86 insertions(+), 92 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 02aa1d6..d7b27d6 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -306,11 +306,11 @@ static struct pci_driver dgap_driver = {
 };
 
 struct firmware_info {
-   u8 *conf_name;   /* dgap.conf */
+   u8 *conf_name;  /* dgap.conf */
u8 *bios_name;  /* BIOS filename */
u8 *fep_name;   /* FEP  filename */
u8 *con_name;   /* Concentrator filename  FIXME*/
-   int num;/* sequence number */
+   int num;/* sequence number */
 };
 
 /*
@@ -398,8 +398,8 @@ static struct cnode dgap_head;
 static char dgap_cword[MAXCWORD];
 
 struct toklist {
-   int token;
-   char*string;
+   int token;
+   char *string;
 };
 
 static struct toklist dgap_tlist[] = {
@@ -1542,12 +1542,12 @@ static void dgap_input(struct channel_t *ch)
struct bs_t __iomem *bs;
struct tty_struct *tp;
struct tty_ldisc *ld;
-   uintrmask;
-   uinthead;
-   uinttail;
-   int data_len;
-   ulong   lock_flags;
-   ulong   lock_flags2;
+   uint rmask;
+   uint head;
+   uint tail;
+   int data_len;
+   ulong lock_flags;
+   ulong lock_flags2;
int flip_len;
int len;
int n;
@@ -1862,16 +1862,16 @@ static void dgap_carrier(struct channel_t *ch)
  */
 static int dgap_tty_open(struct tty_struct *tty, struct file *file)
 {
-   struct board_t  *brd;
+   struct board_t *brd;
struct channel_t *ch;
-   struct un_t *un;
+   struct un_t *un;
struct bs_t __iomem *bs;
-   uintmajor;
-   uintminor;
-   int rc;
-   ulong   lock_flags;
-   ulong   lock_flags2;
-   u16 head;
+   uint major;
+   uint minor;
+   int rc;
+   ulong lock_flags;
+   ulong lock_flags2;
+   u16 head;
 
major = MAJOR(tty_devnum(tty));
minor = MINOR(tty_devnum(tty));
@@ -2019,8 +2019,8 @@ static int dgap_block_til_ready(struct tty_struct *tty, 
struct file *file,
 {
int retval = 0;
struct un_t *un;
-   ulong   lock_flags;
-   uintold_flags;
+   ulong lock_flags;
+   uint old_flags;
int sleep_on_un_flags;
 
if (!tty || tty->magic != TTY_MAGIC || !file || !ch ||
@@ -2150,9 +2150,9 @@ static int dgap_block_til_ready(struct tty_struct *tty, 
struct file *file,
  */
 static void dgap_tty_hangup(struct tty_struct *tty)
 {
-   struct board_t  *bd;
+   struct board_t *bd;
struct channel_t *ch;
-   struct un_t *un;
+   struct un_t *un;
 
if (!tty || tty->magic != TTY_MAGIC)
return;
@@ -2171,7 +2171,6 @@ static void dgap_tty_hangup(struct tty_struct *tty)
 
/* flush the transmit queues */
dgap_tty_flush_buffer(tty);
-
 }
 
 /*
@@ -2320,8 +2319,8 @@ static int dgap_tty_chars_in_buffer(struct tty_struct 
*tty)
u8 tbusy;
uint chars;
u16 thead, ttail, tmask, chead, ctail;
-   ulong   lock_flags = 0;
-   ulong   lock_flags2 = 0;
+   ulong lock_flags = 0;
+   ulong lock_flags2 = 0;
 
if (tty == NULL)
return 0;
@@ -2410,7 +2409,7 @@ static int dgap_wait_for_drain(struct tty_struct *tty)
struct bs_t __iomem *bs;
int ret = 0;
uint count = 1;
-   ulong   lock_flags = 0;
+   ulong lock_flags = 0;
 
if (!tty || tty->magic != TTY_MAGIC)
return -EIO;
@@ -2553,7 +2552,7 @@ static int dgap_tty_write_room(struct tty_struct *tty)
struct bs_t __iomem *bs;
u16 head, tail, tmask;
int ret;
-   ulong   lock_flags = 0;
+   ulong lock_flags = 0;
 
if (!tty)
return 0;
@@ -3213,7 +3212,7 @@ static int dgap_tty_digiseta(struct tty_struct *tty,
struct channel_t *ch;
struct un_t *un;
struct digi_t new_digi;
-   ulong   lock_flags = 0;
+   ulong lock_flags = 0;
unsigned long lock_flags2;
 
if (!tty || tty->magic != TTY_MAGIC)
@@ -3493,8 +3492,8 @@ static void dgap_tty_throttle(struct tty_struct *tty)
struct board_t *bd;
struct channel_t *ch;
struct un_t *un;
-   ulong   lock_flags;
-   ulong   lock_flags2;
+   ulong lock_flags;
+   ulong lock_flags2;
 
if (!tty || tty->magic != TTY_MAGIC)
return;
@@ -3529,8 +3528,8 @@ static void dgap_tty_unthrottle(struct tty_struct *tty)
struct board_t *bd;
struct channel_t *ch;
struct un_t *un;
-   ulong   lock_flags;
-   ulong   lock_flags2;
+   ulong lock_flags;
+   ulong l

[PATCH] staging: dgap: Remove unnecessary initialization of variables in declarations

2014-05-23 Thread Mark Hounschell
Removes unnecessary initialization of variables in declarations

Signed-off-by: Mark Hounschell 
Cc: Greg Kroah-Hartman 
Tested-by: Mark Hounschell 
---
 drivers/staging/dgap/dgap.c | 175 +---
 1 file changed, 84 insertions(+), 91 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 2ab7b7c..02aa1d6 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -466,7 +466,7 @@ static struct toklist dgap_tlist[] = {
  */
 static int dgap_init_module(void)
 {
-   int rc = 0;
+   int rc;
 
pr_info("%s, Digi International Part Number %s\n", DG_NAME, DG_PART);
 
@@ -499,7 +499,7 @@ module_init(dgap_init_module);
  */
 static int dgap_start(void)
 {
-   int rc = 0;
+   int rc;
unsigned long flags;
struct device *device;
 
@@ -635,7 +635,7 @@ static void dgap_cleanup_module(void)
  */
 static void dgap_cleanup_board(struct board_t *brd)
 {
-   int i = 0;
+   int i;
 
if (!brd || brd->magic != DGAP_BOARD_MAGIC)
return;
@@ -678,7 +678,7 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
 {
struct board_t *brd;
unsigned int pci_irq;
-   int i = 0;
+   int i;
 
/* get the board structure and prep it */
brd = kzalloc(sizeof(struct board_t), GFP_KERNEL);
@@ -1165,7 +1165,7 @@ static irqreturn_t dgap_intr(int irq, void *voidbrd)
  */
 static void dgap_init_globals(void)
 {
-   int i = 0;
+   int i;
 
for (i = 0; i < MAXBOARDS; i++)
dgap_board[i] = NULL;
@@ -1321,9 +1321,9 @@ static int dgap_tty_init(struct board_t *brd)
 {
int i;
int tlw;
-   uint true_count = 0;
+   uint true_count;
u8 __iomem *vaddr;
-   u8 modem = 0;
+   u8 modem;
struct channel_t *ch;
struct bs_t __iomem *bs;
struct cm_t __iomem *cm;
@@ -1491,7 +1491,7 @@ static int dgap_tty_init(struct board_t *brd)
 static void dgap_tty_uninit(struct board_t *brd)
 {
struct device *dev;
-   int i = 0;
+   int i;
 
if (brd->dgap_major_serial_registered) {
dgap_boards_by_major[brd->serial_driver->major] = NULL;
@@ -1549,11 +1549,11 @@ static void dgap_input(struct channel_t *ch)
ulong   lock_flags;
ulong   lock_flags2;
int flip_len;
-   int len = 0;
-   int n = 0;
+   int len;
+   int n;
u8 *buf;
u8 tmpchar;
-   int s = 0;
+   int s;
 
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
return;
@@ -1866,15 +1866,13 @@ static int dgap_tty_open(struct tty_struct *tty, struct 
file *file)
struct channel_t *ch;
struct un_t *un;
struct bs_t __iomem *bs;
-   uintmajor = 0;
-   uintminor = 0;
-   int rc = 0;
+   uintmajor;
+   uintminor;
+   int rc;
ulong   lock_flags;
ulong   lock_flags2;
u16 head;
 
-   rc = 0;
-
major = MAJOR(tty_devnum(tty));
minor = MINOR(tty_devnum(tty));
 
@@ -2020,10 +2018,10 @@ static int dgap_block_til_ready(struct tty_struct *tty, 
struct file *file,
struct channel_t *ch)
 {
int retval = 0;
-   struct un_t *un = NULL;
+   struct un_t *un;
ulong   lock_flags;
-   uintold_flags = 0;
-   int sleep_on_un_flags = 0;
+   uintold_flags;
+   int sleep_on_un_flags;
 
if (!tty || tty->magic != TTY_MAGIC || !file || !ch ||
ch->magic != DGAP_CHANNEL_MAGIC)
@@ -2187,7 +2185,6 @@ static void dgap_tty_close(struct tty_struct *tty, struct 
file *file)
struct channel_t *ch;
struct un_t *un;
ulong lock_flags;
-   int rc = 0;
 
if (!tty || tty->magic != TTY_MAGIC)
return;
@@ -2253,7 +2250,7 @@ static void dgap_tty_close(struct tty_struct *tty, struct 
file *file)
/* wait for output to drain */
/* This will also return if we take an interrupt */
 
-   rc = dgap_wait_for_drain(tty);
+   dgap_wait_for_drain(tty);
 
dgap_tty_flush_buffer(tty);
tty_ldisc_flush(tty);
@@ -2316,12 +2313,12 @@ static void dgap_tty_close(struct tty_struct *tty, 
struct file *file)
  */
 static int dgap_tty_chars_in_buffer(struct tty_struct *tty)
 {
-   struct board_t *bd = NULL;
-   struct channel_t *ch = NULL;
-   struct un_t *un = NULL;
+   struct board_t *bd;
+   struct channel_t *ch;
+   struct un_t *un;
struct bs_t __iomem *bs;
u8 tbusy;
-   uint chars = 0;
+   uint chars;
u16 thead, ttail, tmask, chead, ctail;
ulong   lock_flags = 0;
ulong   lock_flags2 = 0;
@@ -2411,26 +2408,24 @@ static int dgap_wait_for_drain(struct tty_struct *tty)
struct channel_

Re: [PATCH] staging: rtl8723au: Use kmemdup() instead of memcpy() to duplicate memory

2014-05-23 Thread Jes Sorensen
Benoit Taine  writes:
> This issue was reported by coccicheck using the semantic patch 
> at scripts/coccinelle/api/memdup.cocci, and tested by compilation.
>
> Signed-off-by: Benoit Taine 
> ---
>  drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c |3 +--
>  drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c |   17 +++--
>  2 files changed, 8 insertions(+), 12 deletions(-)

Looks reasonable - I'll add it to the rtl8723au-devel tree and include
it with my next submission to Greg.

Thanks,
Jes

>
> diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
> b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> index e2d426a..f917edd 100644
> --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> @@ -339,12 +339,11 @@ int rtl8723a_FirmwareDownload(struct rtw_adapter 
> *padapter)
>   rtStatus = _FAIL;
>   goto Exit;
>   }
> - firmware_buf = kzalloc(fw->size, GFP_KERNEL);
> + firmware_buf = kmemdup(fw->data, fw->size, GFP_KERNEL);
>   if (!firmware_buf) {
>   rtStatus = _FAIL;
>   goto Exit;
>   }
> - memcpy(firmware_buf, fw->data, fw->size);
>   buf = firmware_buf;
>   fw_size = fw->size;
>   release_firmware(fw);
> diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c 
> b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
> index 182f57c..c88a416 100644
> --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
> +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
> @@ -1426,14 +1426,14 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct 
> rtw_adapter *padapter,
>   pmlmepriv->wps_probe_req_ie = NULL;
>   }
>  
> - pmlmepriv->wps_probe_req_ie =
> - kmalloc(wps_ielen, GFP_KERNEL);
> + pmlmepriv->wps_probe_req_ie = kmemdup(wps_ie,
> +   wps_ielen,
> +   GFP_KERNEL);
>   if (pmlmepriv->wps_probe_req_ie == NULL) {
>   DBG_8723A("%s()-%d: kmalloc() ERROR!\n",
> __func__, __LINE__);
>   return -EINVAL;
>   }
> - memcpy(pmlmepriv->wps_probe_req_ie, wps_ie, wps_ielen);
>   pmlmepriv->wps_probe_req_ie_len = wps_ielen;
>   }
>   }
> @@ -1697,12 +1697,11 @@ static int rtw_cfg80211_set_wpa_ie(struct rtw_adapter 
> *padapter, const u8 *pie,
>   ret = -EINVAL;
>   goto exit;
>   }
> - buf = kzalloc(ielen, GFP_KERNEL);
> + buf = kmemdup(pie, ielen, GFP_KERNEL);
>   if (buf == NULL) {
>   ret = -ENOMEM;
>   goto exit;
>   }
> - memcpy(buf, pie, ielen);
>  
>   /* dump */
>   DBG_8723A("set wpa_ie(length:%zu):\n", ielen);
> @@ -3178,14 +3177,13 @@ static int rtw_cfg80211_set_beacon_wpsp2pie(struct 
> net_device *ndev, char *buf,
>   pmlmepriv->wps_beacon_ie = NULL;
>   }
>  
> - pmlmepriv->wps_beacon_ie =
> - kmalloc(wps_ielen, GFP_KERNEL);
> + pmlmepriv->wps_beacon_ie = kmemdup(wps_ie, wps_ielen,
> +GFP_KERNEL);
>   if (pmlmepriv->wps_beacon_ie == NULL) {
>   DBG_8723A("%s()-%d: kmalloc() ERROR!\n",
> __func__, __LINE__);
>   return -EINVAL;
>   }
> - memcpy(pmlmepriv->wps_beacon_ie, wps_ie, wps_ielen);
>   pmlmepriv->wps_beacon_ie_len = wps_ielen;
>  
>  #ifdef CONFIG_8723AU_AP_MODE
> @@ -3270,14 +3268,13 @@ static int 
> rtw_cfg80211_set_assoc_resp_wpsp2pie(struct net_device *net,
>   pmlmepriv->wps_assoc_resp_ie = NULL;
>   }
>  
> - pmlmepriv->wps_assoc_resp_ie = kmalloc(len, GFP_KERNEL);
> + pmlmepriv->wps_assoc_resp_ie = kmemdup(buf, len, GFP_KERNEL);
>   if (pmlmepriv->wps_assoc_resp_ie == NULL) {
>   DBG_8723A("%s()-%d: kmalloc() ERROR!\n",
> __func__, __LINE__);
>   return -EINVAL;
>  
>   }
> - memcpy(pmlmepriv->wps_assoc_resp_ie, buf, len);
>   pmlmepriv->wps_assoc_resp_ie_len = len;
>   }
>  
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: octeon-usb: prevent memory corruption

2014-05-23 Thread Sergey Popov
28.04.2014 20:14, Sergey Popov пишет:
> 24.03.2014 01:18, Aaro Koskinen пишет:
>> Hi,
>>
>> On Sat, Mar 22, 2014 at 01:13:52PM +0400, Sergey Popov wrote:
>>> scsi 0:0:0:0: Direct-Access SanDisk  Cruzer Facet 1.26 PQ: 0 ANSI: 5
>>> sd 0:0:0:0: [sda] 15633408 512-byte logical blocks: (8.00 GB/7.45 GiB)
>>> usb 1-1: reset high-speed USB device number 2 using OcteonUSB
>>> usb 1-1: reset high-speed USB device number 2 using OcteonUSB
>>> usb 1-1: device descriptor read/64, error -145
>>
>> Can you boot with PRINTK_TIME and USB_STORAGE_DEBUG enabled and send
>> the logs?
>>
>> A.
>>
> 
> Hi again. I am very sorry, your email someway lost, probably due to
> misconfiguration of my MUA.
> 
> I have attached new boot log, kernel(now - 3.15_rc2) is configured with
> PRINTK_TIME and USB_STORAGE_DEBUG as you requested.
> 
> 

Ping. Any news on this issue? Or maybe any clues what triggers this?

-- 
Best regards, Sergey Popov
Gentoo developer
Gentoo Desktop Effects project lead
Gentoo Qt project lead
Gentoo Proxy maintainers project lead



signature.asc
Description: OpenPGP digital signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: Media: sn9c102: Fixed a pointer declaration coding style issue

2014-05-23 Thread Dan Carpenter
On Thu, May 22, 2014 at 04:11:38PM -0700, Chaitanya wrote:
> Fixed the ERROR thrown off by checkpatch.pl.
> 

Put the error message here, or say what it was.

> Signed-off-by: Chaitanya Hazarey 

Could you change your email client so it has your last in the From:
header?

This patch doesn't apply.  Read this:
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/Documentation/email-clients.txt

regards,
dan carpenter

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