2015-10-13 11:02:28

by Tony Cho

[permalink] [raw]
Subject: [PATCH 46/54] staging: wilc1000: rename bIsEnabled of struct set_multicast

From: Leo Kim <[email protected]>

This patch renames bIsEnabled of struct set_multicast to enabled to
avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 42f59fa..7ea9e01 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -140,7 +140,7 @@ struct beacon_attr {
};

struct set_multicast {
- bool bIsEnabled;
+ bool enabled;
u32 u32count;
};

@@ -2796,10 +2796,10 @@ static void Handle_SetMulticastFilter(struct host_if_drv *hif_drv,
goto ERRORHANDLER;

pu8CurrByte = strWID.val;
- *pu8CurrByte++ = (strHostIfSetMulti->bIsEnabled & 0xFF);
- *pu8CurrByte++ = ((strHostIfSetMulti->bIsEnabled >> 8) & 0xFF);
- *pu8CurrByte++ = ((strHostIfSetMulti->bIsEnabled >> 16) & 0xFF);
- *pu8CurrByte++ = ((strHostIfSetMulti->bIsEnabled >> 24) & 0xFF);
+ *pu8CurrByte++ = (strHostIfSetMulti->enabled & 0xFF);
+ *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 8) & 0xFF);
+ *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 16) & 0xFF);
+ *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 24) & 0xFF);

*pu8CurrByte++ = (strHostIfSetMulti->u32count & 0xFF);
*pu8CurrByte++ = ((strHostIfSetMulti->u32count >> 8) & 0xFF);
@@ -4912,7 +4912,7 @@ s32 host_int_setup_multicast_filter(struct host_if_drv *hif_drv,
msg.id = HOST_IF_MSG_SET_MULTICAST_FILTER;
msg.drv = hif_drv;

- pstrMulticastFilterParam->bIsEnabled = bIsEnabled;
+ pstrMulticastFilterParam->enabled = bIsEnabled;
pstrMulticastFilterParam->u32count = u32count;

s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
--
1.9.1



2015-10-13 11:03:13

by Tony Cho

[permalink] [raw]
Subject: [PATCH 53/54] staging: wilc1000: rename u32Length of struct rcvd_net_info

From: Leo Kim <[email protected]>

This patch renames u32Length of struct rcvd_net_info to len to
avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 2 +-
drivers/staging/wilc1000/host_interface.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 432b275..392bf08 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4439,7 +4439,7 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
msg.id = HOST_IF_MSG_RCVD_NTWRK_INFO;
msg.drv = hif_drv;

- msg.body.net_info.u32Length = u32Length;
+ msg.body.net_info.len = u32Length;
msg.body.net_info.buffer = kmalloc(u32Length, GFP_KERNEL);
memcpy(msg.body.net_info.buffer, pu8Buffer, u32Length);

diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index 778dbf5..146a60f 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -200,7 +200,7 @@ typedef void (*wilc_remain_on_chan_ready)(void *); /*Remain on channel callback
*/
struct rcvd_net_info {
u8 *buffer;
- u32 u32Length;
+ u32 len;
};

struct hidden_net_info {
--
1.9.1


2015-10-13 11:02:47

by Tony Cho

[permalink] [raw]
Subject: [PATCH 49/54] staging: wilc1000: rename bIsEnabled of struct power_mgmt_param

From: Leo Kim <[email protected]>

This patch renames bIsEnabled of struct power_mgmt_param to enabled to
avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 4f7ebdc..0c44fd0 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -154,8 +154,7 @@ struct del_sta {
};

struct power_mgmt_param {
-
- bool bIsEnabled;
+ bool enabled;
u32 u32Timeout;
};

@@ -2763,7 +2762,7 @@ static void Handle_PowerManagement(struct host_if_drv *hif_drv,

strWID.id = (u16)WID_POWER_MANAGEMENT;

- if (strPowerMgmtParam->bIsEnabled == true)
+ if (strPowerMgmtParam->enabled == true)
s8PowerMode = MIN_FAST_PS;
else
s8PowerMode = NO_POWERSAVE;
@@ -4881,7 +4880,7 @@ s32 host_int_set_power_mgmt(struct host_if_drv *hif_drv,
msg.id = HOST_IF_MSG_POWER_MGMT;
msg.drv = hif_drv;

- pstrPowerMgmtParam->bIsEnabled = bIsEnabled;
+ pstrPowerMgmtParam->enabled = bIsEnabled;
pstrPowerMgmtParam->u32Timeout = u32Timeout;


--
1.9.1


2015-10-14 05:26:23

by Tony Cho

[permalink] [raw]
Subject: Re: [PATCH 54/54] staging: wilc1000: wilc_msgqueue.c : remove the goto ERRORHANDER



On 2015년 10월 13일 23:08, Mike Rapoport wrote:
> On Tue, Oct 13, 2015 at 08:02:12PM +0900, Tony Cho wrote:
>> From: Leo Kim <[email protected]>
>>
>> This patch removes goto ERRORHANDER and the result variable in wilc_mq_send.
>> Then, the error type is directly returned. If normal operation, freeing memory
>> is not needed in this function.
>>
>> Signed-off-by: Leo Kim <[email protected]>
>> Signed-off-by: Tony Cho <[email protected]>
>> ---
>> drivers/staging/wilc1000/wilc_msgqueue.c | 20 +++++---------------
>> 1 file changed, 5 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
>> index b13809a..60539aa 100644
>> --- a/drivers/staging/wilc1000/wilc_msgqueue.c
>> +++ b/drivers/staging/wilc1000/wilc_msgqueue.c
>> @@ -56,20 +56,17 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle)
>> int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
>> const void *pvSendBuffer, u32 u32SendBufferSize)
>> {
>> - int result = 0;
>> unsigned long flags;
>> Message *pstrMessage = NULL;
>>
>> if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) {
>> PRINT_ER("pHandle or pvSendBuffer is null\n");
>> - result = -EFAULT;
>> - goto ERRORHANDLER;
>> + return -EFAULT;
>> }
>>
>> if (pHandle->bExiting) {
>> PRINT_ER("pHandle fail\n");
>> - result = -EFAULT;
>> - goto ERRORHANDLER;
>> + return -EFAULT;
>> }
>>
>> spin_lock_irqsave(&pHandle->strCriticalSection, flags);
>> @@ -83,8 +80,8 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
>> pstrMessage->pvBuffer = kmemdup(pvSendBuffer, u32SendBufferSize,
>> GFP_ATOMIC);
>> if (!pstrMessage->pvBuffer) {
>> - result = -ENOMEM;
>> - goto ERRORHANDLER;
>> + kfree(pstrMessage);
>> + return -ENOMEM;
> It seems that the error path returns from the function while still
> holding spinlock and semaphore. It would be better to rework allocation
> errors handling so that the locks will be released, rather than just
> remove goto...

Thanks for your review. I am going to send v2 for it.

Tony.

>> }
>>
>> /* add it to the message queue */
>> @@ -103,14 +100,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
>>
>> up(&pHandle->hSem);
>>
>> -ERRORHANDLER:
>> - /* error occured, free any allocations */
>> - if (pstrMessage) {
>> - kfree(pstrMessage->pvBuffer);
>> - kfree(pstrMessage);
>> - }
>> -
>> - return result;
>> + return 0;
>> }
>>
>> /*!
>> --
>> 1.9.1
>>
>> _______________________________________________
>> devel mailing list
>> [email protected]
>> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


2015-10-13 11:02:53

by Tony Cho

[permalink] [raw]
Subject: [PATCH 50/54] staging: wilc1000: rename u32Timeout of struct power_mgmt_param

From: Leo Kim <[email protected]>

This patch renames u32Timeout of struct power_mgmt_param to timeout to
avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 0c44fd0..97d1bd8 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -155,7 +155,7 @@ struct del_sta {

struct power_mgmt_param {
bool enabled;
- u32 u32Timeout;
+ u32 timeout;
};

struct set_ip_addr {
@@ -4881,8 +4881,7 @@ s32 host_int_set_power_mgmt(struct host_if_drv *hif_drv,
msg.drv = hif_drv;

pstrPowerMgmtParam->enabled = bIsEnabled;
- pstrPowerMgmtParam->u32Timeout = u32Timeout;
-
+ pstrPowerMgmtParam->timeout = u32Timeout;

s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
if (s32Error)
--
1.9.1


2015-10-13 11:03:19

by Tony Cho

[permalink] [raw]
Subject: [PATCH 54/54] staging: wilc1000: wilc_msgqueue.c : remove the goto ERRORHANDER

From: Leo Kim <[email protected]>

This patch removes goto ERRORHANDER and the result variable in wilc_mq_send.
Then, the error type is directly returned. If normal operation, freeing memory
is not needed in this function.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/wilc_msgqueue.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
index b13809a..60539aa 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -56,20 +56,17 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle)
int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
const void *pvSendBuffer, u32 u32SendBufferSize)
{
- int result = 0;
unsigned long flags;
Message *pstrMessage = NULL;

if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) {
PRINT_ER("pHandle or pvSendBuffer is null\n");
- result = -EFAULT;
- goto ERRORHANDLER;
+ return -EFAULT;
}

if (pHandle->bExiting) {
PRINT_ER("pHandle fail\n");
- result = -EFAULT;
- goto ERRORHANDLER;
+ return -EFAULT;
}

spin_lock_irqsave(&pHandle->strCriticalSection, flags);
@@ -83,8 +80,8 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
pstrMessage->pvBuffer = kmemdup(pvSendBuffer, u32SendBufferSize,
GFP_ATOMIC);
if (!pstrMessage->pvBuffer) {
- result = -ENOMEM;
- goto ERRORHANDLER;
+ kfree(pstrMessage);
+ return -ENOMEM;
}

/* add it to the message queue */
@@ -103,14 +100,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,

up(&pHandle->hSem);

-ERRORHANDLER:
- /* error occured, free any allocations */
- if (pstrMessage) {
- kfree(pstrMessage->pvBuffer);
- kfree(pstrMessage);
- }
-
- return result;
+ return 0;
}

/*!
--
1.9.1


2015-10-13 11:03:00

by Tony Cho

[permalink] [raw]
Subject: [PATCH 51/54] staging: wilc1000: rename au8IPAddr of struct set_ip_addr

From: Leo Kim <[email protected]>

This patch renames au8IPAddr of struct set_ip_addr to ip_addr to
avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 97d1bd8..8fb6ef5 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -159,7 +159,7 @@ struct power_mgmt_param {
};

struct set_ip_addr {
- u8 *au8IPAddr;
+ u8 *ip_addr;
u8 idx;
};

@@ -3079,12 +3079,12 @@ static int hostIFthread(void *pvArg)

case HOST_IF_MSG_SET_IPADDRESS:
PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_SET_IPADDRESS\n");
- Handle_set_IPAddress(msg.drv, msg.body.ip_info.au8IPAddr, msg.body.ip_info.idx);
+ Handle_set_IPAddress(msg.drv, msg.body.ip_info.ip_addr, msg.body.ip_info.idx);
break;

case HOST_IF_MSG_GET_IPADDRESS:
PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_SET_IPADDRESS\n");
- Handle_get_IPAddress(msg.drv, msg.body.ip_info.au8IPAddr, msg.body.ip_info.idx);
+ Handle_get_IPAddress(msg.drv, msg.body.ip_info.ip_addr, msg.body.ip_info.idx);
break;

case HOST_IF_MSG_SET_MAC_ADDRESS:
@@ -5162,7 +5162,7 @@ s32 host_int_setup_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)

msg.id = HOST_IF_MSG_SET_IPADDRESS;

- msg.body.ip_info.au8IPAddr = u16ipadd;
+ msg.body.ip_info.ip_addr = u16ipadd;
msg.drv = hif_drv;
msg.body.ip_info.idx = idx;

@@ -5189,7 +5189,7 @@ s32 host_int_get_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)

msg.id = HOST_IF_MSG_GET_IPADDRESS;

- msg.body.ip_info.au8IPAddr = u16ipadd;
+ msg.body.ip_info.ip_addr = u16ipadd;
msg.drv = hif_drv;
msg.body.ip_info.idx = idx;

--
1.9.1


2015-10-13 14:08:49

by Mike Rapoport

[permalink] [raw]
Subject: Re: [PATCH 54/54] staging: wilc1000: wilc_msgqueue.c : remove the goto ERRORHANDER

On Tue, Oct 13, 2015 at 08:02:12PM +0900, Tony Cho wrote:
> From: Leo Kim <[email protected]>
>
> This patch removes goto ERRORHANDER and the result variable in wilc_mq_send.
> Then, the error type is directly returned. If normal operation, freeing memory
> is not needed in this function.
>
> Signed-off-by: Leo Kim <[email protected]>
> Signed-off-by: Tony Cho <[email protected]>
> ---
> drivers/staging/wilc1000/wilc_msgqueue.c | 20 +++++---------------
> 1 file changed, 5 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
> index b13809a..60539aa 100644
> --- a/drivers/staging/wilc1000/wilc_msgqueue.c
> +++ b/drivers/staging/wilc1000/wilc_msgqueue.c
> @@ -56,20 +56,17 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle)
> int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
> const void *pvSendBuffer, u32 u32SendBufferSize)
> {
> - int result = 0;
> unsigned long flags;
> Message *pstrMessage = NULL;
>
> if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) {
> PRINT_ER("pHandle or pvSendBuffer is null\n");
> - result = -EFAULT;
> - goto ERRORHANDLER;
> + return -EFAULT;
> }
>
> if (pHandle->bExiting) {
> PRINT_ER("pHandle fail\n");
> - result = -EFAULT;
> - goto ERRORHANDLER;
> + return -EFAULT;
> }
>
> spin_lock_irqsave(&pHandle->strCriticalSection, flags);
> @@ -83,8 +80,8 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
> pstrMessage->pvBuffer = kmemdup(pvSendBuffer, u32SendBufferSize,
> GFP_ATOMIC);
> if (!pstrMessage->pvBuffer) {
> - result = -ENOMEM;
> - goto ERRORHANDLER;
> + kfree(pstrMessage);
> + return -ENOMEM;

It seems that the error path returns from the function while still
holding spinlock and semaphore. It would be better to rework allocation
errors handling so that the locks will be released, rather than just
remove goto...

> }
>
> /* add it to the message queue */
> @@ -103,14 +100,7 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
>
> up(&pHandle->hSem);
>
> -ERRORHANDLER:
> - /* error occured, free any allocations */
> - if (pstrMessage) {
> - kfree(pstrMessage->pvBuffer);
> - kfree(pstrMessage);
> - }
> -
> - return result;
> + return 0;
> }
>
> /*!
> --
> 1.9.1
>
> _______________________________________________
> devel mailing list
> [email protected]
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

2015-10-13 11:02:40

by Tony Cho

[permalink] [raw]
Subject: [PATCH 48/54] staging: wilc1000: rename au8MacAddr of struct del_sta

From: Leo Kim <[email protected]>

This patch renames au8MacAddr of struct del_sta to mac_addr to
avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 9cd42f7..4f7ebdc 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -150,7 +150,7 @@ struct del_all_sta {
};

struct del_sta {
- u8 au8MacAddr[ETH_ALEN];
+ u8 mac_addr[ETH_ALEN];
};

struct power_mgmt_param {
@@ -2544,7 +2544,7 @@ static void Handle_DelStation(struct host_if_drv *hif_drv,

pu8CurrByte = strWID.val;

- memcpy(pu8CurrByte, pstrDelStaParam->au8MacAddr, ETH_ALEN);
+ memcpy(pu8CurrByte, pstrDelStaParam->mac_addr, ETH_ALEN);

s32Error = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
@@ -4758,9 +4758,9 @@ s32 host_int_del_station(struct host_if_drv *hif_drv, const u8 *pu8MacAddr)
msg.drv = hif_drv;

if (pu8MacAddr == NULL)
- memset(pstrDelStationMsg->au8MacAddr, 255, ETH_ALEN);
+ memset(pstrDelStationMsg->mac_addr, 255, ETH_ALEN);
else
- memcpy(pstrDelStationMsg->au8MacAddr, pu8MacAddr, ETH_ALEN);
+ memcpy(pstrDelStationMsg->mac_addr, pu8MacAddr, ETH_ALEN);

s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
if (s32Error)
--
1.9.1


2015-10-13 11:02:34

by Tony Cho

[permalink] [raw]
Subject: [PATCH 47/54] staging: wilc1000: rename u32count of struct set_multicast

From: Leo Kim <[email protected]>

This patch renames u32count of struct set_multicast to cnt to
avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 7ea9e01..9cd42f7 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -141,7 +141,7 @@ struct beacon_attr {

struct set_multicast {
bool enabled;
- u32 u32count;
+ u32 cnt;
};

struct del_all_sta {
@@ -2790,7 +2790,7 @@ static void Handle_SetMulticastFilter(struct host_if_drv *hif_drv,

strWID.id = (u16)WID_SETUP_MULTICAST_FILTER;
strWID.type = WID_BIN;
- strWID.size = sizeof(struct set_multicast) + ((strHostIfSetMulti->u32count) * ETH_ALEN);
+ strWID.size = sizeof(struct set_multicast) + ((strHostIfSetMulti->cnt) * ETH_ALEN);
strWID.val = kmalloc(strWID.size, GFP_KERNEL);
if (strWID.val == NULL)
goto ERRORHANDLER;
@@ -2801,13 +2801,13 @@ static void Handle_SetMulticastFilter(struct host_if_drv *hif_drv,
*pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 16) & 0xFF);
*pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 24) & 0xFF);

- *pu8CurrByte++ = (strHostIfSetMulti->u32count & 0xFF);
- *pu8CurrByte++ = ((strHostIfSetMulti->u32count >> 8) & 0xFF);
- *pu8CurrByte++ = ((strHostIfSetMulti->u32count >> 16) & 0xFF);
- *pu8CurrByte++ = ((strHostIfSetMulti->u32count >> 24) & 0xFF);
+ *pu8CurrByte++ = (strHostIfSetMulti->cnt & 0xFF);
+ *pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 8) & 0xFF);
+ *pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 16) & 0xFF);
+ *pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 24) & 0xFF);

- if ((strHostIfSetMulti->u32count) > 0)
- memcpy(pu8CurrByte, gau8MulticastMacAddrList, ((strHostIfSetMulti->u32count) * ETH_ALEN));
+ if ((strHostIfSetMulti->cnt) > 0)
+ memcpy(pu8CurrByte, gau8MulticastMacAddrList, ((strHostIfSetMulti->cnt) * ETH_ALEN));

s32Error = send_config_pkt(SET_CFG, &strWID, 1,
get_id_from_handler(hif_drv));
@@ -4913,7 +4913,7 @@ s32 host_int_setup_multicast_filter(struct host_if_drv *hif_drv,
msg.drv = hif_drv;

pstrMulticastFilterParam->enabled = bIsEnabled;
- pstrMulticastFilterParam->u32count = u32count;
+ pstrMulticastFilterParam->cnt = u32count;

s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
if (s32Error)
--
1.9.1


2015-10-13 11:03:07

by Tony Cho

[permalink] [raw]
Subject: [PATCH 52/54] staging: wilc1000: rename pu8Buffer of struct rcvd_net_info

From: Leo Kim <[email protected]>

This patch renames pu8Buffer of struct rcvd_net_info to buffer to
avoid CamelCase naming convention.

Signed-off-by: Leo Kim <[email protected]>
Signed-off-by: Tony Cho <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 13 ++++++-------
drivers/staging/wilc1000/host_interface.h | 2 +-
2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 8fb6ef5..432b275 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1450,7 +1450,7 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,

if (hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
PRINT_D(HOSTINF_DBG, "State: Scanning, parsing network information received\n");
- parse_network_info(pstrRcvdNetworkInfo->pu8Buffer, &pstrNetworkInfo);
+ parse_network_info(pstrRcvdNetworkInfo->buffer, &pstrNetworkInfo);
if ((pstrNetworkInfo == NULL)
|| (hif_drv->strWILC_UsrScanReq.pfUserScanResult == NULL)) {
PRINT_ER("driver is null\n");
@@ -1509,9 +1509,9 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
}

done:
- if (pstrRcvdNetworkInfo->pu8Buffer != NULL) {
- kfree(pstrRcvdNetworkInfo->pu8Buffer);
- pstrRcvdNetworkInfo->pu8Buffer = NULL;
+ if (pstrRcvdNetworkInfo->buffer != NULL) {
+ kfree(pstrRcvdNetworkInfo->buffer);
+ pstrRcvdNetworkInfo->buffer = NULL;
}

if (pstrNetworkInfo != NULL) {
@@ -4440,9 +4440,8 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
msg.drv = hif_drv;

msg.body.net_info.u32Length = u32Length;
- msg.body.net_info.pu8Buffer = kmalloc(u32Length, GFP_KERNEL);
- memcpy(msg.body.net_info.pu8Buffer,
- pu8Buffer, u32Length);
+ msg.body.net_info.buffer = kmalloc(u32Length, GFP_KERNEL);
+ memcpy(msg.body.net_info.buffer, pu8Buffer, u32Length);

s32Error = wilc_mq_send(&gMsgQHostIF, &msg, sizeof(struct host_if_msg));
if (s32Error)
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index 0c5f395..778dbf5 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -199,7 +199,7 @@ typedef void (*wilc_remain_on_chan_ready)(void *); /*Remain on channel callback
* @version 1.0
*/
struct rcvd_net_info {
- u8 *pu8Buffer;
+ u8 *buffer;
u32 u32Length;
};

--
1.9.1