All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] staging: wilc1000: Enhance code formatting
@ 2017-03-10 10:20 Tamara Diaconita
  2017-03-10 18:04 ` [Outreachy kernel] " Alison Schofield
  0 siblings, 1 reply; 2+ messages in thread
From: Tamara Diaconita @ 2017-03-10 10:20 UTC (permalink / raw)
  To: aditya.shankar, ganesh.krishna, gregkh, outreachy-kernel; +Cc: Tamara Diaconita

Trims line size at 80 characters in coreconfigurator.h file by
shortening the name of variables.

Problem found with checkpatch.pl.

Signed-off-by: Tamara Diaconita <diaconita.tamara@gmail.com>
---
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(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 6229947..572a077 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -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;
 }
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index 10101f8..f40d6f2 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -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,
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 2429c85..baed80d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -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));
 
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH v4] staging: wilc1000: Enhance code formatting
  2017-03-10 10:20 [PATCH v4] staging: wilc1000: Enhance code formatting Tamara Diaconita
@ 2017-03-10 18:04 ` Alison Schofield
  0 siblings, 0 replies; 2+ messages in thread
From: Alison Schofield @ 2017-03-10 18:04 UTC (permalink / raw)
  To: Tamara Diaconita
  Cc: aditya.shankar, ganesh.krishna, gregkh, outreachy-kernel,
	Tamara Diaconita

On Fri, Mar 10, 2017 at 12:20:31PM +0200, Tamara Diaconita wrote:
> Trims line size at 80 characters in coreconfigurator.h file by
> shortening the name of variables.
> 
> Problem found with checkpatch.pl.
> 
> Signed-off-by: Tamara Diaconita <diaconita.tamara@gmail.com>
> ---

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


> 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(-)
> 
> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
> index 6229947..572a077 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.c
> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> @@ -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;
>  }
> diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
> index 10101f8..f40d6f2 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.h
> +++ b/drivers/staging/wilc1000/coreconfigurator.h
> @@ -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,
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 2429c85..baed80d 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -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));
>  
> -- 
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-10 18:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-10 10:20 [PATCH v4] staging: wilc1000: Enhance code formatting Tamara Diaconita
2017-03-10 18:04 ` [Outreachy kernel] " Alison Schofield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.