[09/13] lib: fwts_list: some minor fwts coding style changes
diff mbox series

Message ID 20180814112435.22166-10-colin.king@canonical.com
State Accepted
Headers show
Series
  • lib: minor code clean up
Related show

Commit Message

Colin King Aug. 14, 2018, 11:24 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

No functional change.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_list.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Alex Hung Aug. 14, 2018, 7:15 p.m. UTC | #1
On 2018-08-14 04:24 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> No functional change.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/src/fwts_list.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/lib/src/fwts_list.c b/src/lib/src/fwts_list.c
> index dd870e3a..8fd7ea04 100644
> --- a/src/lib/src/fwts_list.c
> +++ b/src/lib/src/fwts_list.c
> @@ -85,7 +85,7 @@ fwts_list_link *fwts_list_append(fwts_list *list, void *data)
>   	if (!list)
>   		return NULL;
>   
> -	if ((link = calloc(1,sizeof(fwts_list_link))) == NULL)
> +	if ((link = calloc(1, sizeof(fwts_list_link))) == NULL)
>   		return NULL;
>   
>   	link->data = data;
> @@ -117,6 +117,7 @@ fwts_list_link *fwts_list_add_ordered(fwts_list *list, void *new_data, fwts_list
>   
>   	for (list_item = &list->head; *list_item; list_item = &(*list_item)->next) {
>   		void *data = (void *)(*list_item)->data;
> +
>   		if (compare(data, new_data) >= 0) {
>   			new_list_item->next = (*list_item);
>   			break;
> 


Acked-by: Alex Hung <alex.hung@canonical.com>
ivanhu Aug. 16, 2018, 9:05 a.m. UTC | #2
On 08/14/2018 07:24 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> No functional change.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_list.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_list.c b/src/lib/src/fwts_list.c
> index dd870e3a..8fd7ea04 100644
> --- a/src/lib/src/fwts_list.c
> +++ b/src/lib/src/fwts_list.c
> @@ -85,7 +85,7 @@ fwts_list_link *fwts_list_append(fwts_list *list, void *data)
>  	if (!list)
>  		return NULL;
>  
> -	if ((link = calloc(1,sizeof(fwts_list_link))) == NULL)
> +	if ((link = calloc(1, sizeof(fwts_list_link))) == NULL)
>  		return NULL;
>  
>  	link->data = data;
> @@ -117,6 +117,7 @@ fwts_list_link *fwts_list_add_ordered(fwts_list *list, void *new_data, fwts_list
>  
>  	for (list_item = &list->head; *list_item; list_item = &(*list_item)->next) {
>  		void *data = (void *)(*list_item)->data;
> +
>  		if (compare(data, new_data) >= 0) {
>  			new_list_item->next = (*list_item);
>  			break;

Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch
diff mbox series

diff --git a/src/lib/src/fwts_list.c b/src/lib/src/fwts_list.c
index dd870e3a..8fd7ea04 100644
--- a/src/lib/src/fwts_list.c
+++ b/src/lib/src/fwts_list.c
@@ -85,7 +85,7 @@  fwts_list_link *fwts_list_append(fwts_list *list, void *data)
 	if (!list)
 		return NULL;
 
-	if ((link = calloc(1,sizeof(fwts_list_link))) == NULL)
+	if ((link = calloc(1, sizeof(fwts_list_link))) == NULL)
 		return NULL;
 
 	link->data = data;
@@ -117,6 +117,7 @@  fwts_list_link *fwts_list_add_ordered(fwts_list *list, void *new_data, fwts_list
 
 	for (list_item = &list->head; *list_item; list_item = &(*list_item)->next) {
 		void *data = (void *)(*list_item)->data;
+
 		if (compare(data, new_data) >= 0) {
 			new_list_item->next = (*list_item);
 			break;