staging: wilc1000: Enhance code formatting
PATCH v4 1/1 staging: wilc1000: Enhance code formatting
Trims line size at 80 characters in coreconfigurator.h file by shortening the name of variables.
Problem found with checkpatch.pl.
---
Changes since v3:
*Changed the variables name I modified in coreconfigurator.h in other related files: corecofigurator.c and host_interface.c.
Changes since v2:
*Shorten variables name.
*Separate the patch from a patch set.
Changes since v1:
*Put the patch in a patch set.
drivers/staging/wilc1000/coreconfigurator.c | 26 +++++++++++++------------- drivers/staging/wilc1000/coreconfigurator.h | 4 ++-- drivers/staging/wilc1000/host_interface.c | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-)
drivers/staging/wilc1000/coreconfigurator.c +13 -13
@@ -350,38 +350,38 @@ s32 wilc_parse_network_info(u8 *msg_buffer, }s32 wilc_parse_assoc_resp_info (u8 *buffer,u32 buffer_len, -struct connect_resp_info **ret_connect_resp_info) +struct resp_info **ret_resp_info) { -struct connect_resp_info *connect_resp_info =NULL ; +struct resp_info *resp_info =NULL ;u16 assoc_resp_len =0 ;u8 *ies =NULL ;u16 ies_len =0 ; - connect_resp_info =kzalloc (sizeof (*connect_resp_info),GFP_KERNEL ); -if (!connect_resp_info) + resp_info =kzalloc (sizeof (*resp_info),GFP_KERNEL ); +if (!resp_info)return -ENOMEM ; assoc_resp_len = (u16 )buffer_len; - connect_resp_info->status =get_asoc_status (buffer); -if (connect_resp_info->status ==SUCCESSFUL_STATUSCODE ) { - connect_resp_info->capability =get_assoc_resp_cap_info (buffer); - connect_resp_info->assoc_id =get_asoc_id (buffer); + resp_info->status =get_asoc_status (buffer); +if (resp_info->status ==SUCCESSFUL_STATUSCODE ) { + resp_info->capability =get_assoc_resp_cap_info (buffer); + resp_info->assoc_id =get_asoc_id (buffer); ies = &buffer[CAP_INFO_LEN +STATUS_CODE_LEN +AID_LEN ]; ies_len = assoc_resp_len - (CAP_INFO_LEN +STATUS_CODE_LEN +AID_LEN ); - connect_resp_info->ies =kmemdup (ies, ies_len,GFP_KERNEL ); -if (!connect_resp_info->ies) { -kfree (connect_resp_info); + resp_info->ies =kmemdup (ies, ies_len,GFP_KERNEL ); +if (!resp_info->ies) { +kfree (resp_info);return -ENOMEM ; } - connect_resp_info->ies_len = ies_len; + resp_info->ies_len = ies_len; } - *ret_connect_resp_info = connect_resp_info; + *ret_resp_info = resp_info;return 0 ; }
drivers/staging/wilc1000/coreconfigurator.h +2 -2
@@ -97,7 +97,7 @@ struct network_info {u64 tsf_hi; }; -struct connect_resp_info { +struct resp_info {u16 capability;u16 status;u16 assoc_id;
@@ -123,7 +123,7 @@ struct disconnect_info {s32 wilc_parse_network_info (u8 *msg_buffer,struct network_info **ret_network_info);s32 wilc_parse_assoc_resp_info (u8 *buffer,u32 buffer_len, -struct connect_resp_info **ret_connect_resp_info); +struct resp_info **ret_resp_info);void wilc_scan_complete_received (struct wilc *wilc,u8 *pu8Buffer,u32 u32Length); void wilc_network_info_received(struct wilc *wilc, u8 *pu8Buffer,
drivers/staging/wilc1000/host_interface.c +1 -1
@@ -1336,7 +1336,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif, u8MacStatusAdditionalInfo = pstrRcvdGnrlAsyncInfo->buffer[9 ];if (hif_drv->hif_state ==HOST_IF_WAITING_CONN_RESP ) {u32 u32RcvdAssocRespInfoLen =0 ; -struct connect_resp_info *pstrConnectRespInfo =NULL ; +struct resp_info *pstrConnectRespInfo =NULL ;memset (&strConnectInfo,0 ,sizeof (struct connect_info ));
Signature · 1 line
2.9.3
Quoted 7 lines · Tamara Diaconita
Trims line size at 80 characters in
coreconfigurator.hfile by shortening the name of variables.Problem found with checkpatch.pl.
Signed-off-by Tamara Diaconita <[email protected]>---
Hi Tamara,
This patch is good and succinct. It does one thing well. (It did not give me patch review fatigue ;))
I'd like to see you reflect that focus in your subject line & log message.
Since subject should say what it does, let's be more specific and rather than saying "Enhance code formatting" say something like "rename struct connect_resp_info to resp_info".
Then in your log message you can go on and say why you how shortened the name and it's related assignments. (It allowed you to trim line sizes to 80 and enhance readability.)
So - v5 it!
thanks,
alisons
Quoted 115 lines
Changes since v3:
*Changed the variables name I modified incoreconfigurator.hin other related files:corecofigurator.candhost_interface.c.Changes since v2:
*Shorten variables name.
*Separate the patch from a patch set.Changes since v1:
*Put the patch in a patch set.drivers/staging/wilc1000/coreconfigurator.c | 26 +++++++++++++------------- drivers/staging/wilc1000/coreconfigurator.h | 4 ++-- drivers/staging/wilc1000/host_interface.c | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-)drivers/staging/wilc1000/coreconfigurator.c +13
-13@@ -350,38 +350,38 @@ s32 wilc_parse_network_info(u8 *msg_buffer, }s32 wilc_parse_assoc_resp_info (u8 *buffer,u32 buffer_len, -struct connect_resp_info **ret_connect_resp_info) +struct resp_info **ret_resp_info) { -struct connect_resp_info *connect_resp_info =NULL ; +struct resp_info *resp_info =NULL ;u16 assoc_resp_len =0 ;u8 *ies =NULL ;u16 ies_len =0 ; - connect_resp_info =kzalloc (sizeof (*connect_resp_info),GFP_KERNEL ); -if (!connect_resp_info) + resp_info =kzalloc (sizeof (*resp_info),GFP_KERNEL ); +if (!resp_info)return -ENOMEM ; assoc_resp_len = (u16 )buffer_len; - connect_resp_info->status =get_asoc_status (buffer); -if (connect_resp_info->status ==SUCCESSFUL_STATUSCODE ) { - connect_resp_info->capability =get_assoc_resp_cap_info (buffer); - connect_resp_info->assoc_id =get_asoc_id (buffer); + resp_info->status =get_asoc_status (buffer); +if (resp_info->status ==SUCCESSFUL_STATUSCODE ) { + resp_info->capability =get_assoc_resp_cap_info (buffer); + resp_info->assoc_id =get_asoc_id (buffer); ies = &buffer[CAP_INFO_LEN +STATUS_CODE_LEN +AID_LEN ]; ies_len = assoc_resp_len - (CAP_INFO_LEN +STATUS_CODE_LEN +AID_LEN ); - connect_resp_info->ies =kmemdup (ies, ies_len,GFP_KERNEL ); -if (!connect_resp_info->ies) { -kfree (connect_resp_info); + resp_info->ies =kmemdup (ies, ies_len,GFP_KERNEL ); +if (!resp_info->ies) { +kfree (resp_info);return -ENOMEM ; } - connect_resp_info->ies_len = ies_len; + resp_info->ies_len = ies_len; } - *ret_connect_resp_info = connect_resp_info; + *ret_resp_info = resp_info;return 0 ; }drivers/staging/wilc1000/coreconfigurator.h +2
-2@@ -97,7 +97,7 @@ struct network_info {u64 tsf_hi; }; -struct connect_resp_info { +struct resp_info {u16 capability;u16 status;u16 assoc_id;@@ -123,7 +123,7 @@ struct disconnect_info {s32 wilc_parse_network_info (u8 *msg_buffer,struct network_info **ret_network_info);s32 wilc_parse_assoc_resp_info (u8 *buffer,u32 buffer_len, -struct connect_resp_info **ret_connect_resp_info); +struct resp_info **ret_resp_info);void wilc_scan_complete_received (struct wilc *wilc,u8 *pu8Buffer,u32 u32Length); void wilc_network_info_received(struct wilc *wilc, u8 *pu8Buffer,drivers/staging/wilc1000/host_interface.c +1
-1@@ -1336,7 +1336,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif, u8MacStatusAdditionalInfo = pstrRcvdGnrlAsyncInfo->buffer[9 ];if (hif_drv->hif_state ==HOST_IF_WAITING_CONN_RESP ) {u32 u32RcvdAssocRespInfoLen =0 ; -struct connect_resp_info *pstrConnectRespInfo =NULL ; +struct resp_info *pstrConnectRespInfo =NULL ;memset (&strConnectInfo,0 ,sizeof (struct connect_info ));Signature · 8 lines
2.9.3 -- You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170310102031.32314-1-diaconita.tamara%40gmail.com. For more options, visit https://groups.google.com/d/optout.